TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sev M
NA
4
0
Webservices Null Reference Exception??
Aug 31 2009 7:43 AM
I have 2 webservice methods Load Window and Save Window.
When I call the webservice method from my form synchronously or assynchronously i am receiving the following error:
(System.NullReferenceException: Object reference not set to an instance)
I am being able to call the loadWindow webservice method without any problem but when i pass the dataset as parameter in the saveWindow im receiving the error above. Any solution will be appreciated.
<pre>
//form
private void SaveData()
{
try
{
SYS_WS sysws = new SYS_WS();
sysws.SaveWindowCompleted +=new SaveWindowCompletedEventHandler(sysws_SaveWindowCompleted);
sysws.SaveWindowAsync((SYSDataset)dsSystem.GetChanges());
}
catch (Exception ex)
{
throw (ex);
}
}
private void sysws_SaveWindowCompleted(object sender,
SaveWindowCompletedEventArgs e)
{
try
{
if (e.Error != null)
{
return;
}
this.dsSystem.AcceptChanges();
}
catch (Exception ex)
{
throw ex;
}
}
//Webservices
[WebMethod(EnableSession = true)]
public bool SaveWindow(SYSDataset ds)
{
try
{
WindowController cont = new WindowController();
cont.SaveWindows(ds);
return true;
}
catch (Exception ex)
{
throw (ex);
}
}
[WebMethod(EnableSession = true)]
public SYSDataset LoadWindow(string WindowID)
{
WindowController cont = new WindowController();
return cont.LoadWindow(WindowID);
}
</pre>
Reply
Answers (
2
)
error when starting a windows service created in c#.net
how to devlop telemarketing software