PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Mobile 5.0

Reply

Mobile 5.0

 
Thread Tools Rate Thread
Old 07-03-2006, 03:09 PM   #1
David de Passos
Guest
 
Posts: n/a
Default Mobile 5.0


Hi!

I have a Pocket PC aplicattion developed in VS 2003, I have converted in VS
2005 but I get a error.
So, I have create a new Pocket PC aplication from Vs 2005, with the same
code and I get the same error:
"SQL Server does not exist or access denied."
The program work well but when try myConnection.Open() I get the exception
error.

There is my code:

Imports System.Data.SqlClient

Module RCMobile

Dim myConnection As New SqlConnection

Dim ConnGestao As String

Sub Main()

Try

MsgBox("ola")

'ConnGestao = "Password=aaa;User ID=teste;database='" & BaseDados &
"';server='" & Servidor & "' ;Connect Timeout=10"

ConnGestao = "Persist Security Info=False;Integrated Security=False;server="
& Servidor & ";initial catalog=" & BaseDados & ";User ID=teste; Password =
aaa;Connect Timeout=10"

myConnection.ConnectionString = ConnGestao

myConnection.Open()

myConnection.Close()

Catch ex As SqlException

MsgBox(ex.Message & Err.Description)

Application.Exit()

End Try

End Sub

End Module



  Reply With Quote
Old 07-03-2006, 03:30 PM   #2
Ginny Caughey [MVP]
Guest
 
Posts: n/a
Default Re: Mobile 5.0

David,

It sounds like either your server IP address is not reachable or your userID
and password are incorrect for that server. You could also try removing the
Connect Timeout clause temporarily in case you are just timing out on the
connection. If you're using the name of the server and not the IP address,
try the IP address.

--
Ginny Caughey
..NET Compact Framework MVP


"David de Passos" <passos@rcsoft.pt> wrote in message
news:OrJxjkfQGHA.4536@TK2MSFTNGP10.phx.gbl...
> Hi!
>
> I have a Pocket PC aplicattion developed in VS 2003, I have converted in
> VS 2005 but I get a error.
> So, I have create a new Pocket PC aplication from Vs 2005, with the same
> code and I get the same error:
> "SQL Server does not exist or access denied."
> The program work well but when try myConnection.Open() I get the exception
> error.
>
> There is my code:
>
> Imports System.Data.SqlClient
>
> Module RCMobile
>
> Dim myConnection As New SqlConnection
>
> Dim ConnGestao As String
>
> Sub Main()
>
> Try
>
> MsgBox("ola")
>
> 'ConnGestao = "Password=aaa;User ID=teste;database='" & BaseDados &
> "';server='" & Servidor & "' ;Connect Timeout=10"
>
> ConnGestao = "Persist Security Info=False;Integrated
> Security=False;server=" & Servidor & ";initial catalog=" & BaseDados &
> ";User ID=teste; Password = aaa;Connect Timeout=10"
>
> myConnection.ConnectionString = ConnGestao
>
> myConnection.Open()
>
> myConnection.Close()
>
> Catch ex As SqlException
>
> MsgBox(ex.Message & Err.Description)
>
> Application.Exit()
>
> End Try
>
> End Sub
>
> End Module
>
>
>



  Reply With Quote
Old 07-03-2006, 04:11 PM   #3
David de Passos
Guest
 
Posts: n/a
Default Re: Mobile 5.0

No, the IP is correct.
That works in Visual Studio 2003

"Ginny Caughey [MVP]" <ginny.caughey.online@wasteworks.com> wrote in message
news:egKjQxfQGHA.5400@TK2MSFTNGP09.phx.gbl...
> David,
>
> It sounds like either your server IP address is not reachable or your
> userID and password are incorrect for that server. You could also try
> removing the Connect Timeout clause temporarily in case you are just
> timing out on the connection. If you're using the name of the server and
> not the IP address, try the IP address.
>
> --
> Ginny Caughey
> .NET Compact Framework MVP
>
>
> "David de Passos" <passos@rcsoft.pt> wrote in message
> news:OrJxjkfQGHA.4536@TK2MSFTNGP10.phx.gbl...
>> Hi!
>>
>> I have a Pocket PC aplicattion developed in VS 2003, I have converted in
>> VS 2005 but I get a error.
>> So, I have create a new Pocket PC aplication from Vs 2005, with the same
>> code and I get the same error:
>> "SQL Server does not exist or access denied."
>> The program work well but when try myConnection.Open() I get the
>> exception error.
>>
>> There is my code:
>>
>> Imports System.Data.SqlClient
>>
>> Module RCMobile
>>
>> Dim myConnection As New SqlConnection
>>
>> Dim ConnGestao As String
>>
>> Sub Main()
>>
>> Try
>>
>> MsgBox("ola")
>>
>> 'ConnGestao = "Password=aaa;User ID=teste;database='" & BaseDados &
>> "';server='" & Servidor & "' ;Connect Timeout=10"
>>
>> ConnGestao = "Persist Security Info=False;Integrated
>> Security=False;server=" & Servidor & ";initial catalog=" & BaseDados &
>> ";User ID=teste; Password = aaa;Connect Timeout=10"
>>
>> myConnection.ConnectionString = ConnGestao
>>
>> myConnection.Open()
>>
>> myConnection.Close()
>>
>> Catch ex As SqlException
>>
>> MsgBox(ex.Message & Err.Description)
>>
>> Application.Exit()
>>
>> End Try
>>
>> End Sub
>>
>> End Module
>>
>>
>>

>
>
>




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off