Hi,
It shows the error like this.
Error:-No mapping exists from object type System.Data.DataRowView to a known managed provider native type.I am underlying the error part.
private void cmb_companyname_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=marsweb;integrated security=true");
//DBConnection db = new DBConnection();
//SqlConnection con = db.opencon();
SqlCommand cmd = new SqlCommand("select custaddress from tbl_customer where custname=@custname", con);
cmd.Parameters.AddWithValue("@custname", cmb_companyname.SelectedValue );
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt); if (dt.Rows.Count > 0)
{
txt_customeraddress.Text = dt.Rows[0][1].ToString();
}
}
Best,
Sudheep.