Log in

View Full Version : Code Problems


Stig
07-26-2004, 09:33 AM
I am working on pulling data from a sql server database onto an emulated device and using sql ce. I will put the code below but what is happening is there an error about the connection i don't have the error on hand i will post it later but i have no ideas??

The one other is thing that i believe could be a problem is that i can't access my web server from the emulated pocket pc device(internet explorer) i'm not sure how i can set it up(currently looking on the net)

Code

Private strDBFile As String = "My Documents\delivery.sdf"

' The local connection string.
Private strConnLocal As String = "Data Source=My
Documents\delivery.sdf"

' The remote connection string.
Private strConnRemote As String = "Provider=sqloledb; Data
Source=FRANKIE\MIKESQLSERVER; " + _
"Initial Catalog=Deckle;Integrated Security=SSPI; "

' The URL
Private strURL As String
= "http://localhost/pdasqlce/sscesa20.dll"

Private Sub btnPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPull.Click


' Create a remote data access object
Dim rdaNW As New SqlServerCe.SqlCeRemoteDataAccess(strURL,
strConnLocal)
Try
' Have RDA:
' Create local tables named Categories and
' ErrorCategories.

' Connect to the remote server and submit the
' SELECT statement.
' Place the results in the local Categories table.
With rdaNW
.LocalConnectionString = strConnLocal
.InternetUrl = strURL
.InternetLogin = ""
.InternetPassword = ""
.Pull("Delivery", "Select * from Person",
strConnRemote, _
sqlServerCe.RdaTrackOption.TrackingOnWithIndexes.TrackingOnWithIndexe
s, "ErrorCategories")
End With
Catch exSQL As SqlServerCe.SqlCeException

MessageBox.Show(exSQL.Message.ToString)
'MsgBox(exSQL)
'HandleSQLException(exSQL)
Finally
rdaNW.Dispose()
End Try

End Sub


So please Any help with this code and how to set the device to access my ISS webserver.

paulzazzarino
07-30-2004, 12:48 PM
Ok

it's funny I will be doing the same thing, but lets take it a step at a time.
I just installed IIS and MSDE and the Frontpage extensions on a box with XP Pro.

What OS are you running on?

The first step is just connecting locally to IIS. I noticed that in my case I can attempt the loopback address from the same machine but it does not allow IE to connect. But it is trying long enough to convince me that IIS is running. So there must be a default password or ACL to resolve.

Once this is done then:
2) ping handheld from server
3) HTTP into server from handheld
4) Attach to Database locally (on server to server)
5) Attach to Database remotely

Stig
08-02-2004, 09:31 AM
I am running XP PRO with sql server 2000 service pack 3 i think with SQL CE installed on the emulator.

paulzazzarino i'm not sure about what you are saying in the first step can you please explain a bit better.

Steps
2) will try when get home
3) Taht works fine i setup the proxy server on the pda as the IP with the IIS etc and that works fine
4)no problem there have developed other things in VB.net ASP.net etc and that works
5)will try that later.

The error that it gives me is that it can't open because of incorrect database name but was checking last night and i can't find ay problems with the names of any of the databases.

paulzazzarino
08-02-2004, 11:42 AM
1) The first step is using Internet Explorer to connect to IIS. I noticed that either connecting via the loopback address i.e. 127.0.0.1 or the machines actuall IP address would pop up a user ID and password dialog. Oddly enough once I changed the default web page in inetpub/wwwroot I was able to connect with IE with the actual machine address and not the loopback address.

Also before setting the default web page the only way I could get in was by using the "initials of the session". IF your user logon is \\PKTB then by entering in http:\\PKTB you would get the WEB Page.

3) If you have LAN connection with your PDA you will not need a proxy server to get to your IIS session.

Stig
08-03-2004, 09:00 AM
I am using activesync to connect then because i have to code with an emulator because can't get hold of an actual device. So not sure how can create network connection using an emulator.

Stig
08-05-2004, 08:47 AM
The actual error that i am getting is as follows: Sql server CE encountered problems in opening the sql server CE database [,,,Database Name,,]

What will the comma's represent??? and what function will the comma's relate to because i think the place that the error comes up is where the pull function is run.
And i have checked and rechecked all the database names i have re created them.

Stig
08-10-2004, 09:25 AM
I have made progress some parts i think was just me being stupid but now i have come up with a new error. And i think this is due to my emulator setup.

It gives me an error with a Native error number of 28037 that means http send request failed see hresult for more info. "SSCE_M_HTTPSENDREQUESTFAILED".
The HResult error number is -2147012867
I have been looking in helps etc and have not been able to find a HResult error with that number.

Any Ideas

Stig
08-23-2004, 09:00 AM
That problem has seemed to pass now but the next error that i get is native error 28574 and it seems to be a sql server ce client agent error the hresult error nuber is 80004005 but i can't seem to translate it into a number that i can use to search for the error.

It says "Internal error occured (ID,,,,,)"

Does any one hav an idea how i can fix this problem??