Rank: Newbie Groups: Member
Joined: 3/18/2015 Posts: 3
|
In the Samples I can see how to Populate a grid with App_code/demoDb.vb*: Public Sub New() Dim dbFileName As String = HttpContext.Current.Request.MapPath("~\App_Data\DICTIO.mdb") Dim provider As String = String.Format("Provider=""Microsoft.Jet.OLEDB.4.0""; Data Source=""{0}"";", dbFileName)
m_cn = New OleDbConnection(provider) m_cn.Open() End Sub 'New My question is How I can connect to a SQL server Database
Thanks
Walter
|
Rank: Newbie Groups: Member
Joined: 3/18/2015 Posts: 3
|
Very Easy. you must change the provider to: Dim provider As String = "Provider=SQLNCLI; Data Source=SQLSERVER\INSTANce;Initial Catalog=DatabaseNAme;Persist Security Info=True;User ID=USERNAME;Password=USERPASSOWRD"
|