三层架构得简单问题,新手求教
public DataTable GetAllByID(int EmployeeID)
{
DataTable dt = new DataTable();
SqlConnection mathConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[ "SQLConnections "].ToString());
SqlCommand scmd = new SqlCommand();
this.scmd = new SqlCommand( "GetAllByID ", mathConnection);
this.scmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter sAda = new SqlDataAdapter( "GetAllByID ", mathConnection);
sAda.SelectCommand = scmd;
sAda.SelectCommand.CommandType = CommandType.StoredProcedure;
this.scmd.Parameters.Add( "@myid ", SqlDbType.Int);
this.scmd.Parameters[ "@myid "].Value = EmployeeID;
try
{
this.mathConnection.Open();
this.scmd.ExecuteNonQuery();
this.sAda.Fill(ds);
this.mathConnection.Close();
}
catch
{
throw null;
}
return dt;
}
帮我看看有什么问题?谢谢!
编译不出错,运行绑不出数据!存储过程没有问题!求教
------解决方案--------------------把this去掉吧
------解决方案--------------------把this去掉!