hi all
i have a table in sql server and i need to get the records from a raw and save them to an array
and i used this code
///////////////////////////////////////////
SqlConnection cn = new SqlConnection(@"Data Source=GEMO-PC\SQLEXPRESS;Initial Catalog=WTDB;Integrated Security=True;Pooling=False");
string mycmd = "select * from [Pipe Schedules] " + " where [Pipe Size Inches] = " + OutSideDiameterCB.Text;
SqlCommand mysqlcmd = new SqlCommand(mycmd, cn);
cn.Open();
SqlDataReader myreader = mysqlcmd.ExecuteReader();
while (myreader.Read())
{
///// my question ???
}
cn.Close();
myreader.Close();
/////////////////////
Loading
Kevin AungPosted Jan 15, 2011, 7:24 PM
double LargeNum = 0;
while (myReader.Read())
{
double tempVal = myReader.GetDouble(ColumnNum);
if (tempVal > LargeNum)
LargeNum = tempVal;
}
Mohammed GamalPosted Jan 16, 2011, 7:51 AM
there is a run time error due to null values in the table i run the program step by step and i found that the problem when null values read
Mohammed GamalPosted Jan 15, 2011, 4:01 PM
to take the largest value of them.
Kevin AungPosted Jan 15, 2011, 1:17 PM