i am trying to set number of rows i want to fetch from database to listbox.
on button click ,10 items i want to display to itembox from column[0]. how can i specify number of itemz ??
What I have tried:
string query = " select MonoCode,MonoCode_Result,MasterCode,OuterCode,PalletCode from BatchDetails Where MonoCode_Result = 1 and MasterCode IS NULL "
"and OuterCode IS NULL and PalletCode IS NULL ";
using (SqlCommand sqlCommand = new SqlCommand(query, sqlConn))
{
// sqlCommand.Parameters.AddWithValue("@MonoCode", textBox1.Text);
sqlCommand.Parameters.AddWithValue("@MonoCode_Result", 1);
sqlCommand.Parameters.AddWithValue("@OuterCode", "NULL");
sqlCommand.Parameters.AddWithValue("@MaterCode", "NULL");
sqlCommand.Parameters.AddWithValue("@PalletCode", "NULL");
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
var dataReader = sqlDataReader;
while(dataReader.Read())
{
}