在本地一切正常,可上了服务器就报
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------未将对象引用设置到对象的实例。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
[NullReferenceException: 未将对象引用设置到对象的实例。]
   Wap.SiteExpert.Wap.paixu_LM.Page_Load(Object sender, EventArgs e) +603
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +739 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.2300; ASP.NET 版本:1.1.4322.2300 这是在page_load中的一段代码try
{
int id_J = int.Parse(Request.QueryString["id_J"].ToString().Trim());
//---------判断是否为降序
//---------获取主题中的最XIAO值
SqlConnection mycon = sql.myConnection();
string cmdString = "SELECT MIN(PX) FROM NEIRONG";
SqlCommand mycom = new SqlCommand(cmdString,mycon);
mycon.Open();
int minNum = int.Parse(mycom.ExecuteScalar().ToString().Trim());
mycon.Close();
//----------------------------------------------
//把选中项的px设置成为最小值减一(实现了排序的功能)
SqlConnection mycon_X = sql.myConnection();
string cmdString_X = "UPDATE NEIRONG SET PX=@PX WHERE ID = " + id_J;
SqlCommand mycom_X = new SqlCommand(cmdString_X,mycon_X);
mycom_X.Parameters.Add("@PX",SqlDbType.Int,20).Value = minNum - 1;
mycon_X.Open();
count1 = int.Parse(mycom_X.ExecuteNonQuery().ToString().Trim());
mycon_X.Close();
//---------处理完后返回
//Response.Redirect("nr_guanli.aspx?id=id_true");
}
catch
{
int id_S = int.Parse(Request.QueryString["id_S"].ToString().Trim());
//---------处理升序
//---------获取主题中的最XIAO值
SqlConnection mycon = sql.myConnection();
string cmdString = "SELECT MAX(PX) FROM NEIRONG";
SqlCommand mycom = new SqlCommand(cmdString,mycon);
mycon.Open();
int maxNum = int.Parse(mycom.ExecuteScalar().ToString().Trim());
mycon.Close();
//----------------------------------------------
//把选中项的px设置成为最小值减一(实现了排序的功能)
SqlConnection mycon_X = sql.myConnection();
string cmdString_X = "UPDATE NEIRONG SET PX=@PX WHERE ID = " + id_S;
SqlCommand mycom_X = new SqlCommand(cmdString_X,mycon_X);
mycom_X.Parameters.Add("@PX",SqlDbType.Int,20).Value = maxNum + 1;
mycon_X.Open();
count2 = int.Parse(mycom_X.ExecuteNonQuery().ToString().Trim());
mycon_X.Close();
//---------处理完后返回
//Response.Redirect("nr_guanli.aspx?id=id_true");
}if(count1 > 0)
{
Response.Redirect("nr_guanli.aspx");
}
else
{

}
//---------处理完后返回
if(count2 > 0)
{
Response.Redirect("nr_guanli.aspx");
}
else
{

}