0

hello friend,

can someone help me, i want to learn how to connect my app database from another computer using code, i already try to change connection string = "Data Source=-SERVERNAME-\SQLEXPRESS;Initial Catalog=SmartHome;Integrated Security=True" but its still same, someone please help me, im using win8, microsoft sql server 2008, Visual studio 2010

2
Contributors
5
Replies
23
Views
3 Years
Discussion Span
Last Post by Begginnerdev
0

What Adapter are you using?

SQLClient, OLEDB, ACE ?

If you are using SQLClient Then try something like this:

Try
    Dim con As New SQLConnection("Data Source=MYSERVEr;Initial Catalog=MYDATABASE;Integrated Security=True")
    con.Open
Catch ex As Exception
    MsgBox(ex.ToString)
End Try

Edited by Begginnerdev

0

im using SQLclient, but its still same, nothing happen....code that you give like i said at my question, see my connection string, its same, so i think that maybe have some setting that need to do...

0

Are you getting an error?

Or are you confusing connection with command?

A command would be:

Dim con As New SQLConnection("Data Source=MYSERVER;Initial Catalog=MYDATABASE;Integrated Security=True"
Dim com As New SqlCommand("SELECT * FROM table",con)   
Dim da As New SQLDataAdapter(com)
Dim ds As New DataSet

da.Fill(ds,"MyTable")

Edited by Begginnerdev

0

yes! its same you can see my connection string on my question...its cant run from another computer.

0

What error are you getting on the other computer?

If you are using a DNS name on a server that is not on the same network as the other computer - then you will have to use the ip of the server.

This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.