请看下面的代码:
SqlCommand aCommand = new SqlCommand("RegionInsert", conn);        aCommand.CommandType = CommandType.StoredProcedure;
        aCommand.Parameters.Add(new SqlParameter("@RegionDescription", SqlDbType.NChar, 50, "aRegionDescription"));在定义参数时,"aRegionDescription"是不是定义成什么值都可以,比如"test","asdf"等等,它有什么用?

解决方案 »

  1.   

    你里面的参数是什么类型的你就定义成什么类型的啊
    比如你传入的参数是流水号id
    那肯定就是int型
      

  2.   

    第一个参数@RegionDescription是要和存储过程中的参数名一致的,可我问的是最后一个参数。
      

  3.   

    SqlCommand aCommand = new SqlCommand("{call 存储过程名}", conn);
      

  4.   

    你传的时候不会检查,sql运行的时候它会检查,如果类型不正确,SqlException