dataset不能得到存储过程的数据?
DataSet ds = new DataSet();
System.Data.SqlClient.SqlConnection sqlConn=new System.Data.SqlClient.SqlConnection();
sqlConn.ConnectionString=System.Configuration.ConfigurationSettings.AppSettings[ "ConnectionString "];
sqlConn.Open();
SqlDataAdapter da = new SqlDataAdapter( "sp_hr_GetStafflist ", sqlConn);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.Fill(ds);
dg.DataSource = ds;
dg.DataBind();
//IListSource 不包含任何数据源???
------解决方案--------------------dsa.SelectCommand.Parameters.Add( "@name ", SqlDbType.Int).Value = "xxx ";
试下这个。
------解决方案--------------------DB.MakeOutParam( "@intRecordCount ",SqlDbType.Int,20)