DataAdapter no longer generates in vs 2005

G

Guest

In VS2003 I used to be able to drag a SQL Server table from Server Explorer
onto my webservice (in design mode) and it would automatically create a
DataAdapter for me. This doesn't work in VS2005 anymore (crap) - is this by
design? Does anyone know?

Now if you create a DataAdapter in VS2005 (on a webservice project) it
generates the SQL statements and puts them in a .RESX file (i.e. the UPDATE
and INSERT SQL command text). Then the webservice project doesn't run
anymore. It generates a 'System.Resources.MissingManifestResourceException:
Could not find any resources appropriate for the specified culture or the
neutral culture.' error.

Can someone try this? Try the following:

1) Create a VB WebService Project
2) Connect to a SQL Server Instance using Server Explorer (or use a
connection you already have)
3) Create a dataadapter using the VS 2005 IDE (i.e. drag one on your
webservice from the TOOLBOX) and have the wizard create the UPDATE and INSERT
statements for you (i.e. just go though the wizard and select a table from
your database)
4) Now test your application using the HELLO WORLD webservice and you will
get the error I described above.

I thought it might be happening on one of my machines - so I completely
wiped one and installed VS 2005 on it from scratch. Same error.

:(
 
G

Guest

Hi I wanted to post a solution to this in case anyone coming from VS 2003
runs into this same issue.

The trick is to abandon creating the dataadapter UPDATE, INSERT and DELETE
statements at DESIGN time and instead - create them at RUN TIME.

Look up the SQLCOMMANDBUILDER object in the .NET 2005 documentation. It
shows you how to use the object to dynamically re-create your UPDATE, INSERT
AND DELETE statements right before you execute the UPDATE METHOD on your
dataadapter...

....actually a very slick little solution...
 

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

Top