parameter data type

hello,

I am using an sql datasource control in my application. It takes a parameter value which is of type boolean. The parameter is passed through a dropdown control. I am adding an item called "choose one " to the drop down list other than two items each representing a boolean value.. There is a gridview which is used to display the results returned by the query. So on page load the page has only the drop down and if we select an item from the dropdown the grid will get populated based on the boolean value associated with it that is how I want it to work. But since on page load the data type of the choose one item is not boolean I am getting error. How can I solve this problem?

Please help.

Thanks

0
bendJoe
10/3/2007 2:10:40 PM
asp.net.object-datasource 16182 articles. 0 followers. Follow

1 Replies
484 Views

Similar Articles

[PageSpeed] 5

So, in your drop down, you've got this:

(Select)
Yes
No

Set the values to

-1
True
False

And just test for the -1 value before binding your gridview


Mark this post as the "Answer" if it was the answer.
0
sswanner1
10/3/2007 3:35:05 PM
Reply:

Similar Artilces:

Difference between var type of .NET 3.5 and object Data Type in .NET 2.0?
Hi All,With .NET 3.5 a new feature is introduced of defining Anonymous Type.You can achieve this with keyword "var".We can achieve the same functionality in .NET 2.0 with object type.What is the difference between var type of .NET 3.5 and object Data Type in .NET 2.0?Virendra (MCTS)My Site, Blog virendra1983:With .NET 3.5 a new feature is introduced of defining Anonymous Type. var types are actually strongly typed in design time. What happens in the IDE infers the type of the object based on its initialisation so you get strong typing and intellisensee.g.var i = 9...

Adding object type parameter to Object data source (not string)
Hi,   I have an application with the following set up (basic):   Data Access Layer: public void insertApplication(int applicationID, string applicationName, string versionNo) { string insertCommandStr = "INSERT INTO [Applications] ([ApplicationID], [ApplicationName], [VersionNo]) VALUES (@ApplicationID, @ApplicationName, @VersionNo)"; .... ....   }  Business Layer   public void insertApplication(Application a) { ApplicationsDB applicationsDB = new ApplicationsDB(); applicationsDB.insertApplication(a.ApplicationID, a.ApplicationName, a.VersionNo); } ...

ObjectDataSource insert using Data Object Type and parameter values from session object
Hi,I have my ObjectDataSource set up as follows:        <asp:ObjectDataSource    ID="dsInsertJob"                                 runat="server"                                 TypeName="ContentReview.JobDB"                      &...

.Net provider mishandles data type of parameter
The ASA8 .Net data provider does not properly handle the data type of a parameter. This code throws a System.Exception when, duing ExecuteScalar(), the provider attempts to assign the value 99999 to a smallint. An error also occurs when a string datatype is used for the parameter. AsaConnection conn = new AsaConnection("uid=dba;pwd=sql;data source=ASA 8.0 Sample"); conn.Open(); AsaCommand cmd = new AsaCommand(); cmd.CommandText = "SELECT ? FROM dummy"; AsaParameter parm = new AsaParameter("parm1",AsaDbType.Integer); parm.Value = 99999; // exceeds ...

.NET Web Service pass in and out parameter data type
I need to create a web service which takes individual user's information (age, gender, etc) as input and return output information with multiple fields too. In order for the client able to call the web service without language limitation, I excluded DATASET as the input and output. My question is, is Struct a better choice, or I simply can use a concatenated string? or is there any other better way of passing in/out the values? Thanks This would be a design consideration; If your web service is following a facade pattern and you want it loosly coupled and interoperable, parameterizing is ...

