Showing posts with label framework. Show all posts
Showing posts with label framework. Show all posts

Monday, March 19, 2012

"SQL Server Mobile encountered problems when opening the database."

Hi,

I am writing an application for a device (HP IPAQ 6828) having Windows Mobile 5.0 using

-MS .NET Compact Framework 2.0 SP-1
-SQL Mobile 2005.
-VS 2005 .NET

The application uses Merge Replication. The error occurs in the Synchronise() Method of the SqlCeReplication object.

"SQL Server Mobile encountered problems when opening the database."

repl.AddSubscription(AddOption.ExistingDatabase)
repl.Synchronize()

I also checked the the connection string and it seems to be fine. Both my device and server can ping each other. Moreever I can also access the Web syncronization folder(on server) from the device.

Is anyone having a resolution for this?


This problem may be caused by many reasons.

The most common is not disposing the replication object or other data related objects. Make sure there isn't any other arround.
Sql Mobile 2005 allows multiple connections except while syncronizing.

Another known cause is a bad path on the connection string.

Other forum entries referring this problem:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=334604&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=478902&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=961633&SiteID=1|||

Hi,

I finally found the solution to this...

repl.AddSubscription(AddOption.ExistingDatabase)
repl.Synchronize()

(Note: I am trying to synchronize on an exisiting database)

The problem was since my database is already in use by my application and I am trying to sync the same DB. Synchronization cannot occur if the connection is already open by the application. Sql Mobile 2005 allows multiple connections except while synchronizing.

Therefore we need to close and dispose the open connection used by the application as under before attempting to synchonize.

(Below is the sample code)

private sub SampleSync()

sharedCon.close
sharedCon.dispose

try

' TO DO: Set replication object properties here

repl.AddSubscription(AddOption.ExistingDatabase)
repl.Synchronize()

finally
repl.dispose
end try

' TO DO: Open your shared connection here if required.

End sub

Note: Most of the times the connection string also causes a problem. A sample connection string would look like this...

repl.SubscriberConnectionString ="\Program Files\YourAppName\YourDb.sdf;Password =<...>"

Sunday, March 11, 2012

"No description found" when saving a package

Hi everyone,

Primary platform is Framework 2.0 and Sql25k 64-bit

When I try to save my DTSX package from my client to the production server I get this error:

"No Description found"

Either Windows or Sql authentication.

Does anyone have ever faced this drawback?

Thanks in advance,

Any idea?

Is something related to Visio 2003? http://support.microsoft.com/kb/922546

Thanks again,

Tuesday, March 6, 2012

"Encrypt" argument not supported in CF 2.0 Sqlconnection.ConnectionString

Is "Encrypt" not support in Compact Framework 2.0 SqlConnection string?

Trying to connect to sql2005 db using SSL from WM5/.net 2.0 pda and am receiving the below error. I can connect fine w/o the "encrypt" argument and the same connection string with "encrypt" connects fine from XP workstation to sql db w/SSL.

"Unknown connection option in connection string: encrypt."

Connection String I used:

sqlConnection = new SqlConnection("Data Source=mysqlserver;Initial Catalog=sometable;UID=username;PWD=Password;Encrypt=true;");

Thanks,

Jim

Hello everybody

