请问: 1,我在A页面的.CS文件中定义了一个类,那么在B,或C页面的.CS文件中怎么调用A类中的方法?
2,以下的-1是什么作用?publicintUpdateUser(intnUserID,stringsEmail){comdText=UPDATEUSER+"'"+sEm...
2,以下的-1是什么作用?
public int UpdateUser(int nUserID,string sEmail)
{
comdText = UPDATEUSER+"'"+sEmail+"'"+"WHERE UserID="+"'"+nUserID.ToString()+"'";
OleDbCommand myCommand = new OleDbCommand(comdText,myConnection);
int nResult = -1;
try
{
myConnection.Open();
nResult=myCommand.ExecuteNonQuery();//这句是什么意思,请指教,谢谢
}
catch (OleDbException ex)
{
throw new Exception(ex.Message, ex);
}
finally
{
myConnection.Close();
}
myCommand.Cancel();
comdText = null;
return nResult;
} 展开
public int UpdateUser(int nUserID,string sEmail)
{
comdText = UPDATEUSER+"'"+sEmail+"'"+"WHERE UserID="+"'"+nUserID.ToString()+"'";
OleDbCommand myCommand = new OleDbCommand(comdText,myConnection);
int nResult = -1;
try
{
myConnection.Open();
nResult=myCommand.ExecuteNonQuery();//这句是什么意思,请指教,谢谢
}
catch (OleDbException ex)
{
throw new Exception(ex.Message, ex);
}
finally
{
myConnection.Close();
}
myCommand.Cancel();
comdText = null;
return nResult;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询