Creating a distributed application with VB - 2005

L

littleccguy

I notice there are quite a few posts regarding this lab. Even still, I
could not find what I was looking for.
I have run into a few bumps but have been able to work through them.
now I am stumped. I get the following error:

System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.NullReferenceException: Object reference
not set to an instance of an object.
at AuthorsService.GetAuthors() in
c:\inetpub\wwwroot\AuthorsWebService1\App_Code\Service.vb:line 21
--- End of inner exception stack trace ---
Here are the two segments of code.
Where debug highlights the error:
Private Sub btnLoadData_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLoadData.Click
Dim ws As New AuthorsWinClient.localhost.AuthorsService
ws.Credentials = System.Net.CredentialCache.DefaultCredentials
AuthorData.Merge(ws.GetAuthors) 'Here is where the error is
highlighted
End Sub
Where the error points to (Service.vb:line 21)
'Visual Basic
<WebMethod()> _
Public Function GetAuthors() As dsAuthors
Dim authors As New dsAuthors
daAuthors1.Fill(authors) ' Line 21
Return authors
End Function

I am a student so go a little easy on me :)
Also, any MS people out there have any idea when these labs will be
edited, if need be, for VS 2005?
Oh yeah,
Windows XP SP2
VS 2005 Standard
SQL 2005 Standarad w/SP1

Thanks!!!
 
L

littleccguy

I have not found the solution yet, however, I found links through VS
2005 to walkthroughs

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vswalk/html/f5399a1f-2d3d-42fb-b989-134ccda2159f.htm


I found a current version of this exercise. Althought the database and
tables have changed, I should be able find the differnce in the two.

For those new to VS and programming and would like some free
walkthoughs ( in all languages) paste the link above in the url in the
VS Help window.

Be well.
 
M

Mark

Wow, debugging this walkthrough is quite an exercise! Re. the issue you
describe below, I got around it by using the .GetChanges method. This has the
added advantage of only sending the changed rows back to the server, which
would be good if you were to implement this in a distributed network. (I'm
still new to ADO .NET so I'm not sure this is the best approach, but so far
it's the closest thing I can find to classic ADO's adMarshalModifiedOnly.)

Here is my version of the SaveData_Click event:

Private Sub SaveData_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles SaveData.Click
Dim CustomerChanges As New localhost.DataSet.CustomersDataTable
CustomerChanges = CustomerData.GetChanges
If CustomerChanges IsNot Nothing Then
Dim ws As New localhost.Service
ws.Credentials = System.Net.CredentialCache.DefaultCredentials
ws.UpdateCustomers(CustomerChanges)
End If
End Sub

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top