Solved

SQL Connection in ASP.NET VB

Posted on 2014-09-19
9
243 Views
Last Modified: 2014-09-22
Hi,

I'm trying to learn ASP.NET and am looking for a good tutorial on data connection to SQL Database.

Thanks
0
Comment
Question by:Gareth_Pointon
  • 4
  • 4
9 Comments
 
LVL 33

Expert Comment

by:it_saige
ID: 40333592
Can probably never go wrong with 4 guys from rolla.  ;)

http://www.4guysfromrolla.com/articles/110905-1.aspx

-saige-
0
 

Author Comment

by:Gareth_Pointon
ID: 40333613
Hi,

I'm using Dreamweiver at the moment for the Dev.

Its going on about SPRY Connection but totally non the wiser. ITs all Japanese to me :-(
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40333615
In that case, here is the Adobe TID on database connections for Dreamweaver.

http://helpx.adobe.com/dreamweaver/using/database-connections-asp-developers-cs6.html

HTH,

-saige-
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 7

Expert Comment

by:Abu Hamdan
ID: 40333626
Hi,

I would recommend this site;

http://www.w3schools.com/aspnet

Its great for beginners and take you step by step.

DB related:

http://www.w3schools.com/aspnet/webpages_ref_database.asp
0
 

Author Comment

by:Gareth_Pointon
ID: 40333629
So is it the same string as Classic ASP ?
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40333636
Yes.  The connection string specified should work:

Driver={SQL Server};Server=Socrates;Database=AcmeMktg; UID=wiley;PWD=roadrunner

-saige-
0
 

Author Comment

by:Gareth_Pointon
ID: 40333637
Dim MM_ETDBCONN_STRING
MM_ETDBCONN_STRING = "dsn=DNSSTRING;uid=DBUSER;pwd=PASSWORD;"


?
0
 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 40333708
You want to try something like this:

Dim Connection As New SqlClient.SqlConnectionStringBuilder
Connection.DataSource = "Database name"
Connection.UserID = "user name"
Connection.Password = "password"
Dim objSQlConnection = New SqlClient.SqlConnection(Connection.ConnectionString)

Open in new window


Make sure that at the head of the file you include:
Imports System.Data.SqlClient

Open in new window


More information concerning the SqlConnectionStringBuilder class:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder(v=vs.110).aspx

HTH,

-saige-
0
 

Author Comment

by:Gareth_Pointon
ID: 40334376
OK..

Reading more in to it I have to decide what coding method I'm going to learn...

Looking there are two main ones. Razor and MVC.

What would be peoples professional opinions as I read Razor keeps out the way more and is easier to learn which it appealing.

Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

856 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