Solved

SQL Connection in ASP.NET VB

Posted on 2014-09-19
9
225 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now