Emmmanuel FIADUFE

Emmmanuel FIADUFE

  • 792
  • 1.1k
  • 53.5k

C# window form application

Nov 7 2023 12:55 PM

Hello Team, Please I have this error in my C# window form application which says the multi-part identifier "System.Data.DataRowView could not be bound, Kindly help.

private void cmbRoom_SelectedIndexChanged(object sender, EventArgs e)
{
if(cmbRoom.SelectedIndex !=-1)
{
string qry = @"Select rRate from tblRoom where roomID ="+cmbRoom.SelectedValue+"";
SqlCommand cmd = new SqlCommand(qry,MainClass.con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
txtRate.Text = dt.Rows[0]["rRate"].ToString();
}
}
???????}

 


Answers (12)