Hello Guys!

I just created my first VB.net project using Microsoft Visual Studio 2010 that has database(.mdf) and some forms,
here is the video link of my project: http://www.youtube.com/watch?v=4YBt3vP85kY

I want my project to be remote/network using lan environment, in what way i can do this? can you please help and guide me how to start.

i keep goggling i can't find the answer so i end up in your site, I already install SQL Server 2008 R2 in my PC, and i already set up 2 computer here in my house 1 act as a server and the other is client using Lan.

I don't have any experience doing this, can you please guide me guys and how to start?

Thanks in advance

starmax

Recommended Answers

All 16 Replies

your video is set to private

i assume your database is on your server computer..
just use connection like following for your app.

Data Source=192.168.0.100\yourinstancename;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

your video is set to private

Hi, my video is not private anymore..

Thanks

i assume your database is on your server computer..
just use connection like following for your app.

Data Source=192.168.0.100\yourinstancename;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

Hi sandee,

Thanks for your reply.

I'll try the code and I'll be back for the result.

Thanks again

best regards

Starmax

ok.. be sure to make an exception in your windows firewall for above settings to work or disable ur firewall..

ok.. be sure to make an exception in your windows firewall for above settings to work or disable ur firewall..

Hi sandee,

sorry this is my first time to do this, please guide me.
I never did this before.

so what i did is i copy the code that you've given and paste it to my first form load event and i got this error : http://img191.imageshack.us/img191/3411/captureruv.png

Thanks

you Did change 192.168.0.100 with your server's ip and other parameter according to your projects right??

if its all right can u give me the coding of what u did?

I just copy and paste what you post,
actually i don't know the code, i don't know where and how to start.

i keep googgling but i dont know what is the exact title im goggling.
I cant find any answer and thats why I end up here in Daniweb.

can you please guide me?

Thanks again

:|

I just copy and paste what you post,
actually i don't know the code, i don't know where and how to start.

i keep googgling but i dont know what is the exact title im goggling.
I cant find any answer, and that's why I end up here in Daniweb.

can you guide me?

Thanks again

Data Source=192.168.0.100\yourinstancename;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

In above Code changes "yourinstancename" with Your Sql Instance Ex: SqlExpress (which is defaul instance)

"myDataBase" with your Database name
"myUsername" with your user id for sql server
"myPassword" with your password for sql server
and "192.168.0.100" with your server id or server-name

Data Source=192.168.0.100\yourinstancename;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

In above Code changes "yourinstancename" with Your Sql Instance Ex: SqlExpress (which is defaul instance)

"myDataBase" with your Database name
"myUsername" with your user id for sql server
"myPassword" with your password for sql server
and "192.168.0.100" with your server id or server-name

Hi, here is my code:

Data Source=STARMAX-PC;Initial Catalog=myDataBase;User ID=User1;Password=password;

and i came up with error.

:(

ty

Dim conn As New SqlConnection("Data Source=server-PC\instance;Initial Catalog=Northwind;Persist Security Info=True;User ID=id;Password=pass")

connection string have to be like this.. enclosed in parenthesis

Try the following connection string, backslashes added and your server (pc) name -

Data Source=\\192.168.0.100\MyServerNameHere\yourinstancename;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

I created new application,
what i did is:

1. I open SSMS and create Database
2. I open Microsoft Visual Studio 2010 create new Project "windows Form applications"
and this is my code:

Imports System.Data.SqlClient

Public Class Form1
    Private cs As New SqlConnection("Data Source=STARMAX-PC;Initial Catalog=ADO_PRACTICE;Integrated Security=True")
    Private da As New SqlDataAdapter("SELECT * FROM tblContacts", cs)
    Private ds As New DataSet
    Private cmb As New SqlCommandBuilder(da)

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            Dim myConnection As SqlConnection = New SqlConnection()
            myConnection.ConnectionString = "Data Source=STARMAX-PC;Initial Catalog=ADO_PRACTICE;Integrated Security=True"

            da.Fill(ds, "tblContacts")
            dg.DataSource = ds.Tables("tblContacts")

        Catch ex As Exception

        End Try

    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click

        Dim x As Integer

        da.UpdateCommand = cmb.GetUpdateCommand

        x = da.Update(ds.Tables("tblContacts"))

        MsgBox(x & " Record(s) updated! ")

    End Sub
End Class

after that I saved and i run my application , and there's no error..
here is the image please view:

3. I share the folder of my Application so I can access to the other pc.
4. I run the .exe in the other pc and there's no error showing up, but the Form show just a blank, please view image.

is my code correct?

Thanks guys

Hello again,

Have anyone of you guys have experienced, sharing your vb.net project that has database.mdf created with SQL Server 2008, and share them in LAN Environment?

I really need you're help guys, because me, I don't have any Idea.

can you please guide me.

here is what is did:


1. I open SSMS and create Database
2. I open Microsoft Visual Studio 2010 create new Project "windows Form applications"
and this is my code:

Imports System.Data.SqlClient

Public Class Form1
    Private cs As New SqlConnection("Data Source=STARMAX-PC;Initial Catalog=ADO_PRACTICE;Integrated Security=True")
    Private da As New SqlDataAdapter("SELECT * FROM tblContacts", cs)
    Private ds As New DataSet
    Private cmb As New SqlCommandBuilder(da)

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            Dim myConnection As SqlConnection = New SqlConnection()
            myConnection.ConnectionString = "Data Source=STARMAX-PC;Initial Catalog=ADO_PRACTICE;Integrated Security=True"

            da.Fill(ds, "tblContacts")
            dg.DataSource = ds.Tables("tblContacts")

        Catch ex As Exception

        End Try

    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click

        Dim x As Integer

        da.UpdateCommand = cmb.GetUpdateCommand

        x = da.Update(ds.Tables("tblContacts"))

        MsgBox(x & " Record(s) updated! ")

    End Sub
End Class

after that I saved and i run my application , and there's no error..
here is the image please view:

3. I share the folder of my Application so I can access to the other pc.
4. I run the .exe in the other pc and there's no error showing up, but the Form show just a blank, please view image.

is my code correct?

Thanks guys

Please :(

starmax

its me again,

hello guys have encounter this error?

what I did to my Project is:
1. DONE : SSMS ->...

2. DONE : view me

3. DONE : view me

4. DONE : app.config code

5. DONE : Firewall

6. I run the application in my notebook(win7) its working properly, all the record that I input in application.exe are all stored to the Database that has connected to SSMS.

7. I run the application to the other Notebook(winxp), the form open, I went to the other form to view the record upon clicking the display button that has (code : "Me.RegistrationTableTableAdapter.Fill(Me.PSCSDatabaseDataSet.RegistrationTable)") and i got this error . how to fix this error ?

Thanks

jhules

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.