分开写看看。SqlParameter c = new SqlParameter("@c",SqlDbType.Int)
c.Direction = ParameterDirection.OutPut
Scomm.Parameter.Add(c)
conn.open();
Scomm.ExecuteNonQuery()
conn.Close();
Label1.Text = c.value.ToString();

解决方案 »

  1.   

    1.scomm.exe....
    2.读取参数
    3.conn.close
      

  2.   

    dim Scon as new SQLconnection("server=nirvana;database=pubs;uid=sa;pwd=sa")
    Scon.Open()--加此行
          dim Scomm as new SQLDataAdapter("count_authors",Scon)
          Scomm.selectcommand.commandtype=commandtype.storedprocedure
          Scomm.selectcommand.parameters.add(new SQLParameter("@c",SQLDbtype.int))
          Scomm.selectcommand.parameters("@c").direction=parameterdirection.output
     Scon.Close;--加此行
          label1.text=system.math.ceiling(Scomm.selectcommand.parameters("@c").value)
      

  3.   

    CREATE PROCEDURE Count_Authors
         @c int output
     AS
        select @c=count(*) from authors
    GO
      

  4.   

    to  ZXYSOSO(【我很想飛】) 加了还是不行,何故?