Gridview Search Without Object Datasource Filter ParametersGridview Search Without Object Datasource Filter Parameters
Couple weeks ago I read a article about highlighted search in Gridview  (http://blog.evonet.com.au/post/2008/06/25/Gridview-with-highlighted-search-results.aspx) and in my project I used things I learned but now things changed I have a gridview and in code I give its datasource so because I dont use any objectdatasource I dont know where to write my filtering parameters. Is there anyway to use filtering without objectdatasource, or is there a way to give objectdatasource an source then bind it to my gridview. My code:  //No objectdatasource how can I conduct a search?GridView1.Da...

error --------------------unable to cast object of type'system.data.datatable'to type system.data.datarow[]
getting error in the bold line  so plz help me to resolve the problem  Private Sub form1_load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load con.Open() Strquery = "Select * from optimizer" adp = New SqlDataAdapter(Strquery, con) adp.Fill(ds, "optimizer") dtb = ds.Tables("optimizer") 'cmdCommand = New SqlCommand(Strquery, con) Try 'dr = cmdCommand.ExecuteReader fs = File.Open("c:/abc.txt", FileMode.Create, FileAccess.Write, FileShare.None) sw = New StreamWriter(fs) For Each drow In ds.Tables sw.WriteLine(drow(0).ToString +...

Jaguar component using object data type as input parameter?
I would like to do a Jaguar component like this, public String getFullName(NameHolder hd); I checked the generated IDL. It ignored this method because iti does not know about NameHolder object. I definded this object in my code already. I thought PowerJ is smart enough to pick it up. I used to be able to make this work. I built IDL myself. It was very difficult. Is there an easy way that we can do using PowerJ? Is this possible? Thanks Jim, The importer can import the following Java types and map them to IDL: 1) public final class, NOT serializable and no methods is m...

Unable to cast object of type 'System.Object[]' to type 'System.Data.DataView'.
I am tring to retieve a single node from my BLL code which retrieve one instane of Repot object:DataView dv = (DataView)objBoutPrep.Select();I am getting error:Unable to cast object of type 'System.Object[]' to type 'System.Data.DataView'. The BLL code returns onle one object and not a list of objects.Please help Client code: <asp:ObjectDataSource ID="objBoutPrep" runat="server" SelectMethod="GetRByID" UpdateMethod="UpdateT" TypeName="MB.K.BLL.G.Report"> <SelectParameters> <asp:Query...

Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'.
what is my problem? I'm working with GridView for sorting The error message is that "Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'".... Dim m_DataTable As DataTable = GridView1.DataSource How can I change the code above?   Well let's see, if your DataSource is a DataView, you can get its associated DataTable object using the .Table property: Dim m_DataTable As DataTable = GridView1.DataSource.Table or in a land of strict typing:  Dim m_DataTable As DataTable = CType(GridView1.DataSource, System.Data.DataView).Table   Hope tha...

Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'.
When I click the sort hyperlink, I got this error mesg: Unable to cast object of type 'System.Data.DataView' to type 'System.Data.DataTable'.  in line 5.How do I fix this? Thanks. 1 Protected Sub GVCRlisting_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GVCRlisting.Sorting 2 GridViewSortExpression = e.SortExpression 3 Dim pageIndex As Integer = GVCRlisting.PageIndex 4 5 GVCRlisting.DataSource = SortDataTable(GVCRlisting.DataSource, False) 6 GVCRlisting....

Unable to cast object of type 'System.Data.Common.DataRecordInternal' to type 'System.Data.DataRowView'.
Hi... I have a ListView which is nested in the ItemTemplate of another ListView. If a "status" value in the inner ListView = 1, then I'd like to hide the "Add to cart" link. However, the inner ListView's ItemDataBound event results in the error: "Unable to cast object of type 'System.Data.Common.DataRecordInternal' to type 'System.Data.DataRowView'." I've thoroughly searched the forums, but have not found a solution to this seemingly straightforward problem. Here is the code; the error occurs at line 8. 1 protected void L...

Cannot assign object of type object to variable of type object
Does anyone know if this problem has been corrected yet and if so what EBF for 7.02. Any help would be greatly appreciated. Thanks in advance. -- Thanks David Warner I'm confused. The only data type I can see of type object is an enumerated data type that takes values like Window! Can you give us a code snippet of what functionality fails? I'd be glad to test it in the latest EBF. Let us know, Terry [TeamSybase] and Sequel the techno-kitten www.techno-kitten.com On Tue, 25 Apr 2000 13:18:15 -0400, in powersoft.public.powerbuilder.general David Warner <...

Unable to cast object of type 'WIM2008_Web.App_Code.wim.security.data.User' to type 'WIM2008_Web.App_Code.wim.security.data.User'
I don't know if i post this in the rigth forum but it is related to database call. this is my code: public DataSet CustomerDetails_Select(Int32 ID)    {      DataSet ds = new DataSet();      WIMConnect wimcon = new WIMConnect();      WIMConnection cnnwim = new WIMConnection();      ConvertDataReaderToDataTable DrToDs = new ConvertDataReaderToDataTable();      GridViewHeadersDao gvh = new GridViewHeadersDao();       &nb...

Passing SQL Parameter Array to Object datasource as parameter
I have a class 'CommonDataAccess' and my method filldataset() accepts a Stored Procedure name and a SQL Parameter Array. This class is to be made as the type for the Objectdatasource which is Bound to a gridview. How do I pass the SQL Parameter Array to this.  Raj Kiran S------------Chennai, India CALLINGBELLS: I have a class 'CommonDataAccess' and my method filldataset() accepts a Stored Procedure name and a SQL Parameter Array. This class is to be made as the type for the Objectdatasource which is Bound to a gridview. How do I pass the SQL Parameter Array to t...

Web resources about - parameter data type - asp.net.object-datasource

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google Webmaster Tools Parameter Handling - Flickr - Photo Sharing!
You aren't signed in Sign In Help Home The Tour Sign Up Explore Explore Home Last 7 Days Interesting Popular Tags Calendar Most Recent Uploads ...

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 12/2/2015 11:18:01 PM