How to connect sql database in asp.net using VB?

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: May 2006
Posts: 6
Reputation: sathiya is an unknown quantity at this point 
Solved Threads: 0
sathiya sathiya is offline Offline
Newbie Poster

How to connect sql database in asp.net using VB?

 
0
  #1
May 6th, 2006
Hi all,

I would like to seek for some help from you on how to create a connection to a sql server database from an asp.net application using VB codes. I appreciate if you could provide me the relevant information about that with some sample codes.

Thank you.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 9
Reputation: mojio is an unknown quantity at this point 
Solved Threads: 0
mojio's Avatar
mojio mojio is offline Offline
Newbie Poster

Re: How to connect sql database in asp.net using VB?

 
0
  #2
May 9th, 2006
  1. Dim strConn As String = "Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=xxx;Initial Catalog=Your database name;Data Source=Your server Name"
  2. Dim strsql As String = "Your SQL Command"
  3. Dim myconn As New OleDbConnection(strConn)
  4. Dim myCommand As New OleDbDataAdapter(strsql, myconn)

And don't forget to add
Imports System.Data.OleDb
Above your public class(On the top of the page

^^
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC