Hi, I've been Searching the Net for hours now, and i can't really seem to find anything clear and straight to the point.

I need to create a Server/Client application using VB.net 2008, it's actually my first time to have a database on another computer. So I first searched the internet for the things i need to make this software.

-MSSQL Server 2008 (Not R2)
-Management Studio
-Vb.Net 2008 Express Edition
-A Desktop (Client)
-A Laptop (Server)
- 1 Crossover Cable

What i have managed to do so far:

1. I have Connected and Established a connection between the two Computers and "Pinged" them using cmd> ping 192.168.X.X and they both replied.

2. I Created a Database on the Server(Laptop) using MSSQL Server 2008 and named it "Network18".

3. I made a Simple Form and a button in the Client (Desktop).

4. I wrote this code in order to test the connection between the two computers..

Imports System.Data.SqlClient
Public Class Form1
    Dim Sqlcon As SqlConnection
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Sqlcon = New SqlConnection("Data Source=MyComputerName\SQLEXPRESS;Initial Catalog=Network18;Integrated Security = True")
        Sqlcon.Open()
    End Sub
End Class

("Please do check if i'm missing something")

The Problem:

I don't think something is wrong with my code, but every time I try to execute the software from the "Client", in order for me to test if i made the connection successfully, i get this error..

Login failed for user 'MyComputername\Guest'.

so i searched the net for some clues and read about an article about the the authentication of my database. so i checked again my authentication and i saw that it's set in Windows Authentication, which i think is correct. but when i try to remove the "\SQLEXPRESS" together with the mycomputername it just gives the network connection error.

I tried turning off my AV + my Firewall, Made some changes in the users in MSSQL management studio, tried Reseting the SQL Server from services.msc.. still the same error.

so, can anyone help me on this one.. i've spent all morning trying to figure out where i went wrong. any help will be appreciated thanks!

U need to create the Service account i guess. Which can be passed as user name and password from ur application so that all the user in LAN will have access to server.
or Pass the credentials to server i.e: User name and password

U need to create the Service account i guess. Which can be passed as user name and password from ur application so that all the user in LAN will have access to server.
or Pass the credentials to server i.e: User name and password

Correct me if im wrong sir, base on what i can understand is basically i have to set a username and password in MSSQL Server to use in my application in the connection string in order to get pass that error?

first install sql server management studio , then make sure server computer is connect with your computer , then give that server name like server/sqlexpress , then connect it ,

first install sql server management studio , then make sure server computer is connect with your computer , then give that server name like server/sqlexpress , then connect it ,

Yes, I've already done that. the thing is when i'm using the code above to check for connections with my soon to be software using vb.net 2008, the error "Login failed for user 'MyComputername\Guest'" pops up. that's my problem.

hello!
you have to make the login in server for this client then connect it ,

Regards

Hear is the procedure:

I have created a project in vb

first create a project

compile that application,Make it EXE application

i am useing windows7,So i installed iis7.5 through control panel

now configure your EXE application with iis

Select your folder in iis and go to security tab change it to Everyone

That's it,Now your application available throught LAN.

vas.shrinivas002@gmail.com

Member Avatar for Rahul47

I Think you Should Try Entering IP Address in place of MyComputerName.

You can only use Integrated Security when in an active directory. I don't think you've set that up in your laptop, so visit http://www.connectionstrings.com/ and choose a connection string with user id and password, like:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

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.