|
-
Jun 20th, 2010, 07:16 AM
#1
Thread Starter
New Member
mobile application cannot see remote sql server
Hello all,
I am sorry for bothering you with my probably low level question.
I would like to develop a very very very simple application which will connects the MS SQL SERVER in my notebook and will be run at hand terminal-with windows mobile 6.
Here is the code which i used :
Dim strSQL As [String] = "SELECT COUNT(studentid) AS totalp from Students where gender='m' "
' Dim Conn As New SqlConnection("Data Source=10.0.0.4\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA") <<< i used this too,
' Dim Conn As New SqlConnection("Data Source=10.0.0.4:1433\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;") <<< and also tried this
Dim conn As New SqlConnection("Data Source=MUSTAFA\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;")
Conn.Open() <<<<<<<<< crashes here with this error : "Specified SQL server not found : MUSTAFA\MUSTAFASQL2"
Dim cmd As New SqlCommand(strSQL, Conn)
Dim musreader As SqlDataReader = cmd.ExecuteReader
While musreader.Read
total.Text = musreader.Item("totalp").ToString
End While
Conn.Close()
on button click.
Some details :
Device : Windows Mobile 6.1 classic
Local : SqlExpress and i can reach from many computers, i mean there is no problem accessing remotely to my SQL Server.
Please help me, all helps are appreciated. Thanks a lot.
Please let me know if you need to know more details for help...
-
Jun 21st, 2010, 01:12 AM
#2
Thread Starter
New Member
Re: mobile application cannot see remote sql server
here is the error code i received on conn.open()
---------------------------------------------------------
at System.Data.SqlClient.SqlConnection.OnError()
at System.Data.SqlClient.SqlInternalConnection.OnError()
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Connect()
at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
at System.Data.SqlClient.SqlInternalConnection..ctor()
at System.Data.SqlClient.SqlConnection.Open()
at MobilgSTS1.Form1.Form1_Load()
at System.Windows.Forms.Form.OnLoad()
at System.Windows.Forms.Form._SetVisibleNotify()
at System.Windows.Forms.Control.set_Visible()
at System.Windows.Forms.Application.Run()
at MobilgSTS1.Form1.Main()
---------------------------------------------------------
-
Jun 21st, 2010, 02:11 AM
#3
Frenzied Member
Re: mobile application cannot see remote sql server
Hi,
search the forum - there was a big discussion on this, and how to connect to SQL Express.
Should be something like:-
Dim Ccon As New SqlConnection("Persist Security Info=False;Integrated Security=False;Server=10.0.0.4;initial catalog=MYDBX_Data;user id=TEACHERA;password=mypassword;")
Pete
-
Jun 21st, 2010, 02:57 AM
#4
Thread Starter
New Member
Re: mobile application cannot see remote sql server
it failed with this connectionstring!  
You are right! I'd betta if i search forum.
Thanks a lot
-
Jun 21st, 2010, 12:10 PM
#5
Frenzied Member
Re: mobile application cannot see remote sql server
Can you ping your server from your device?
-
Jun 21st, 2010, 12:14 PM
#6
Re: mobile application cannot see remote sql server
Does your mobile device support wireless? I don't mean 3G wireless... I mean, does it have WiFi? If it does... then it needs to be connected to the network in order to run. Otherwise...it just isn't going to work.
That's why, as the error tells you: "Specified SQL server not found : MUSTAFA\MUSTAFASQL2" because, to your device, it doesn't exist.
-tg
-
Jun 22nd, 2010, 01:03 AM
#7
Thread Starter
New Member
-
Jun 22nd, 2010, 05:30 AM
#8
Frenzied Member
Re: mobile application cannot see remote sql server
Is it SqlServer or Sql Express?
Is there an 'instance'?
The line below is taken from a working config file, connecting to SQL Express on port 1334
Persist Security Info=False;Integrated Security=False;Server=Till1\SqlExpress,1334;initial catalog=Waiter_BlackBull;user id=sa;password=elcastillo;
HTH
-
Jun 24th, 2010, 12:56 AM
#9
Thread Starter
New Member
Re: mobile application cannot see remote sql server
Yes, there is an instance, it's sql express and i tried your last connectionstring as well. But it still fails!!!
But i found an information but dont know exactly what it means :
- You have to install MS Loopback Adapter and you must give an IP to the emulator as well.
Do you know how to configure/setup Loopback adapter??
Thank you
-
Jun 24th, 2010, 06:38 AM
#10
Re: mobile application cannot see remote sql server
Wait.... is the problem ocurring when you run the app in the emulator? Or on the actual device itself?
-tg
-
Jun 24th, 2010, 06:53 AM
#11
Frenzied Member
Re: mobile application cannot see remote sql server
 Originally Posted by techgnome
Wait.... is the problem ocurring when you run the app in the emulator? Or on the actual device itself?
-tg
Same question from me
Even in the emulator - you don't need a loopback
Here is a thread on the whole subject - http://www.vbforums.com/showthread.p...ght=SQLExpress
from http://netcf2.blogspot.com/2005/12/a...ress-from.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|