Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2003

Tip: Looking for answers? Try searching our database.

VS.net Walkthroughs / Data access in Distributed App?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Nihan - 25 Nov 2003 14:54 GMT
I've been following a solution in the VS.net walkthroughs, and have come up
on a wall.
I have a solution with three projects in it.  One is a web service, with
perameterized SQL Adapters, Another is a asp.net web app, and the other is
the windows form client app.  The problem I'm having is trying to
perameterize the SQL statement from the winform client app.  I've added the
web reference to the SQL adapter, and everything basically shows up ok.
What I can't do is perameterize the query.  I'm trying to get a set of
records back based on an id, so in the SQL data adapter in the web service,
I have:

SELECT Tbl_Emp.*
FROM Tbl_Emp
WHERE id = @Param1

I can preview the data with the perameter, and enter it manually from the
web service page, likewise, I can leave the client winform and web service
data adapter's SQL statement UNPERAMETERIZED, and can get results, but when
I try to add  perameterization in the web service data adapters SQL
statement, and in the winform client page, I get errors.  Currently, in the
winform client page:

Private Sub GetRecs_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GetRecs.Click
   Dim ws As New EDEmployerWinClient.EDEmpWsvc.EmpService
   ws.Credentials = System.Net.CredentialCache.DefaultCredentials
   EmpRecsDa1.SelectCommand.Parameters("EmpID").Value = TextBox1.Text
'1st line I'm having problems with
   EmpRecsDa1.Fill(EmpRecsDs1)
'this is the second line I'm having problems with
   EmpRecsDs1.Clear()
   EmpRecsDs1.Merge(ws.GetRecs())
End Sub

By calling EmpRecsDa1 from the webservice and looking at the code in vs.net,
it's telling me that EmpRecsDa1 isn't Declared.

Should I be calling the data adapter from the web service, the dataset from
the web service?  I've added a data adapter to the form itself and called it
EmpRecsData, but I'm getting a similar problem saying that SelectCommand and
Fill are not members of the web service's dataset.

Any help would be great,...as I can't find anything else on this in the
MSDN.  It looks like nobody's been working on anything similar, which is
strange.  Microsoft made such a fuss about creating distributed applications
using web services...I thought this might be a common problem.
Steve Nihan - 25 Nov 2003 14:57 GMT
Sorry.....Comments apply to the previous lines of code.  (Each of the
EmpRecsDa1)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.