4
Answers

save data from raw of table to array

Mohammed Gamal

Mohammed Gamal

13y
3.9k
1
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();

/////////////////////
Answers (4)