Please guys..I'm waaayyyy behind schedule here..Need Help!
I have 2 applications, one is Windows Form app and the other is SmartDevice app (PPC2003) :
the question I want to ask is, how to connect my PPC to SQL Server through WIFI.the problem is always error everytime I open a connection : "System.Data.sqlClient.SqlException: SqlException at System.Data.sqlClient.SqlConnection.OnError() at System.Data.SqlClient.SqlInternalConnection.OnError()", but on my Windows Form works fine!here's my code:
Dim connection As New SqlConnection("Data Source=192.168.0.1;Initial Catalog=MyTable;Integrated Security=True")connection.Open()
Dim queryString As String = _ "SELECT name FROM Customer" & _ " group by name order by name" Dim adapter As SqlDataAdapter = New SqlDataAdapter( _queryString, connection)
Dim mstCust As New DataSet Dim mst As DataRowadapter.Fill(mstCust,
"MyTable")
1. Do I have the right Connection String (maybe different with PC's). Is there any difference about how to connect to SQL 2005 and SQL 2000, but as for as I know they using the same Connection String.
2. Do I have the right code to connect
3. Do I have to write Connection String with port number if so, how to write it

PPC2003 connect SQL Server through WIFI, howto?
Tom K
Please guys..I'm waaayyyy behind schedule here..Need Help!
I have 2 applications, one is Windows Form app and the other is SmartDevice app (PPC2003) :
the question I want to ask is, how to connect my PPC to SQL Server through WIFI.the problem is always error everytime I open a connection : "System.Data.sqlClient.SqlException: SqlException at System.Data.sqlClient.SqlConnection.OnError() at System.Data.SqlClient.SqlInternalConnection.OnError()", but on my Windows Form works fine!here's my code:
Dim connection As New SqlConnection("Data Source=192.168.0.1;Initial Catalog=MyTable;Integrated Security=True")connection.Open()
Dim queryString As String = _ "SELECT name FROM Customer" & _ " group by name order by name" Dim adapter As SqlDataAdapter = New SqlDataAdapter( _queryString, connection)
Dim mstCust As New DataSet Dim mst As DataRowadapter.Fill(mstCust,
"MyTable")1. Do I have the right Connection String (maybe different with PC's). Is there any difference about how to connect to SQL 2005 and SQL 2000, but as for as I know they using the same Connection String.
2. Do I have the right code to connect
3. Do I have to write Connection String with port number if so, how to write it
Elurahu
I'll answer it my self!!
1. the connstr is not exactly right, for connecting from a device we should use port number, user name, password!But if you just using LAN, you can exclude the port number on the connection string
rightconnstr="Data Source=192.168.0.1,1433;Initial Catalog=MyTable;user id=sa;password=;" where 1433 is the default value for SQL Port, make sure you have blank password my connstr
for detail you should check this link for the steps http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html (thanks netcf2 guys for providing this link)
2. the code works!!
3. Answered on #1, but if still not success connecting your device, you SHOULD unistall SQL Server (clean uninstall), uninstall-reinstall your connection (WIFI), reinstall SQL Server and back to step #1 (the given link). Its because SQL didnt detect your connectivity when you install the SQL first. check for SQL server Configuration Manager again, you should see many IP (depends how much you have the connectivity) and set the Configuration Manager like the link said!!
nb : for additional help you should install VxUtil to scan the open port
IT WORKS FOR ME!!!
thanks for the mods though =(
SechMolinari
2. for right connstr please use my above connstr!do not use your computer name but your IP Address following by ",1433" (comma port number)
3. You should user your UserID and Passwd for connect!!example : "userid=sa; passwd;"
hope it helps
Tony_NTFY
i have quetion :
1. How to open my port 1433 (my port status with i try to see with nmap software is "filtered")
2. I tried with this connection string :
Dim conn As New SqlConnection("Server=myserver,1433;initial catalog=CRM;Integrated Security=SSPI;")
but it's failed. Why
3. My SQL Server 2000 need UserId and Password to login that's, account need to add in my connectionstring.
Thx Before
Troy Lundin
See here for an SQL Server Express example (With port number):
http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html
You may need to configure SQL Server TCP/IP to allow access through the desired port.
Heres a link to valid connection strings :
http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp