|
-
Dec 7th, 2004, 09:21 AM
#1
Thread Starter
Fanatic Member
ado.net
do you know why I do not get the value for this field "FirstName" please?
The depth of the datareader is 0 whereas it shows the correct fieldcount.
public SqlDataReader PopulateSearch(string strDCTAnalyst, string strDateLogged, string strStatus, string strDateFixed, string strCountry)
{
string strSQL = "uspChangeRequest";
string strConn = clsDataHandler.ConnectionString;
SqlDataReader oDR;
SqlCommand oCmd;
SqlConnection oCon;
try
{
oCon = new SqlConnection(strConn);
oCmd = new SqlCommand(strSQL, oCon);
oCmd.CommandType = CommandType.StoredProcedure;
oCon.Open();
oDR = oCmd.ExecuteReader(CommandBehavior.CloseConnection);
if (oDR.Read() == true)
{
string x = oDR["LastName"].ToString();
}
return oDR;
}
catch (Exception ex)
{
throw ex;
}
}
-
Dec 9th, 2004, 01:48 AM
#2
Sleep mode
Re: ado.net
FirstName ??? Isn't your code getting "LastName" field ??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|