Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Commands?

Status
Not open for further replies.

antonio622

Programmer
Jun 10, 2007
20
US
I am quite new to ASP.net but I no stranger to the SQL and .net database design process.

I know that ASP.net has numerous wizards as does Visual Studio.net has.

I actually enjoy and like to access my database through code only. (using datatables)

Including: (Declarations)
Private ADONetConnection As New SqlClient.SqlConnection()Private DataAdapter As SqlClient.SqlDataAdapter
Private CommandBuilder As SqlClient.SqlCommandBuilder
Private dtContacts As New DataTable

Then in code:
ADONetConnection.ConnectionString = "whatever"
ADONetConnection.Open()
DataAdapter = New SqlClient.SqlDataAdapter("Select * From Employees", ADONetConnection)
CommandBuilder = New SqlClient.SqlCommandBuilder(DataAdapter)
DataAdapter.Fill(dtContacts)

My question is:

Can I do this in ASP.net because I cant seem to find these commands. (Im using VB)




 
I wasnt using the correct syntax:

System.Data.SqlClient

Thanks Anyhow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top