I tried adding this:
Protected Sub txtCompanyName_SelectedInd
'txtMSGID.Text = txtCompanyName.SelectedIte
IndDirCompanies.Select("Co
CInt(IndDirCompanies.Selec
End Sub
But I am getting the following error:
Error 1 Value of type 'String' cannot be converted to 'System.Web.UI.DataSourceS
Main Topics
Browse All Topics





by: VelioPosted on 2008-04-07 at 15:26:02ID: 21301085
i'm presuming we're talking about a DataTable.
ompanyID = " + txtCompanyName.SelectedIte m.ToString ())
ct("Compan yID = " + txtCompanyName.SelectedIte m.ToString ())(0)("MS GID"))
do you still have it available when the SelectedIndexChanged event fires? if not, you could consider
1. putting it into a session variable when you first fetch it
2. fetching it again from the DB again.
once you have it, it's simply a matter of calling the Select method on the DataTable, eg
tIndDirCompanies.Select("C
the method returns an array of DataRow objects. in this case, it'll contain only one...
so
CInt(tIndDirCompanies.Sele
should do the trick....