Results 1 to 4 of 4

Thread: Using SQL Database on remote PC.

  1. #1
    Addicted Member
    Join Date
    Sep 11
    Location
    Buckingham, England
    Posts
    153

    Using SQL Database on remote PC.

    Currently I have a program and sql database both residing on the same PC and all is working fine.
    My current connection string is PubConnString = "Data Source=mikespc\sqlexpress; Initial Catalog=db_PigginGifts; Integrated Security=True"

    I now wish to use the same program but with the database on a different PC eventually connecting over the internet using a static IP Address. To test this I have tried connecting to my own PC rather than connecting remotely and used the following connection string but although I do not get any errors I do not access the data in my database either.

    PubConnString = "Provider=sqloledb;Data Source=192.168.1.65,1433;Network Library=DBMSSOCN;mikespc\sqlexpress; Initial Catalog=db_PigginGifts; Integrated Security=True"

    My first question is whether it is possible to connect to a database on your own PC this way and if so what am I doing wrong.

  2. #2
    Burning Member Niya's Avatar
    Join Date
    Nov 11
    Posts
    3,096

    Re: Using SQL Database on remote PC.

    You said you got no errors so I'd assume its working but then you implied its not. Could you elaborate ?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  3. #3
    Addicted Member
    Join Date
    Sep 11
    Location
    Buckingham, England
    Posts
    153

    Re: Using SQL Database on remote PC.

    The opening form of the program has a combobox where the user can select a name before entering their password. This screen opens up OK and does not display any errors but the drop down box for the combobox is empty. The drop down list is meant to have a list of names retreived from a table associated with the database I am now trying to connect to.

  4. #4
    Burning Member Niya's Avatar
    Join Date
    Nov 11
    Posts
    3,096

    Re: Using SQL Database on remote PC.

    I'd suspect that the query isn't working as you expect. Experiment with smaller queries first like simple Select queries to see if it works.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | Create Sortable BindingList(not mine) | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

Posting Permissions

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