I have the same problem. I'm using mobile PC with WinCE 4.2 on board. And I need the connection to be encrypted. How can I make this? The CF1.0/2.0 doesn't allow this feature. :(

Also I can use the VPN connection. But my device doesn't have this function (the function is present in disable mode). May be there is another application that realize VPN for WinCE 4.2?

Thank you.

Best regards,

Sergey

|||

This works in my code. I'm showing you the function that calls GetConnectionString so you'll see where the string is being passed.

Public Shared Function GetConnection(ByVal strDatabaseName As String) As SqlCeConnection

Dim cn As SqlCeConnection

cn = New SqlCeConnection(GetConnectionString(strDatabaseName))

Return cn

End Function

Public Shared Function GetConnectionString(ByVal strDatabaseName As String) As String

Return "Data Source=" & strDatabaseName & ";SSCE:Database Password=xxxxxxxx;SSCE:Encrypt Database=True"

End Function

|||

Why did you write the 'ssce' near connection string properties? Is it rule or something else?

Also, I need connect to the Sql Server on the host (not mobile sql server) and I use the SqlConnection class for it. Can I use such connection string? I didn't find the information in the msdn about its description.

Sorry, but I can't check your advise now and see the result, I'm away from my workstation. That is why I want to know more. And I'll check it latter.

|||

To Clearify - I'm trying to encrypt the sql connection to the host using, not to a local installation of SQL Mobile. I believe a couple of replies address encrypting data or the database of a local sql mobile db.

Jim

|||Sorry, I did not notice you were not using sqlce.|||This means that Encrypt is not supported in Compact Framework 2.0 SqlClient.SqlConnection|||

This code sample does not work on a WM 5 device with cf 2.0 but works ok if "Encrypt=true" is removed. Am I doing something wrong? Same code works fine on XP with .Net 2.0 when connecting to same ssl enabled sql server. How can I encrypt a sql connection from pda to sql server?

Thanks,

Jim

sqlConnection = new SqlConnection("Data Source=someSql2005Server;Initial Catalog=someSqlTable;"

+ "UID=myUsername;PWD=somePassword;Encrypt=true");

|||The compact framework is not the full .NET framework. Some features are disabled or just not implemented. If you get an error that the connection could not be established because of the encrypt feature not being available it's just not implemented!

Sunday, February 19, 2012

<Never mind, self-ansered> DMF - is it by design that database can't subscribe to Def

If by design, I can't really understand why we would not allow that...

[EDIT]

Answered this myself... BOL says:

Declarative Management Framework policy group
A user-defined group to help manage policies. Users can classify policies into different policy groups. A policy belongs to one and only one policy group. Database owners can subscribe a database to a set of policy groups. Only policies from its subscribed groups can govern a database. All databases implicitly subscribe to the default policy group.

There's a specific reason for this. The Policy Administrator may decide that all database on the system must adhere to a group of policies. To enable this these policies are placed int he default group. Furthermore, there may a group of policies that only apply to certain databases but the Policy Administrator doesn't "know" which database. Therefore, the Policy Adminsitrator can leave it up to the database owner to select which other groups (other than default) apply to their particular database. The database owner does this by subscribing to these other groups.

Cheers,
Dan

|||

Thanks.

FYI:

I will file a connect bug to request that any database shows subscribttion to Default group (Right-click a database -> Policies -> Group Subscriptions).

Of course, it should be impossible to unsubscribe.

This will visually represent that all databases are implicitly subscribe to Default policy and will remove any potential confusion (like I encountered initially.)

|||

Hi Alexey, We originally showed it and thought it was confusing. Looks like we were wrong...

So yes, please file the bug.

Cheers,

Dan

|||

Hm... If this is also found confusing, 2 middle-ground options:

Do show the default policy and change "Group Subscriptions:" wording of the dialog to "Group Subscriptions, including implicit subscription to Default policy:" Do not show the default policy, and add at the bottom (just above Ok/Cancel):
Note:all databases also implicitly subscribe to Default policy.|||

Hi Alexey,

Let's take this offline.

Thanks,

Dan

Monday, February 13, 2012

'OraOLEDB.Oracle.1' is not registered on local machine

Hi all of you,

Primary platform is Framework 2.0 running over XP.

I've got an issue with a SSIS package which uses Oracle Provider for OleDB:

Test connection failed because of an error in initializing provider 'OraOLEDB.Oracle.1' is not registered on local machine

Nevertheless, MS Ole DB Provider for Oracle works fine. Let me know where am I failing.

Thanks in advance,

Try reinstalling the Oracle client.|||

Thanks for your answer Phil.

I've got a question.. If I do such thing, my tnsnames.ora will be destroyed? 'suppose so

Anyway, I think that my problem is other one..

|||Copy your tnsnames.ora file to another name and then restore it when done. Which is something you should be doing anyway -- backing it up.

You can try just reinstalling the OLE provider: http://www.oracle.com/technology/software/tech/windows/ole_db/index.html|||

Hi Phil,

Thanks indeed. It works fine. I'm sorry for my scepticism.

|||

Hi Phil.

I am also having this problem, made sure that the ACL are read and execute for ASPNET, IUSR, IWAM users on the server. The app is .NET 2.0 by a vendor that is using the following connection string. names change to protect the innocent.

Provider=OraOLEDB.Oracle;Password=pass;User ID=user; Data Source=ds'/>

Unfortunately the vendor has no answers...

My question is that I have been told by my DBA that reinstalling doesn't always reinstall correctly as the registry entries still exists. Am I being told correctly? Also, If I reinstall, am I creating a new Oracle_Home that I would have set up in the OBDC administrator.

|||

n2magick wrote:

Hi Phil.

I am also having this problem, made sure that the ACL are read and execute for ASPNET, IUSR, IWAM users on the server. The app is .NET 2.0 by a vendor that is using the following connection string. names change to protect the innocent.

Provider=OraOLEDB.Oracle;Password=pass;User ID=user; Data Source=ds'/>

Unfortunately the vendor has no answers...

My question is that I have been told by my DBA that reinstalling doesn't always reinstall correctly as the registry entries still exists. Am I being told correctly? Also, If I reinstall, am I creating a new Oracle_Home that I would have set up in the OBDC administrator.

Right, but are you using SSIS? If not, I'm afraid I cannot help you... It seems that you have several layers that could be causing you issues.|||

Thanks Phil for answering my question. No I am not using SSIS. Just happen on the post doing a search trying to find the answer to my problem. Smile

Thanks again for your prompt answer.

LuAnn