简体   繁体   中英

C# application works fine on server but throws null exception error on client machine

Here's the code for line 186.Line 297 on the error refers to THROW on the below code. On the server, there is no error on the above lines. The problem comes when I tried to run the app from client machines. How can it work on Server and failed on client machine with a null exception error? Any idea on this? Thank you.

public void saveVote()
{
string val = "";
val = "'" + m_sessid + "','" +
m_nomineeshid + "','" +
m_votershid + "','" +
m_nomineeid + "','" +
m_nominee + "','" +
m_nomineeamh + "','" +
m_voteregcode + "','" +
m_votershno + "','" +
m_votershamt + "','" +
m_crtby + "','" +
m_crtdt + "','" +
m_isnombynoninf + "','" +
m_nomineeregcode + "','" +
m_isvoterinf + "','" +
m_isnomforbod + "','" +
m_votercode + "'";
try
{
dac.Insert("tblVotForBoDNominees", val);
}
catch (Exception q)
{
throw new Exception(q.Message + " " + 
q.InnerException.Message.ToString());
}
}
Line 297 on the error refres to THROW on the above code

At this line in Vote.cs file might be a call of external resource like environment variable. In such case it's possible, as it requires to set it up on every machine. Provide the code, please. There can be different reasons and it's difficult to guess blinded.

check the lines number from log error in "Vote.cs" file, you are using something that only exists in your server but not in clients.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM