|
-
May 13th, 2013, 03:38 PM
#1
Thread Starter
New Member
data source nameing
I have written my first app using a database. The connection works fine on all pc's it's loaded on but one. The PCs all have the same load so at first I thought it was permissions.
the error is "...error occurred while establishing a connection to SQL server ..... error:26..."
Now I am suspecting that it is my data source name.
Is there a way to automatically name the datasource, if that is my problem.
I've added users and changed permissions in my security tab under properties but no luck.
Again this is the first app I have using a database and honestly I really do not know what i'm doing.
Public m_cn2 As New SqlConnection()
Public m_cn2mdfPath As String = "C:\UCAL\WatchdogPCRevison.mdf"
Public m_DA2_T1 As SqlDataAdapter
Public m_CB2_T1 As SqlCommandBuilder
Public m_DataTable2_T1 As New DataTable
Public m_rowPosition2_T1 As Integer = 0
Public m_drNewRow2_T1 As DataRow = m_DataTable2_T1.NewRow
m_cn2.ConnectionString = "Data Source=.\SQLEXPRESS; AttachDbFilename = " & _
m_cn2mdfPath & ";Integrated Security=True; Connect Timeout=30;" & _
"User Instance=True"
Any help would be appreciated
-
May 13th, 2013, 05:15 PM
#2
Re: data source nameing
Check to make sure that SQLServer Express has been installed... AND that the default named instance is correct... what you left out in the error message was the next sentence... "The server was not found or was not accessible." ... meaning, it couldn't find the instance running at ".\SQLEXPRESS" ... which means either 1) it's not running, 2) not installed, or 3) named something other than SQLExpress
-tg
-
May 13th, 2013, 05:46 PM
#3
Thread Starter
New Member
Re: data source nameing
Sorry about that, I've attached a screenshot of the error.
I've changed it to ".\SDCO" and after a bit of playing was able to get it to work. Is there a way to capture the actual name in a string?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|