Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
notsosuper
Posting Yak Master
190 Posts |
Posted - 2005-03-29 : 18:22:02
|
This is my first time, creating webform that I need to access to sql database. I don't know how to set up my connectionstring and plug in everything. I am using vb.net |
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-03-29 : 20:04:51
|
If you just want to know the format of the connection string, look at www.connectionstrings.com . If you need to know how to connect, there are a lot of sites out there with this information. Check out www.asp.net and see the samples they have. They walk you through this process.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
|
|
notsosuper
Posting Yak Master
190 Posts |
Posted - 2005-03-30 : 11:22:24
|
Thank you so much for your help. I have looked those links you proved, but I think here is my problem, I will create simple connection to sql database so I can open the database and read the records, I have put together this code below and gives me error OleDbConnection is not defined. It also gives me Message box is not defined either but I don't care about this I will take out that part already. I am thinking I already defined OleDbConnection this.<code>Public Sub CreateOleDbConnection() Dim cn As New OleDb.OleDbConnection("myConnString") Dim cmd As New OleDb.OleDbCommand Dim rs As OleDb.OleDbDataReader Dim myConnString As String = _ "Provider=SQLOLEDB;User Id=ghgh;Password=;database=ghghjgjj_SQL_database;Server=111.111.0.11" Dim myConnection As New OleDbConnection(myConnString) myConnection.Open() MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _ + ControlChars.NewLine + "DataSource: " + myConnection.DataSource) myConnection.Close()End Sub</code> |
|
|
|
|
|