HI, my data gridview have been connected to Web services(i use MySQL
database) and i had write a update method, i would like to use C#
code, when i click the checkbox and click the delete button, the
coloumn - "Status" , the "Status" content will be change from "In
Process" to "Cancel" , can anyone help me?
Here is my GridView
http://i5.photobucket.com/albums/y172/sharonfong/gridw.jpg Here is update web method
[WebMethod]
public int UpdateReserve(string reserveNo)
{
String sql12 = String.Format("UPDATE reservation set rStatus =
'Cancel' where reserveNo ='" + reserveNo + "'");
return executeNonQuery(sql12);
}
Here is my DataSet web method
[WebMethod(Description = "Get all reserve from reservation table")]
public DataSet GetUserReservation(string uid)
{
string sql = "SELECT reserveNo, bName, ISBN, rDate,
warningDate, bStatus FROM reservation where uid = '" + uid + "'";
OdbcConnection conn = new OdbcConnection(Path());
OdbcCommand cmd = new OdbcCommand(sql, conn);
conn.Open();
OdbcDataReader myReader = cmd.ExecuteReader();
DataTable myTable = new DataTable("myTable");
myTable.Columns.Add("Reserve No.", typeof(string));
myTable.Columns.Add("Book Title", typeof(string));
myTable.Columns.Add("ISBN", typeof(string));
myTable.Columns.Add("Reserve Date",
typeof(string));
myTable.Columns.Add("Warning Date", typeof(string));
myTable.Columns.Add("Status", typeof(string));
while (myReader.Read())
{
myTable.Rows.Add(new object[]
{
myReader["reserveNo"].ToString(),
myReader["bName"].ToString(), myReader["ISBN"].ToString(),
myReader["rDate"].ToString(),
myReader["warningDate"], myReader["bStatus"]});
}
//myTable.Load(reader);
myTable.AcceptChanges();
DataSet ds = new DataSet();
ds.Tables.Add(myTable);
ds.AcceptChanges();
return ds;