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 Aung46 reputationPosted Jan 15, 2011, 2:24 PM EST
double LargeNum = 0;
while (myReader.Read())
{
double tempVal = myReader.GetDouble(ColumnNum);
if (tempVal > LargeNum)
LargeNum = tempVal;
}
Kevin Aung46 reputationPosted Jan 15, 2011, 8:17 AM EST
Mohammed Gamal67 reputationPosted Jan 15, 2011, 11:01 AM EST
to take the largest value of them.
Mohammed Gamal67 reputationPosted Jan 16, 2011, 2:51 AM EST
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