dataform wizard in visual studio 2003 and sql server 2000 database

R

Ralph

I am trying out the dataform wizard in visual studio using a sql server
2003 database.
It seems to want to create ole db adapters and connections and
commands.
How do I make it use sql commands adapters and connections?
This wizard could save time, however would prefer it used sqlconnection
command and adapter.

thanks in advance,
sincerely

Ralph
 
M

Morten Wennevik

Hi Ralph,

Make sure the data connection is using the proper connection type.

In server explorer, modify connection and in the Provider tab, make sure
"Microsoft OLE DB Provider for SQL Server" is selected.
 
R

Ralph

Hi Morten,
Thanks for your prompt response.
Unfortunately I suspect I hit some kind of bug in the 2003 IDE.
Seems as though if I drop and drag onto a form from the server explorer
it does indeed produce sqlconnection and sql dataadapters,
however if I use the dataform wizard it wants to create the oledb
connections and oledbadapters.
Again thanks Morten.

Ralph
 
M

Morten Wennevik

Ah, Sorry,

Never tried the DataForm wizard, but I couldn't find any way to specify
sql types over oledb. However, you can easily change from OleDb to Sql
with a search and replace the following

Important! Open the designer generated code region before you do a search
and replace or you won't find all items.

System.Data.OleDb.OleDbType => System.Data.SqlDbTypes
System.Data.OleDb.OleDb => System.Data.SqlClient.Sql
oleDb => sql

Then you need to change a few data types as oledbtypes and SqlDbTypes are
differently named.

Alternately, Create a dataset before you start the wizard and use this
dataset instead of a new dataset when running the wizard.


Hi Morten,
Thanks for your prompt response.
Unfortunately I suspect I hit some kind of bug in the 2003 IDE.
Seems as though if I drop and drag onto a form from the server explorer
it does indeed produce sqlconnection and sql dataadapters,
however if I use the dataform wizard it wants to create the oledb
connections and oledbadapters.
Again thanks Morten.

Ralph
 
R

Ralph

I've never used any of the drop functionality. I am used to coding it
all manually.
However if what gets produced is close to what I am looking for and
saves time I believe I should give it a try.
I noticed that if I just create a dataadapter it autmatically does that
using the SQL Client.
However for some reason the dataform wizard uses oledb.
With the difference in how the two deal with parameters there is a
little more to do than just search and replaces.

Creating the dataset before.
I will have to give that a try.
I wonder if the xsd file cotains info to specify which database it was
created from?


Morten said:
Ah, Sorry,

Never tried the DataForm wizard, but I couldn't find any way to specify
sql types over oledb. However, you can easily change from OleDb to Sql
with a search and replace the following

Important! Open the designer generated code region before you do a search
and replace or you won't find all items.

System.Data.OleDb.OleDbType => System.Data.SqlDbTypes
System.Data.OleDb.OleDb => System.Data.SqlClient.Sql
oleDb => sql

Then you need to change a few data types as oledbtypes and SqlDbTypes are
differently named.

Alternately, Create a dataset before you start the wizard and use this
dataset instead of a new dataset when running the wizard.
 

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