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 / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

dataform wizard in visual studio 2003 and sql server 2000 database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ralph - 20 Nov 2006 11:55 GMT
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
Morten Wennevik - 20 Nov 2006 12:25 GMT
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.

> I am trying out the dataform wizard in visual studio using a sql server
> 2003 database.
[quoted text clipped - 8 lines]
>
> Ralph

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Ralph - 20 Nov 2006 13:12 GMT
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

> Hi Ralph,
>
[quoted text clipped - 15 lines]
> >
> > Ralph
Morten Wennevik - 21 Nov 2006 09:10 GMT
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.
[quoted text clipped - 32 lines]
>> Happy Coding!
>> Morten Wennevik [C# MVP]

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Ralph - 21 Nov 2006 10:54 GMT
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?

> Ah, Sorry,
>
[quoted text clipped - 51 lines]
> >> Happy Coding!
> >> Morten Wennevik [C# MVP]

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.