Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.NET 2005 Connection and Data from SQL Server

Posted on 2006-04-25
11
Medium Priority
?
179 Views
Last Modified: 2010-04-23
Experts,

Can you please create a project that connects to SQL Server and returns data based on a SQL Query. Return the data to a datagrid or something just for viewing. Please include all actual code. Do not implment functions or error handling. I would like this to be as basic as possible, then build on it. Also, please do not use any wizards or anything that generates code because that could cause me problems.

Thanks Very Much
0
Comment
Question by:padgettbrian
  • 6
  • 5
11 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16539891
please have a look at http://msdn.microsoft.com/vbrun/staythepath/additionalresources/introto2005/

it is a free introduction book you can download
0
 

Author Comment

by:padgettbrian
ID: 16544749
thanks for the link. im having trouble with the book though, to much going on. I REALLY REALLY could just use someones help to simply all this. Code and a couple comments is what im trying to find.

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1000 total points
ID: 16544817
You should read chapter 4.

to get data:

Dim conn As New SqlConnection conn.ConnectionString = _
“server=(local);database=Northwind;Trusted_Connection=True"
Dim adapter As SqlDataAdapter
adapter = New SqlDataAdapter(“SELECT * FROM Products", conn) Dim dsProducts As New DataSet
conn.Open()
adapter.Fill(dsProducts)
conn.Close()

to show data into a grid:
YourGridControlName.dataSource = dsProducts
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:padgettbrian
ID: 16544850
would you be around so if bump into a couple questions i can ask? that would be a huge help!

THANKS
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16544937
This forum could not be used as a chat room! The purpose of the forum is to ask 1 question and get some comments on it.

I also cannot promise I will be around 24/7.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16544945
up to now, I have always commented within reasonnable delays.
0
 

Author Comment

by:padgettbrian
ID: 16544951
No kidding...
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16544978
and you gave me a C because of my latest comments!
0
 

Author Comment

by:padgettbrian
ID: 16544989
This forum could not be used as a chat room!
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16546024
Sorry for all that. I just didn't want you to use this question as a pretext for asking all kind of questions not related to the original question.
0
 

Author Comment

by:padgettbrian
ID: 16546431
ah ya i can see how that happens, apologies. :) and thanks for the assistance
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question