|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
SQL Server Express 2008 connection problem I am developing an application in VB.Net with a database in SQL Server Express 2008. I made my connection Code: 'definition of connection variables Dim user As String Dim mdp As String Dim bdd As String Dim server As String Dim connstring As String 'recovery of connection variables user = "sa" mdp = "" bdd = "elect_test_yln" server = " .\SQLEXPRESS" 'filling of the variable to start the connection connstring = "Persist Security Info = true; Integrated Security = SSPI; Data Source = " & server & "; Database = " & bdd & "; User ID = " & user & "; Password = " & mdp & ";" 'connection has the database with error handling Try conn = New SqlConnection(connstring) conn.Open() Catch e As Exception MsgBox("The following error occurred: " & e.Message) Finally : conn.Close() End Try Code: data_parent = "select numfile, label from file" Dim request_parent As New SqlCommand(data_parent) reader_parent = request_parent.ExecuteReader reader_parent.Read() Quote:
|
#2
| |||
| |||
Re: SQL Server Express 2008 connection problem By learning to read errors and considering/trying to understand a little bit. The documentation may also help: MSDN tutorials ADO.Net, .... For Quote:
So on your SqlCommand object you must have something to initialize this connection, what you do not. If necessary, the link to the MSDN for the class.
__________________ Grand Theft Auto 4 PC Video Game |
#3
| |||
| |||
Re: SQL Server Express 2008 connection problem Thank you for responding so quickly! I blocked the above this morning and I searched msdn and company without really finding any happiness. Ok I'll look at it more closely. |
#4
| |||
| |||
Re: SQL Server Express 2008 connection problem The ObjetConnection corresponds to Conn in your case, its your variable connection. Here are the items that need to be reported for the connection: Code: Private rqSql As String 'SQL string String Private cnxString As String 'SQL string used to accommodate the Chemain the SQL database Private CNX As System.Data.SqlClient.SqlConnection 'Subject connection string that contains the connection string CMD Target As System.Data.SqlClient.SqlCommand 'contains the connection over the SQL query Private da As System.Data.SqlClient.SqlDataAdapter 'Data fit, subject only connected program Private DS As System.Data.DataSet object cache that contains all records from the output of CMD |
![]() |
|
Tags: sql, sql server 2008, sql server express, vbnet |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to manage vpn connection with IBM server 2008 | vibs10 | Networking & Security | 1 | 23-08-2011 04:06 PM |
SQL server 2008 R2 EXPRESS: Do not access the instance | BOWIE | Operating Systems | 7 | 05-03-2011 08:16 PM |
SBS 2008 Fax Server role, no fax connection | Billie | Small Business Server | 5 | 15-09-2010 05:10 PM |
Special features of SQL Server Express 2008 | GunFighter | Windows Software | 3 | 12-08-2009 02:39 PM |
Visual Basic express sql server connection | shilong | Software Development | 3 | 06-08-2009 12:39 PM |