SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error in C# with connectionString CosmosDB


Error in C# with connectionString CosmosDB

Author
Message
GG_BI_GG
GG_BI_GG
SSC Eights!
SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)

Group: General Forum Members
Points: 910 Visits: 289
Hi Guys,

I have the following error:
System.Data.dll
Additional information: Keyword not supported: 'mongodb://mycosmosdb:brVmi46RA7azECQro3m2sirrywJAzLdmpxiq6xKr4MK9iFsJdjFpQnX5UfttiGU1lPZg62AE1zo6Amhg==@mycosmosdb.documents.azure.com:10255/database?ssl'.


I see that my var have the full connection string: mongodb://mycosmosdb:jFpQnX5UfttiGU1lPZg62AE1zo6Amhg==@mycosmosdb.documents.azure.com:10255/database?ssl=true

But if it passing to my SQLconnection it dont make it full :mongodb://mycosmosdb:jFpQnX5UfttiGU1lPZg62AE1zo6Amhg==@mycosmosdb.documents.azure.com:10255/database?ssl'.



I have follow this guideline:
https://docs.microsoft.com/en-us/azure/cosmos-db/connect-mongodb-account

stevenb 14609
stevenb 14609
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1175 Visits: 665
I notice in your screenshot that you're missing an equals sign in the middle of your connection string. I'm assuming it's an encrypted string, and probably is not able to be decrypted correctly. Does the connection work if you don't assign the string from the app.config file? I know C# has to escape some sequences in strings sometimes, and I wonder if this could be the problem here. You can also use an @ to indicate a string literal so that the string doesn't need to be escaped. But obviously this doesn't help much if you're trying to get it through your config file.
GG_BI_GG
GG_BI_GG
SSC Eights!
SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)

Group: General Forum Members
Points: 910 Visits: 289
stevenb 14609 - Tuesday, June 27, 2017 2:03 PM
I notice in your screenshot that you're missing an equals sign in the middle of your connection string. I'm assuming it's an encrypted string, and probably is not able to be decrypted correctly. Does the connection work if you don't assign the string from the app.config file? I know C# has to escape some sequences in strings sometimes, and I wonder if this could be the problem here. You can also use an @ to indicate a string literal so that the string doesn't need to be escaped. But obviously this doesn't help much if you're trying to get it through your config file.


I dont get the first thing about the equals sign... But i have try to do it without the app.config, but still the same problem.
GG_BI_GG
GG_BI_GG
SSC Eights!
SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)SSC Eights! (910 reputation)

Group: General Forum Members
Points: 910 Visits: 289
What i see at this point when i past the connectionstring getting the error:

System.Data.dll
Additional information: Keyword not supported: 'mongodb://mycosmosdb:brVmi46RA7azECQro3m2sirrywJAzLdmpxiq6xKr4MK9iFsJdjFpQnX5UfttiGU1lPZg62AE1zo6Amhg==@mycosmosdb.documents.azure.com:10255/database?ssl'.


When I do this without ssl=true I get the following error:


I know that the Azure COSMOSDB always needs SSL=True
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search