Re: Opening a SQLExpress database (Desktop) from PocketPC




DOH !!!!! ..port...port...port ....cannot use computer name unless it's in
the hosts registry
(this app will do it in a friendly manner:
http://www.freewareppc.com/utilities/pockethosts.shtml )
but you also have to check SQLExpress configuration manager to find what
port it's running under
so for me \\MyServerName\SQLEXPRESS ...was using port 1137 ....maybe it's
better to set
a static port? ...sooooo..changing my connection string to "(@"Data
Source=192.168.1.2,1137;Initial....)
works :) ....question now is.... in the registry, hosts are stored at
HKLM\Comm\tcpip ...but is there a way to store
port as well ? ....if using the Hosts app i still have to specify the
port..... ie. "(@"Data Source=MyServerName,1137;Initial...)"
will work, but "(@"Data Source=MyServerName\SQLEXPRESS;Initial...)" will not
work .....thanks

"Arrow" <arrow201@xxxxxxxxxxx> wrote in message
news:dn70ul$a23$1@xxxxxxxxxxxxxxxxxxxxx
> WM5 / VS2005
>
> i can't even get a basic connection to my SQLExpress...!?!?
>
> environment:
> - SQL Server Express running on a Windows 2000 server (ip is 192.168.1.2),
> have TCP, Named Pipes, etc enabled
> - using XP Pro desktop and can communicate to SQL Express via SQL Server
> Management Studio Express with no problems
> (
> http://www.microsoft.com/downloads/details.aspx?FamilyId=82AFBD59-57A4-455E-A2D6-1D4C98D40F6E&displaylang=en )
>
> ...at this point i would think my network setup to Express is ok
>
> On my WM5 device (WiFi ip: 192.168.1.10), using C#, System.Data.SqlClient
>
> SqlConnection Conn = new SqlConnection(@
> "Data Source=\\MyServerName\SQLEXPRESS;Initial
> Catalog=MyTestDb;Integrated Security=false;User
> ID=sa;Password=MyPassword");
>
> Conn.Open();
>
> ...but my connection fails ??? emulator (i added "guest" accn't to SQL")
> and actual device fails ...i've tried using the ip instead,
> ie. "Data Source=192.168.1.2\SQLEXPRESS;..." included "\\" at the
> beginning, taking them out....not adding the "SQLEXPRESS"
> part...double checked the id/password ....everything i try fails~~~~~
> ...as mentioned i can access and look at "MyTestDb" tables
> from my XP client box with no probs .....any ideas ? ..thanks
>
>
> "Darren Shaffer" <darrenshaffer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:eIta6Cf%23FHA.360@xxxxxxxxxxxxxxxxxxxxxxx
>> Paul,
>>
>> When you specify the AttachDBFileName in the Compact Framework
>> ADO.NET Provider, you must specify the Database keyword as well
>> (example - "Database=PaulsDB")
>>
>> The User Instance connection string keyword is not used with the
>> CF ADO.NET provider.
>>
>> A few things will get you in trouble with SQL Express. By default,
>> after install, it has ALL of it's connection protocols disabled. You
>> have
>> to manually go in and set the surface area configuration to allow remote
>> connections and specify the type of connection (TCP, Named Pipes, etc)
>>
>> Also make sure the Windows Guest account is enabled on your SQL Express
>> instance if you are trying to connect from the emulator.
>>
>> You should also verify that your mobile device or emulator can resolve
>> the server name or it's IP address to verify you have a valid network
>> path
>> to the server hosting SQL Express.
>>
>> Finally, please do not post the same question to more than one newsgroup.
>>
>> Either the Compact Framework or SQL CE newsgroup is the appropriate one
>> for this question.
>>
>> --
>> Darren Shaffer
>> .NET Compact Framework MVP
>> Principal Architect
>> Connected Innovation
>> www.connectedinnovation.com
>>
>>
>> "Paul Aspinall" <paul@xxxxxxxxxx> wrote in message
>> news:Ol3lf.140666$Es4.75738@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Hi
>>> Can anyone point me in the right direction....
>>> I'm trying to open a SQL Express 2005 DB, from my PocketPC, so that I
>>> can write some code to synchronize the data.
>>>
>>> Does anyone have any code to show this being done??
>>>
>>> I'm using System.Data.SqlClient but from the PocketPC.
>>>
>>> Any help appreciated.
>>>
>>> Thanks
>>>
>>> I'm trying:
>>>
>>> SqlConnection Conn = new SqlConnection(@"Data
>>> Source=\\desktopmachinename\SQLEXPRESS;AttachDbFilename=C:\dataname.mdf;Integrated
>>> Security=True;User Instance=True");
>>>
>>> SqlCommand CMD = new SqlCommand("nameofstoredprocedure", Conn);
>>>
>>> CMD.CommandType = CommandType.StoredProcedure;
>>>
>>> Conn.Open();
>>>
>>> SqlDataReader dr = CMD.ExecuteReader();
>>>
>>> dataGrid1.DataSource = dr;
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: advice about a worm intrusion alert
    ... Port 1434 is the SQL Browser service used for locating SQL Servers. ... connectivity - and I had no internet access on the wireless XP machine. ... Still no connection. ...
    (microsoft.public.sqlserver.security)
  • Re: Cannot connect to SQL express database ????
    ... Frist of all I forgot to open the port 1500 in my windows firewall. ... normally with SQL server. ... This connection string using sytax ... have made many connection like that with SQL server ...
    (microsoft.public.sqlserver.connect)
  • RE: TightVNC "Failed to connect to server" issue
    ... When you set up the Server on your PC, you had to specify a port, possibly ... This port wil need to be opened on your router. ... uncheck the box for query console on incoming connection. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: connect to named instance w/ non-default port
    ... As Sylvain stated it might be using a different protocol and tcp may not be enabled on that server. ... You can use the existing connections event in profiler to see what the connection settings are for each connection or try the activity monitor. ... Andrew J. Kelly SQL MVP ... it sounds like there is no need to specify the port number in the connection string. ...
    (microsoft.public.sqlserver.connect)
  • Re: Passive mode FTP under Solaris 10?
    ... I've come to understand that I need to specify a range of high ports ... There seems to be alternate ftp server software that's easy to ... When any control connection matching ... Allows control of the TCP port numbers which may be used ...
    (comp.unix.solaris)