Showing posts with label mobile. Show all posts
Showing posts with label mobile. Show all posts

Friday, March 30, 2012

Problem with SqlCeRemoteDataAccess.Pull() in Pocket PC 2003 application

hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks
hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks

|||

It is vital that you can access the SQL CE agent URL from IE on your device. Try using the IP address of your PC instead of host name. Also, change your connection string to:

"Data Source=\\Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

Try connecting with SQL security instead of integrated security, to see if this is the issue.

Also, there may be problems related to Vista and integrated security, see this:

http://blogs.msdn.com/stevelasker/archive/2007/06/16/using-rda-with-integrated-authentication.aspx

|||

Thanks for the quick reply

I have now managed to access SQL CE agent URL from emulator's IE. (it was my windows firewall blocking incoming requests)

but the problem is still the same I still get the same error even after changing the connection string as you suggested

OK i gotta admit that I am fairly new to this whole thing and dont really know how to connect with sql security (could you specify a bit for me please)

i m reading the blog now, see if there is anything I am missing still out

Cheers

|||

still stuck

tried the idea in the blog too Smile

need more help|||

You must specify a provider in your Remote connection string like this;

Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

see http://www.connectionstrings.com/?carrier=sqlserver for more samples.

|||tried that too
still no avail

when it executes the pull(), in the output it says

A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

any clues?

Problem with SqlCeRemoteDataAccess.Pull() in Pocket PC 2003 application

hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks
hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks

|||

It is vital that you can access the SQL CE agent URL from IE on your device. Try using the IP address of your PC instead of host name. Also, change your connection string to:

"Data Source=\\Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

Try connecting with SQL security instead of integrated security, to see if this is the issue.

Also, there may be problems related to Vista and integrated security, see this:

http://blogs.msdn.com/stevelasker/archive/2007/06/16/using-rda-with-integrated-authentication.aspx

|||

Thanks for the quick reply

I have now managed to access SQL CE agent URL from emulator's IE. (it was my windows firewall blocking incoming requests)

but the problem is still the same I still get the same error even after changing the connection string as you suggested

OK i gotta admit that I am fairly new to this whole thing and dont really know how to connect with sql security (could you specify a bit for me please)

i m reading the blog now, see if there is anything I am missing still out

Cheers

|||

still stuck

tried the idea in the blog too Smile

need more help|||

You must specify a provider in your Remote connection string like this;

Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

see http://www.connectionstrings.com/?carrier=sqlserver for more samples.

|||tried that too
still no avail

when it executes the pull(), in the output it says

A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

any clues?

Problem with SqlCeRemoteDataAccess Pull

hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks
hi
I am trying to make a Pocket PC 2003 application which will pull data from a SQL Server 2005 database and store in Mobile database. and Push the table from mobile databse to SQL server 2005 database

I also have a desktop application up and running with SQL server database in which I can enter records to the SQL server 2005 database

I get error when I trigger SqlCeRemoteDataAccess.Pull() method, which says "sql mobile encountered problems when opening the database", (its native error 28559)

when user access the database as anoymous they'll log in as my account
I am working on Windows Vista and have IIS and SQL Server 2005 running on the same machine same machine alongside Visual Studio SP1 for vista
I've also got Windows Mobile Device Centre installed with Virtual PC 2007 Installer which means when I cradle the emulator the Windows Mobile Device Centre detects and connects it and I can internet on that.
but I can't access http://IDVISTA/SQLCE/sqlcesa30.dll (HostURL in the code) in Pocket PC 2003 emulator's Internet explorer (not sure if it counts)

below is my code

Code Snippet

private String LocalConString = "Data Source=Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

private String RemoteConString = "Data Source=IDVISTA;Initial Catalog=Dairy;Integrated Security=SSPI;";


private String HostURL = "http://IDVISTA/SQLCE/sqlcesa30.dll";




