-----创建的一个公共类using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;namespace StudentInfo.方法及类
{
    public class Common
    { 
        
        SqlConnection con = new SqlConnection();
        SqlCommand com=new SqlCommand();        private void  opcon()
        {
            con.ConnectionString = "server=(local);database=StudentInfo;integrated security=true";
            con.Open();
        }        public void opencommand(string  commtext,CommandType commtype,SqlParameter[] para) 
        {
            opcon();
            com.Connection = con;
            com.CommandText=commtext;
            com.CommandType=commtype;            if(para!=null)
             {
            for (int i = 0; i < para.Length;i++ )
                    {
                        com.Parameters.Add(para[i]);
                    }  
             }
          
        }
        public DataSet fillData(string commtext,CommandType  commtype, SqlParameter[] para) 
        {
            opencommand(commtext,commtype,para);
            SqlDataAdapter da = new SqlDataAdapter(com);           
            DataSet ds = new DataSet();
           
            da.Fill(ds);
            closecon();
            return ds;        }        public  int  executeNuery(string commtext, CommandType commtype, SqlParameter[] para)
        {
           opencommand(commtext, commtype, para);
           int  i=com.ExecuteNonQuery();          
           closecon();
           return i;
        }               private void closecon() 
        {
            con.Close();
        }
    }
}
---创建的一个添加和查询方法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Collections;namespace StudentInfo.方法及类
{
    public class Func
    {
        Common CN = new Common();
        public DataSet Look() 
        {
            
            DataSet ds = CN.fillData("Look",CommandType.StoredProcedure,null);
            return ds;
        }
               public  int   Addvalues(string N, string S, string B)        {            SqlParameter[] para = new SqlParameter[3];
            para[0] = new SqlParameter("@Stu_name", SqlDbType.NVarChar, 20, "Stu_name");
            para[0].Value = N;
            para[1] = new SqlParameter("@Stu_sex", SqlDbType.NVarChar, 2, "Stu_sex");
            para[1].Value = S;
            para[2] = new SqlParameter("@Stu_birth", SqlDbType.DateTime, 100, "Stu_birth");
            para[2].Value = DateTime.Parse(B);
            int i = CN.executeNuery("addStudent", CommandType.StoredProcedure, para);
            return i;
           
        }
        
    }
}为什么调用Addvalues出现下列的错:
过程 Look 没有参数,但却为该过程提供了参数。 我的储存过程是这样的:
USE [StudentInfo]
GO
/****** Object:  StoredProcedure [dbo].[Look]    Script Date: 11/23/2011 10:37:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[Look]
as
select*from StudentInfo
我很奇怪我没有带参数确报错说提供参数?