日期:2014-05-18 浏览次数:20522 次
SqlCommand cmd = new SqlCommand(); cmd.Connection = conn;//数据库连接 cmd.CommandText = "exec a"; CommandType.StoredProcedure cmd.CommandType =// type; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill("table1");
------解决方案--------------------
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType=CommandType.StoreProcedure
cmd.CommandText =存储过程名
cmd.execureScalar();
------解决方案--------------------