วิธี Select Data เพื่อเอา String ไปใส่ค่า Textbox

string strConn = WebConfigurationManager.ConnectionStrings[“CPSConnectionString”].ConnectionString;
string sql = “SELECT Crop_ID FROM Crop WHERE (Agriculturist_ID ='” + Agri_IDTextbox.Text + “‘and Age_Rubber ='” + ageRubberstxt.Text + “‘)”;
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
SqlCommand com = new SqlCommand(sql, conn);
SqlDataAdapter sa = new SqlDataAdapter(com);
DataSet ds = new DataSet();
sa.Fill(ds);

for (int i = 0; i <= ds.Tables[0].Rows.Count – 1; i++)
{
for (int j = 0; j <= ds.Tables[0].Columns.Count – 1; j++)
{
if (j == 0)
{
cropID = ds.Tables[0].Rows[i][j].ToString();
}
}
}
conn.Close();