connectting to db problem
Hi guys could anyone help me out here I don't know what to do now. I have sqlserver db and I would like to retrive the data into sqlce db I don't know how so I made app to retrive the data in a dateset and save the to the sqlce db but I can't connect to the sqlserver, I am getting error that the servername\sqlexpress does not exist so I would be grateful if anyone could help me. Thanks
Re: connectting to db problem
What is your connection string?
Re: connectting to db problem
Quote:
Originally Posted by petevick
What is your connection string?
Here is the connectionstring and I have reference sqlclient as well
Code:
Imports System.Data.SqlClient
Public Class ShiftManagerDB
Public Shared Function GetConnected() As SqlConnection
Return New SqlConnection(GetConnectionString)
End Function
Public Shared Function GetConnectionString() As String
GetConnectionString = "Data Source=WorkPlace\SQLEXPRESS;Initial Catalog=ShiftManagerDB;" _
& "Integrated Security=SSPI;persist security info=False;"
End Function
End Class
Thanks for your responds.
Re: connectting to db problem
Hi,
from a previous answer...
Ok, after a bit of digging, try this (or similar)
Dim Ccon As New SqlConnection("Persist Security Info=False;Integrated Security=False;Server=beehive25,1068;initial catalog=Sales_Data;user id=sa;password=polaris;")
This was gleaned from http://netcf2.blogspot.com/2005/12/a...ress-from.html
It would appear you don't need to quote the instance
Pete
Re: connectting to db problem
Quote:
Originally Posted by petevick
Hi,
from a previous answer...
Ok, after a bit of digging, try this (or similar)
Dim Ccon As New SqlConnection("Persist Security Info=False;Integrated Security=False;Server=beehive25,1068;initial catalog=Sales_Data;user id=sa;password=polaris;")
This was gleaned from
http://netcf2.blogspot.com/2005/12/a...ress-from.html
It would appear you don't need to quote the instance
Pete
Thanks but still the same error. I would be grateful if you could help me on any other way I could copy data from sqlserver 2005 database tables to sqlce database tables.
Re: connectting to db problem
Hi,
what is your connection string now?
If you want to copy data from your Sql2005 database, you will still have to connect to it. The other way to populate would be to use RDA or replication
Pete