Solved

SQL Connection in ASP.NET VB

Posted on 2014-09-19
9
223 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 32

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 32

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

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

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 32

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Left Join with Tuple returning more rows 10 56
Azure SQL DB? 3 19
Copy/Clone an object. 9 15
SQL JOIN + SUBQUERY? 3 14
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

760 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