T
trint
I have a select statement that all I want to do is get the number of
rows returned in my query:
string strSQLAccountInfo1 = "select * " +
"FROM orders " +
"where user_id = '" + Class1.loginUserid.Trim() +
"' ";
SqlCommand cmdAL = new SqlCommand(strSQLAccountInfo1,
cnSQLAccountInfo1);
cnSQLAccountInfo1 = new
SqlConnection(ConnectionstringAccountInfo1);
cnSQLAccountInfo1.Open();
SqlCommand cmSQLAccountInfo1;
cmSQLAccountInfo1 = new SqlCommand(strSQLAccountInfo1,
cnSQLAccountInfo1);
drSQLAccountInfo1 = cmSQLAccountInfo1.ExecuteReader();
int numbOfRowsAffected = 0;
numbOfRowsAffected =
drSQLAccountInfo1.RecordsAffected;
if (drSQLAccountInfo1.Read())
{
Class1.UseridCompany =
drSQLAccountInfo1["order_date"].ToString();
}
Any help is appreciated.
Thanks,
Trint
rows returned in my query:
string strSQLAccountInfo1 = "select * " +
"FROM orders " +
"where user_id = '" + Class1.loginUserid.Trim() +
"' ";
SqlCommand cmdAL = new SqlCommand(strSQLAccountInfo1,
cnSQLAccountInfo1);
cnSQLAccountInfo1 = new
SqlConnection(ConnectionstringAccountInfo1);
cnSQLAccountInfo1.Open();
SqlCommand cmSQLAccountInfo1;
cmSQLAccountInfo1 = new SqlCommand(strSQLAccountInfo1,
cnSQLAccountInfo1);
drSQLAccountInfo1 = cmSQLAccountInfo1.ExecuteReader();
int numbOfRowsAffected = 0;
numbOfRowsAffected =
drSQLAccountInfo1.RecordsAffected;
if (drSQLAccountInfo1.Read())
{
Class1.UseridCompany =
drSQLAccountInfo1["order_date"].ToString();
}
Any help is appreciated.
Thanks,
Trint