Question : finding an item in a DataTable

Im not sure if my construct is right. There is something im missing.. Im loking for the value of sItem i the datatable.
IN th Dropdownlist, I diplay the value as forexample
"77777-Background Info"
In my dataset, I return 77777, but I need to find this in the datatable...

Here's the code.  I get object reference not set error...Im using Dataset and based on the result I create a datatable and for some reason an error is displaying.
Thanks for correcting..
Dim ds2 As DataSet = odata.GetIT(pID)
            If (ds2.Tables(0).Rows.Count = 1) Then
                Dim dRow As DataRow = ds2.Tables(0).Rows(0)
                Dim sUnit, sLongName, sAddr, sItem As String
                sItem = ds2.Tables(0).Rows(0)(0).ToString()
                sUnit = dRow("UNITID").ToString
                sLongName = dRow("LONG_NAME").ToString
                sAddr = dRow("ADDR1").ToString
                Dim dt7 As DataTable
                dt7 = odata.GetSchool
                DropDownList1.DataSource = dt7
                DropDownList1.DataTextField = "SA"
                DropDownList1.DataValueField = "UID"
                DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(sUnit))
           DropDownList1.Items.Add(dRow("UNITID").ToString + "-" + dRow("LONG_NAME").ToString)
                DropDownList1.SelectedItem.Text = sItem ---GETTING ERROR "Object reference not set to an instance of an object"

                TextBox27.Text = sAddr
                DropDownList1.DataBind()
           END IF

Answer : finding an item in a DataTable

Probably, you have your own list class. If you use the standard list (from STL), wrap it in a class. It should be derived from the CObject. Add the serialize methods and macros. Then, in the loop, you will write or read the data from the archive, like:
if( archive.IsStoring() )
{
     for (it = list.begin(); it != list.end(); ++it)
         archive << *iter;
}

MSDN. Serialization: Making a Serializable Class
http://msdn.microsoft.com/en-us/library/00hh13h0(VS.80).aspx

CObArray class in MFC supports the serialization and can work with the pointers. It, maybe, can be a good replacement.
http://msdn.microsoft.com/en-us/library/088sck34(VS.80).aspx
Random Solutions  
 
programming4us programming4us