public void Pull()
{

// Create a remote data access object

SqlCeRemoteDataAccess RDA = new SqlCeRemoteDataAccess(HostURL, "", "", LocalConString);

try
{
RDA.Pull("Appointments", "SELECT * FROM Appointments ", RemoteConString, RdaTrackOption.TrackingOff, "ErrorPullingAppointments");
}
catch (SqlCeException sqle)
{
for (int i = 0; i < sqle.Errors.Count; i++)
MessageBox.Show(sqle.Errors[i].NativeError.ToString() + "\n" +
sqle.Errors[i].Source);
}
finally
{
RDA.Dispose();

}





Any help will be much appreciated
Thanks

|||

It is vital that you can access the SQL CE agent URL from IE on your device. Try using the IP address of your PC instead of host name. Also, change your connection string to:

"Data Source=\\Program Files\\PDADairy\\Database\\diary.sdf;Persist Security Info=False;";

Try connecting with SQL security instead of integrated security, to see if this is the issue.

Also, there may be problems related to Vista and integrated security, see this:

http://blogs.msdn.com/stevelasker/archive/2007/06/16/using-rda-with-integrated-authentication.aspx

|||

Thanks for the quick reply

I have now managed to access SQL CE agent URL from emulator's IE. (it was my windows firewall blocking incoming requests)

but the problem is still the same I still get the same error even after changing the connection string as you suggested

OK i gotta admit that I am fairly new to this whole thing and dont really know how to connect with sql security (could you specify a bit for me please)

i m reading the blog now, see if there is anything I am missing still out

Cheers

|||

still stuck

tried the idea in the blog too Smile

need more help|||

You must specify a provider in your Remote connection string like this;

Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

see http://www.connectionstrings.com/?carrier=sqlserver for more samples.

|||tried that too
still no avail

when it executes the pull(), in the output it says

A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

any clues?

Monday, March 12, 2012

problem with saving data to SQL Server Mobile ?

Hi everybody there

i have a small problem with this code, it cann't save changes on Datatable to the database SQL Server Mobile ..

the execution work succesfully but without changes in the database !

here is the code, please try to help :

Code Snippet

#Region " << Declarations >> "

Dim objCon As New SqlCeConnection("Data source=\Storage Card\Full_Database.sdf")
Dim objDA As SqlCeDataAdapter
Dim objCmdBldr As SqlCeCommandBuilder
Dim objTB As New DataTable("MyTB")
Dim objBS As New BindingSource

#End Region

Private Sub frmDatabase_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

objDA = New SqlCeDataAdapter("Select * From MyTB", objCon)
objDA.MissingSchemaAction = MissingSchemaAction.AddWithKey

objTB.Clear()

objDA.Fill(objTB)
objBS.DataSource = objTB

End Sub

' Add New Record for example
Private Sub mnuAddNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAddNew.Click

If Not CType(objBS.Current, DataRowView).IsNew Then
objBS.AddNew()

Dim dRowView As DataRowView = objBS.Current
dRowView.BeginEdit()

dRowView("id") = 10
dRowView("name") = "Someone"

dRowView.EndEdit()
End If

' Calling Save Methode
mnuSave_Click(sender, e)

End Sub

' Save Values
Private Sub mnuSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSave.Click

objBS.EndEdit()
objCmdBldr = New SqlCeCommandBuilder(objDA)
objDA.Update(objTB)

End Sub


UP .|||

See this.

By the way, there's search up and right. Works great - try it with "save changes", for example…

problem with saving data to SQL Server Mobile ?

Hi everybody there

i have a small problem with this code, it cann't save changes on Datatable to the database SQL Server Mobile ..

the execution work succesfully but without changes in the database !

here is the code, please try to help :

Code Snippet

#Region " << Declarations >> "

Dim objCon As New SqlCeConnection("Data source=\Storage Card\Full_Database.sdf")
Dim objDA As SqlCeDataAdapter
Dim objCmdBldr As SqlCeCommandBuilder
Dim objTB As New DataTable("MyTB")
Dim objBS As New BindingSource

#End Region

Private Sub frmDatabase_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

objDA = New SqlCeDataAdapter("Select * From MyTB", objCon)
objDA.MissingSchemaAction = MissingSchemaAction.AddWithKey

objTB.Clear()

objDA.Fill(objTB)
objBS.DataSource = objTB

End Sub

' Add New Record for example
Private Sub mnuAddNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAddNew.Click

If Not CType(objBS.Current, DataRowView).IsNew Then
objBS.AddNew()

Dim dRowView As DataRowView = objBS.Current
dRowView.BeginEdit()

dRowView("id") = 10
dRowView("name") = "Someone"

dRowView.EndEdit()
End If

' Calling Save Methode
mnuSave_Click(sender, e)

End Sub

' Save Values
Private Sub mnuSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSave.Click

objBS.EndEdit()
objCmdBldr = New SqlCeCommandBuilder(objDA)
objDA.Update(objTB)

End Sub


UP .|||

See this.

By the way, there's search up and right. Works great - try it with "save changes", for example…

Wednesday, March 7, 2012

Problem with RDA Pull method

Hi,
I am developing a mobile application for Pocket PC and using Pocket PC 2003
Emulator. I am using RDA to pull the data information on the mobile device.
When I use "EXEC sp_MyStoredProcedure {Parameters}" the RDA Pull function
works fine and creates table on the local sql ce database as long as the SP
DOES NOT use hash tables. The problem is that if SP called uses a Hash Table
then rda.pull() does not give me any error but it does not create a table on
local sql ce database.
RDA.PULL WORKS for sp_MyStoredProcedure having code like:
CREATE PROCURE sp_MyStoredProcedure
AS
BEGIN
Select * from tblUser
END
RDA.PULL DOES NOT WORK for sp_MyStoredProcedure having code like:
CREATE PROCURE sp_MyStoredProcedure
AS
BEGIN
Create Table #Users( Name varchar(100), UserID varchar(15), Password
varchar(20))
Insert into #User
Select * from tblUser Where blah blah..
Select * from #Users
END
I certainly need to get this SP with hash table work with RDA pull method.
Any help will be greatly appreciated.
Regards
~Sanjeev
post this question to microsoft.public.sqlserver.ce
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Sanjeev Yamdagni" <sanjeev@.thomaskelly.com> wrote in message
news:OELq$GVQFHA.2932@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I am developing a mobile application for Pocket PC and using Pocket PC
2003
> Emulator. I am using RDA to pull the data information on the mobile
device.
> When I use "EXEC sp_MyStoredProcedure {Parameters}" the RDA Pull function
> works fine and creates table on the local sql ce database as long as the
SP
> DOES NOT use hash tables. The problem is that if SP called uses a Hash
Table
> then rda.pull() does not give me any error but it does not create a table
on
> local sql ce database.
> RDA.PULL WORKS for sp_MyStoredProcedure having code like:
> CREATE PROCURE sp_MyStoredProcedure
> AS
> BEGIN
> Select * from tblUser
> END
>
> RDA.PULL DOES NOT WORK for sp_MyStoredProcedure having code like:
> CREATE PROCURE sp_MyStoredProcedure
> AS
> BEGIN
> Create Table #Users( Name varchar(100), UserID varchar(15), Password
> varchar(20))
> Insert into #User
> Select * from tblUser Where blah blah..
> Select * from #Users
> END
>
> I certainly need to get this SP with hash table work with RDA pull method.
> Any help will be greatly appreciated.
> Regards
> ~Sanjeev
>
>
>