Connection with sql server 2000

F

Fabio

Hello,

My name is Fabio.

I'm trying to connect with one intance of SQL 2000 (MSDE) via compact
framework. But I can't connect. What is wrong in my code?
My Connection String is OK? If not, how could i build one?
Imports System.Data.SqlClient

Public Class Database

Private Conn As New SqlConnection

Sub New()

Conn.ConnectionString = "user id=sa;password=;initial
catalog=Restaurate;server=mobile\msql2000"

Try

Conn.Open()

MsgBox("Conectado")

Catch ex As SqlException

MsgBox(ex.Message)

End Try

End Sub

End Class
 
A

Alex Feinman [MVP]

I suppose the problem is that the device cannot resolve the name "mobile".
Try using the IP address to see if it helps
 
N

Nicolas Nasdrovisky

Hi.

You should double your back slash:
Conn.ConnectionString = "user id=sa;password=;initial
catalog=Restaurate;server=mobile\\msql2000"

If you are connecting through an ActiveSync, try tu use "PPP_PEER" as the server
name.

Nicolas.
 
A

Alex Feinman [MVP]

He's using VB - in VB "\" is not doubled

Nicolas Nasdrovisky said:
Hi.

You should double your back slash:
Conn.ConnectionString = "user id=sa;password=;initial
catalog=Restaurate;server=mobile\\msql2000"

If you are connecting through an ActiveSync, try tu use "PPP_PEER" as the server
name.

Nicolas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top