----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: gauravbisht2 Message 3 in Discussion Dear Mrinal, Thanks for your response: I seem to be facing a peculiar problem.. Im setting up one dataset and am using it for two dropdown lists: Im explaining in more detail below: I have a datagrid page in which some columns become drop down lists when the edit event is pressed. There are 6 such columns and I have a lot of columns on a single page. Out of the 6 columns, 3 look up the same table in the database, for eg, I have 4 columns looking up the table RAL Code and 2 looking up media. I have a lot of columns on my page, around 30 or so. This is the code I use to look up the appropriate table to populate my dropdown lists: Dim ddlDataSet as DataSet = New DataSet Function GetName() As Dataset Const strSQLDDL as String = "SELECT * FROM MEDIA ;" Dim myDataAdapter as OledbDataAdapter = New OleDbDataAdapter(strSQLDDL,objConn) myDataAdapter.Fill(ddlDataSet,"MEDIA") Return ddlDataSet End Function THe problem Im facing is this:I get an invalid cast exception! For no apparent reason. What I do observe consistently is this: when the page has just one dropdown list referring to one dataset, the code works fine. But the minute I include the other column which also refers to the same dataset it shows an invalid cast exception. For eg I have two columns media1 and media2. If I just include media1 the page works fine. The minute I include media2, the page gives an invalid cast error. Why is this happening? Does anyone have alternate code for generating drop down lists from an editable datagrid?Is it because I have too many datasets going around in the page>? ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/BDOTNET/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
