Keirameister
asked on
How do I connect a Windows Application (vb.net) to SQL Server DB...in visual studios
Hey Experts...
Thanks soooo much in advance for any help you can throw my way on this its really appreciated!
I am doing a project at the and i cant figure out for the life of me how to connect the DB (SQL server) to the Application (vb.net windows app).
I have the code to do it using an Access DB.... and the following code is contained in the module of the project!!
'declaring the database connection and database modules!
Friend objConnection As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=RoyalAbbeyBanking.m db")
Friend objCustomerDA As New OleDb.OleDbDataAdapter("Se lect * from CustomerTable", _
objConnection)
Friend objCustomerCB As New OleDb.OleDbCommandBuilder( objCustome rDA)
Friend objDataSet As New DataSet()
Friend objAccountDA As New OleDb.OleDbDataAdapter("Se lect * from AccountTable",
objConnection)
Friend objAccountCB As New OleDb.OleDbCommandBuilder( objAccount DA)
But i was wondering if anyone could give me a step by step on how to do this for a SQL Database... is it the same or does visual studios allow this to be done in the background.. I'm so confused!
Thanks soooo much in advance for any help you can throw my way on this its really appreciated!
I am doing a project at the and i cant figure out for the life of me how to connect the DB (SQL server) to the Application (vb.net windows app).
I have the code to do it using an Access DB.... and the following code is contained in the module of the project!!
'declaring the database connection and database modules!
Friend objConnection As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OL
Friend objCustomerDA As New OleDb.OleDbDataAdapter("Se
objConnection)
Friend objCustomerCB As New OleDb.OleDbCommandBuilder(
Friend objDataSet As New DataSet()
Friend objAccountDA As New OleDb.OleDbDataAdapter("Se
objConnection)
Friend objAccountCB As New OleDb.OleDbCommandBuilder(
But i was wondering if anyone could give me a step by step on how to do this for a SQL Database... is it the same or does visual studios allow this to be done in the background.. I'm so confused!
ASKER
Hey thanks for that...
So do you suggest that I open a new project and place this where???
What do you mean by sql query and connection string .. are they generated or do i have to write these also?
Thanks again.
So do you suggest that I open a new project and place this where???
What do you mean by sql query and connection string .. are they generated or do i have to write these also?
Thanks again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much you guys for the help.
:)
did you get it working?
ASKER
Yes thank you...
Open in new window