N
nbohana
I am trying to use the following select statement to put records into a
combobox, when I run the application I only get one record, I should get
three records. Please help me!!
try
{
strSQL = "SELECT [company-code], [bid-number] FROM
[job-setup] Where [company-code] = " + PrepareStr(ccode);
con = new
SqlConnection("Server=icc-server;DataBase=Construction;Integrated
Security=SSPI;Persist Security Info=False");
comm = new SqlCommand(strSQL, con);
if (con.State != ConnectionState.Open)
{
con.Open();
}
conrdr = comm.ExecuteReader();
if (conrdr.Read())
{
Bidnumber.Text = conrdr["bid-number"].ToString();
}
con.Close();
}
combobox, when I run the application I only get one record, I should get
three records. Please help me!!
try
{
strSQL = "SELECT [company-code], [bid-number] FROM
[job-setup] Where [company-code] = " + PrepareStr(ccode);
con = new
SqlConnection("Server=icc-server;DataBase=Construction;Integrated
Security=SSPI;Persist Security Info=False");
comm = new SqlCommand(strSQL, con);
if (con.State != ConnectionState.Open)
{
con.Open();
}
conrdr = comm.ExecuteReader();
if (conrdr.Read())
{
Bidnumber.Text = conrdr["bid-number"].ToString();
}
con.Close();
}