Re: Populating a dropdown listbox problem!
Dinesh Upare <[email protected]> Fri, 19 Apr 2002 19:31:31 +0530
| Newsgroups | gmane.comp.windows.devel.dotnet.general |
|---|---|
| Message-ID | <006601c1e7aa$b7676df0$6364a8c0@dinesh> |
I am able to change the back colors of the Child Form but not able to change the backcolor of the MDI. Is there any way to change the backcolor of MDI form? Dinesh ----- Original Message ----- From: "Chris Anderson" <[email protected]> To: <[email protected]> Sent: Wednesday, June 19, 2002 5:25 PM Subject: Re: [DOTNET] Populating a dropdown listbox problem! > OleDbDataReader's return objects not strings > You need to explicitly cast to a string, ie something like : > (C++ is not my language of choice, so please ignore syntax errors) > > *sEmployClass = (string) objDataReader["employee_class_name"]; > > Merak > > > -----Original Message----- > > From: dmlegare [mailto:[email protected]] > > Sent: 19 June 2002 12:00 > > To: [email protected] > > Subject: [DOTNET] Populating a dropdown listbox problem! > > > > > > How do I use my datareader object to populate a > > dropdownlistbox??? Im getting conversion type errors..?????? > > here is the code > > > > string myConnection = "........"; > > string mySelectQuery = "select employee_class_name from > > onlinetime_empclass "; OleDbConnection myConn = new > > OleDbConnection(myConnection); OleDbCommand objCommand = new > > OleDbCommand(mySelectQuery, myConn); OleDbDataReader > > objDataReader = null; myConn.Open(); objDataReader = > > objCommand.ExecuteReader(); string sEmployClass = ""; while > > (objDataReader.Read() == true) > > { > > *sEmployClass = objDataReader["employee_class_name"]; > > ddemployeeClassification.Items.Add(sEmployClass); > > } > > I get an error when i try to view in a browsers: > > > > *Compiler Error Message: CS0029: Cannot implicitly convert > > type 'object' to 'string' > > > > You can read messages from the DOTNET archive, unsubscribe > > from DOTNET, or subscribe to other DevelopMentor lists at > > http://discuss.develop.com. > > > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.