Monday, March 12, 2012

Open connection in sql server

Try
Dim l_connString As String

l_connString = "Server=kangalert;database=Order;user id=sa;password=123;"
m_cn = New SqlConnection(l_connString)
m_cn.Open()

Catch ex As SqlException
Dim l_sqlerr As SqlError
For Each l_sqlerr In ex.Errors
MsgBox(l_sqlerr.Message)
Next
End Try

i got this in my mobile application, which try to open a connection directly to the sql server, but i got the following message

General Network error, check your network documentation.

Please go ahead and do general network troubleshooting to make sure you can connect (ping, port scan, etc.). That can be done with free vxUtils tool.

|||

i cannot connect directly to the sql server, but i can pull data from sql server.

It is really can connect directly to the sql server using mobile?

|||

If by “pull” you mean RDA/Replication, that is done via IIS. Direct connection is not going through IIS as it's just that - direct.

Yes, it is possible and just works assuming you have popper SQL Server and network setup.

If you not familiar with SQL Server connectivity configuration and/or network troubleshooting, you should seek help from your IT department.

|||

This is confusing - your code shows an attempt to use the System.Data.SqlClient and open a SqlConnection directly on the server using SQL Server authentication. You're reporting a network error when you try to establish the connection but then say that you can pull data from Sql Server. If you are running SqlCommands on the remote SqlServer and getting data back, you're in good shape. If you are trying to do RDA.Pull, your code is the wrong sort of connection. For RDA you need to be using System.Data.SqlServer.Ce and creating a SqlCeConnection.

Please clarify what you're trying to do and we'll try to help.

Darren

|||

yes, i agree with you. but my problem is the direct connection not the RDA . pull.

so do you have any idea of this error....

"General Network error, check your network documentation"

for you information i debug this simple application through a emulator. Should i use a real device to perfrom this testing?

|||You could install vxUtils to the emulator or device and perform general network diagnostics (ping, port scan, etc.) to see of server is reachable.

No comments:

Post a Comment