C#中如何调用触发器自定义约束的定义与作用?????
请高手指教。

解决方案 »

  1.   

    调用触发器是什么意思?存储过程的调用倒是很普遍,ado.net中都有讲到
      

  2.   

    存储过程可以用sqlcommand来创建参数调用,触发器不能由程序来调用!
      

  3.   

    触发器不可以显示调用,只能在Table的数据将要发生改变时才能自动触发相应的触发器.
      

  4.   

    SqlConnection sqlConnection1 = new SqlConnection("Your Connection String");
    SqlCommand cmd = new SqlCommand();
    SqlDataReader reader;cmd.CommandText = "StoredProcedureName";
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Connection = sqlConnection1;sqlConnection1.Open();reader = cmd.ExecuteReader();
    // Data is accessible through the DataReader object here.sqlConnection1.Close();触发器正如楼上老大所讲,无法显式调用的。