What is wrong:
I want use sql command to perform action in grid with inlineform, and another controls,
And this code not working.
protected void Grid1_ServerEditRow(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)
{
conn.Open();
Dictionary<string, object> data = e.Arguments["data"] as Dictionary<string, object>;
var MyRID = data.Where(d => d.Key == "RTid").FirstOrDefault();
int myid = Convert.ToInt32(MyRID.Value.ToString());
var RT = data.Where(d => d.Key == "RoomType").FirstOrDefault();
string EditRoom = "UPDATE dbo.RoomTypes SET RoomTypes = @RoomType WHERE RTid = @MYID";
SqlCommand cmd = new SqlCommand(EditRoom, conn);
cmd.Parameters.AddWithValue("@MYID", myid);
cmd.Parameters.AddWithValue("@RoomType", RT.Value.ToString());
cmd.ExecuteNonQuery();
conn.Close();
}