Here is the code snipplet . . .
Thanks in advance!You need to read the first record of the recordset:
SqlCommand DBCommand = new SqlCommand("SELECT * FROM Addresses WHERE AddressID='"+ID.ToString()+"'", DBConn );
try
{
DBConn.Open();
dr = DBCommand.ExecuteReader( System.Data.CommandBehavior.CloseConnection ) ;}
catch
{
values = null ;
return values ;
}
values[0]=dr["AddressStreet1"].ToString() ;
values[1]=dr["AddressStreet2"].ToString() ;
values[2]=dr["City"].ToString() ;
values[3]=dr["StateProvinceID"].ToString() ;
values[4]=dr["ZipPostalCode"].ToString() ;
values[5]=dr["CountryID"].ToString() ;
dr.read();
It works except the first column is gone. Why is that?
Disregard my last message - it was my error.
0 comments:
Post a Comment