Server Intellect

How to Create a Data Source in Visual Studio.NET

Category: Visual Studio.NET

How to create a data source in Visual Studio.Net 2005(Part 1)

Welcome, in this tutorial we are going to create a new data source in Visual Studio.Net using the built in wizards and drag-n-drop. To begin go to “File”, “New”, “Project” and name the project something like “MyPubsDataSource” or whatever makes sense to you. This will be a windows application although it’s not really important because we just need any type of project because creating a new data source is commom to all project types. Ok after you enter a name for your project and press the “Ok” button VS.Net will have created your first form for you named “Form1.cs”. At this point the form1 view should be already in design view(If you see a rectangular window that reads “Form1.cs[Design]* then you are in design view.
Ok next click once anywhere on the form and then select the “ToolBox” tab on the left of the design window. If it’s not viewable then select “View”, “ToolBox” from the main menu.(See image below)

Server Intellect assists companies of all sizes with their hosting needs by offering fully configured server solutions coupled with proactive server management services. Server Intellect specializes in providing complete internet-ready server solutions backed by their expert 24/365 proactive support team.

 

 

Image 1
[Click to see full-size]

 


Which will show you the window below.
 

Image 2
[Click to see full-size]


Ok, next select the “SQLDataAdapter” from the ToolBox and drop it anywhere onto your form. Once you release it, it does not actually sit on top your form but instead it positions itself just below your form inside the design area. At this point you will have another window in front of you for you to choose your data source like this(See image below).

Image 3
[Click to see full-size]


 

If you're looking for a really good web host, try Server Intellect - we found the setup procedure and control panel, very easy to adapt to and their IT team is awesome!

On the next window choose Microsoft SQL Server or Microsoft SQL Server 2005 Express or whatever your data server may be. The next thing to do is enter your server name if you know what it is if not press the drop down arrow and select it from the list of providers.(See image below).

Image 4
[Click to see full-size]


Next, if your server is setup for it then you can choose “Windows Authentication” if not and you know what your SQL Server login settings are then enter the user name and password. Now you want to test your settings and make sure you can connect to your server so click on the “Test Connection” button now.  Next you will get a message box showing the connection status of the test. If it’s ok press the “OK” button and the form will close and you will be back at the Data Adapter Configuration Wizard. Select either “Yes or No” to save the password for your connection in the App.config file. (Please note if you select “No” you will be prompted for it each time you run any of your applications that need to connect to SQL server for data). I normally select “Yes” as I setup a login on SQl Server with only enough rights to handle the data I’m working with.
Ok, now click “Next” to advance to the next screen of the wizard. Here you can use sql statements, use existing stored procedures, or create new stored procedures. For now select “Use SQL Statements” and press the “Next” button.(See image below)

Image 5
[Click to see full-size]

We used over 10 web hosting companies before we found Server Intellect. Their dedicated servers and add-ons were setup swiftly, in less than 24 hours. We were able to confirm our order over the phone. They respond to our inquiries within an hour. Server Intellect's customer support and assistance are the best we've ever experienced.


The next window you will see will be this one.

Image 6
[Click to see full-size]


Select the “Sales” table and press the “Add” button and then the “Close” button.

 

The following window will appear below.
 

Image 7
[Click to see full-size]


Select the (All Columns) square to place a tic mark and then press the “OK” button to save and close the window. You are once again back at the wizard and now you will see this code in the center.

 

SELECT        sales.*
FROM            sales
Ok, great, now press the “Next” and then the “Finish” button.  In design view of Form1 just below the bottom of the form right click on the “sqlDataAdapter” and select generate dataset. Just go with the default settings and press the “OK” button. Ok now right click on the “sqlDataAdapter” again but this time choose “Preview Data”. On the form that pops up(See image below) press the “Preview” button
 

Image 8
[Click to see full-size]

If you're ever in the market for some great Windows web hosting, try Server Intellect. We have been very pleased with their services and most importantly, technical support.


You will now see your data in the resulting form.(See image below)

Image 9
[Click to see full-size]


Ok now just press the “Close button once you are thru looking at the data. Awesome, you have just created your first sqlDataAdapter, SQLConnection, and dataset. You could now use this new dataset in any .Net control of your choice. In the next tutorial we will do just that.
Thank you for taking the time to go thru this tutorial and I really hope that you have gained some knowledge from it. It is my full intention to make these tutorials as complete and easy as possible. Until next time take care and keep learning.
JR

Attachments



Download Project Source - Enter your Email to be emailed a link to download the Full Source Project used in this Tutorial!



100% SPAM FREE! We will never sell or rent your email address!

Leave a Comment

Comments on this Article

Post a Comment
Name:
Website:
Email:
Comments:

#1 Pradeep

Posted By: Pradeep | 12.12.2008 at 2:19 AM

interesting

#2 Tony

Posted By: Tony | 2.16.2009 at 6:38 PM

Injecting ads like this is very annoying.

#3 Ron Blakemore

Posted By: Ron Blakemore | 4.11.2009 at 10:47 PM

How can I change the Data source in VB to select a different SQL Server and save it. Becuase on develope computer I use SQL Express and on the Server I use SQL 2005.

Can you help with some code etc

#4 coolnik999

Posted By: coolnik999 | 7.31.2009 at 1:05 PM

Whats ur source ........

#5 Cindy Bortmes

Posted By: Cindy Bortmes | 8.29.2009 at 1:38 PM

Starting new marketing bussines.

#6 tiensstore

Posted By: tiensstore | 1.09.2010 at 3:03 AM

I had a similar prob, changing the Data source in VB to select a different SQL Server and saving it, can you explain how it can be done? any member can help please, thanks

#7 flowers san antonio

Posted By: flowers san antonio | 1.16.2010 at 1:10 PM

interesting

#8 cialis

Posted By: cialis | 2.17.2010 at 2:37 PM

How to create a data source in Visual Studio.Net 2006???

#9 cool games

Posted By: cool games | 3.07.2010 at 3:42 AM

Excellent post...

#10 220-702

Posted By: 220-702 | 3.19.2010 at 4:35 AM

Great code, I hope, that it will help my in my project, but any way, you have done great work.

#11 Tech Web

Posted By: Tech Web | 5.05.2010 at 5:51 AM

Thanks for administering nice admonition with us.

#12 cat control

Posted By: cat control | 5.12.2010 at 1:47 PM

It is one of the best post from other. It is a useful and charming post. I want to sharing this topic with some of my close friends. So thanks this post.

#13 Oriental Rug Cleaning NY

Posted By: Oriental Rug Cleaning NY | 5.14.2010 at 2:45 AM

It is really good for the beginners to understand the steps and working out to get the result. very useful website. Easy to learn.

Thanks.

#14 laptop battery manufacturer

Posted By: laptop battery manufacturer | 5.21.2010 at 1:28 AM

use we just need any type of project because creating a new data source is commom to all project types. Ok after you enter a name for your project and press the “Ok” button VS.Net will have created your first form for you named “Form1.cs”. At this point the form1 view should be already in design view(If you see a rectangular window that reads “Form1.cs[Design]* then you are in design view.

#15 APPLE laptop battery

Posted By: APPLE laptop battery | 5.21.2010 at 1:29 AM

SQLConnection, and dataset. You could now use this new dataset in any .Net control of your choice. In the next tutorial we

#16 wholesale shoes

Posted By: wholesale shoes | 5.24.2010 at 3:37 AM

Spring summer pocket perfect supporting role (figure) except heart shape brooch, earring, necklace,

#17 PMI-001 dumps

Posted By: PMI-001 dumps | 5.25.2010 at 5:23 AM

I like your blog very much.

#18 70-649 dumps

Posted By: 70-649 dumps | 5.25.2010 at 5:23 AM

Thanks for sharing.

#19 EX0-101 dumps

Posted By: EX0-101 dumps | 5.25.2010 at 5:24 AM

I love this blog very much.

#20 how to grow taller

Posted By: how to grow taller | 5.29.2010 at 4:04 PM

i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job

#21 pheromones

Posted By: pheromones | 6.09.2010 at 1:14 PM

This post helped me out. Thanks for sharing!

#22 Chaitanya

Posted By: Chaitanya | 6.16.2010 at 5:21 AM

Really it is very good for beginners to learn

#23 cheap mbt shoes

Posted By: cheap mbt shoes | 6.18.2010 at 9:04 PM

good post!!thank you

#24 auto insurance quotes

Posted By: auto insurance quotes | 6.22.2010 at 9:22 AM

SQLConnection, and dataset. You could now use this new dataset in any .Net control of your choice. In the next tutorial we

#25 orietnal rug cleaning nyc

Posted By: orietnal rug cleaning nyc | 7.12.2010 at 1:47 PM

great information very efficient for all levels.

Thanks for sharing

#26 rug cleaning ny

Posted By: rug cleaning ny | 7.13.2010 at 1:58 PM

I like your blog, its very valuable information and useful, i will look into the videos more see if i have any questions to ask i am sure i will...

thanks for sharing this.

#27 ann j peters md

Posted By: ann j peters md | 7.14.2010 at 2:21 AM

It clearly shows that the article has made a good impact upon the users. I really appreciate a lot. Good inside details and great writings.

#28 rosetta stone spanish

Posted By: rosetta stone spanish | 7.15.2010 at 2:40 AM

The article written by your very good, I like it very much. I will keep your new article.

<a href="http://www.rosettalanguage.com/">rosetta stone spanish</a>,

<a href="http://www.rosettalanguage.com/">rosetta stone</a>,

<a href="http://www.rosettalanguage.com/">rosetta stone language</a>.

#29 debt solutions

Posted By: debt solutions | 7.16.2010 at 10:03 AM

Great tutorial worked perfect for me first time.

#30 chanel bags

Posted By: chanel bags | 7.18.2010 at 11:51 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#31 chanel sunglasses

Posted By: chanel sunglasses | 7.18.2010 at 11:51 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#32 louis vuitton bag

Posted By: louis vuitton bag | 7.18.2010 at 11:51 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#33 louis vuitton handbag

Posted By: louis vuitton handbag | 7.18.2010 at 11:51 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#34 rayban sunglasses

Posted By: rayban sunglasses | 7.18.2010 at 11:51 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#35 tiffany jewelry

Posted By: tiffany jewelry | 7.18.2010 at 11:52 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#36 tiffany and co

Posted By: tiffany and co | 7.18.2010 at 11:52 PM

I am really interested in this program but I do not know much about it. After reading your article, i have more experiences to work with it. Your post is interesting and picturesque. I hope i can get your post in next time. Keep on!

#37 tiffany jewellery

Posted By: tiffany jewellery | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#38 tiffany jewelry

Posted By: tiffany jewelry | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#39 tiffany co

Posted By: tiffany co | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#40 tiffany jewellery

Posted By: tiffany jewellery | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#41 tiffany jewelry

Posted By: tiffany jewelry | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#42 tiffany co

Posted By: tiffany co | 7.21.2010 at 3:08 AM

For classic and quality genuine silver jewelry, many people choose Tiffany & Co brand.Now,we present you the hottest Tiffany silver jewelry .get more http://www.tiffanyonsale.com/

#43 fiona

Posted By: fiona | 7.21.2010 at 4:06 PM

I think visual studio is not as much better language as Java net bean tool.I am using Java net beans tool for myself.

#44 learn to tap dance online

Posted By: learn to tap dance online | 7.23.2010 at 5:20 AM

I am really glad that you provided detailed information.

#45 tiffany ring

Posted By: tiffany ring | 7.26.2010 at 7:03 AM

This is exactly cheap tiffany jewelry you can get cheap Tiffany Rings, Necklaces, Errings, Bracelets and other Tiffany Jewellery.get more http://www.tiffanyonsale.com/

#46 tiffany bracelet

Posted By: tiffany bracelet | 7.26.2010 at 7:03 AM

This is exactly cheap tiffany jewelry you can get cheap Tiffany Rings, Necklaces, Errings, Bracelets and other Tiffany Jewellery.get more http://www.tiffanyonsale.com/

#47 tiffany necklace

Posted By: tiffany necklace | 7.26.2010 at 7:03 AM

This is exactly cheap tiffany jewelry you can get cheap Tiffany Rings, Necklaces, Errings, Bracelets and other Tiffany Jewellery.get more http://www.tiffanyonsale.com/