GridView自带的编辑、删除问题?
下面是向表里插入数据的:
OleDbCommand cmd = new OleDbCommand( "Insert Into [Orders]([OrderNO],[UserName],[OrderDate],[OrderYorN],[Name],[address],[NameTell],[remark],[allprice]) VALUES(@OrderNO,@UserName,@OrderDate,@OrderYorN,@Name,@address,@NameTell,@remark,@allprice) ", DB.conn);
cmd.Parameters.Add(new OleDbParameter( "@OrderNO ", OleDbType.VarChar, 50));
cmd.Parameters.Add(new OleDbParameter( "@UserName ", OleDbType.VarChar, 50));
cmd.Parameters.Add(new OleDbParameter( "@OrderDate ", OleDbType.Date,8));
cmd.Parameters.Add(new OleDbParameter( "@OrderYorN ", OleDbType.VarChar,50));
cmd.Parameters.Add(new OleDbParameter( "@Name ", OleDbType.VarChar, 50));
cmd.Parameters.Add(new OleDbParameter( "@address ", OleDbType.VarChar, 50));
cmd.Parameters.Add(new OleDbParameter( "@NameTell ", OleDbType.VarChar, 20));
cmd.Parameters.Add(new OleDbParameter( "@remark ", OleDbType.VarChar, 500));
cmd.Parameters.Add(new OleDbParameter( "@allprice ", OleDbType.Double));
cmd.Parameters[ "@OrderNO "].Value =this.OrderNO;
cmd.Parameters[ "@UserName "].Value =this.Session[ "username "].ToString();
cmd.Parameters[ "@OrderDate "].Value = DateTime.Now;
cmd.Parameters[ "@OrderYorN "].Value = "未处理 ";
cmd.Parameters[ "@Name "].Value = this.txtName.Text.Trim();
cmd.Parameters[ "@address "].Value = this.txtAddress.Text.Trim();
cmd.Parameters[ "@NameTell "].Value = this.txtTell.Text.Trim();
cmd.Parameters[ "@remark "].Value = this.remark.Text.Trim()+ "空 ";
cmd.Parameters[ "@allprice "].Value = "0 ";
DB.conn.Open();
cmd.ExecuteNonQuery();
DB.conn.Close();
我在后台管理这些数据使用的是GridView自带的编辑、删除。可是更新、和删除都没什么反应,数据表里不表化。也不出错。但如果我要是手动在access表里添内容。就可以用GridView自带的编辑、删除。这是怎么搞的????
------解决方案--------------------cmd.commandtype=???