菜鸟求救,读不懂代码
public void MyDataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)  		  
		{
			string c=(string)Session["userclass"];		
			if(c.Trim()=="系统管理员)
			{
				SqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["dsn"]);  
				SqlCommand1=new SqlCommand("delete",SqlConnection1);  
				SqlCommand1.CommandType=CommandType.StoredProcedure;
				SqlCommand1.Parameters.Add(new SqlParameter("@id",SqlDbType.Char));
				SqlCommand1.Parameters["@id"].Value = MyDataGrid.DataKeys[e.Item.ItemIndex];
				try
				{
					SqlConnection1.Open();
					int r=SqlCommand1.ExecuteNonQuery();
					if(r>0)
					{
						myLabel.Text="删除成功!";							
					}
					else
					{
						myLabel.Text="删除错误!";
					}					
					getClass();
				}
				catch (SqlException e1)
				{
					myLabel.Text ="数据库操作错误:"+e1.Message;
				}
				finally
				{
					SqlConnection1.Close();  
				}
			}            		
		}  
在try中插一句int r=SqlCommand1.ExecuteNonQuery();什么意思,而且要判断是否大于0
大于0删除成功?否则错误。在线等待。。
------解决方案--------------------
int r=SqlCommand1.ExecuteNonQuery();  
返回执行sql的影响行数
大于0说明数据库有更新,比如删除1条就返回以,更新2条返回2