Results 1 to 6 of 6

Thread: connectting to db problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    London United Kingdom
    Posts
    334

    Angry 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

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: connectting to db problem

    What is your connection string?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    London United Kingdom
    Posts
    334

    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.

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    London United Kingdom
    Posts
    334

    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.

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width