HI,
in my coding it shows the error.There is no row at position 0.here is my code.
private void cmb_companyname_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=Sudheeptest;integrated security=true");
SqlCommand cmd = new SqlCommand("select custaddress from tbl_customer where custname=@custname", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@custname", cmb_companyname.SelectedValue .ToString ());
DataTable dt = new DataTable();
da.Fill(dt);
txt_customeraddress.Text = dt.Rows[0][0].ToString();
}
Best,
Sudheep.