1. Thomas Rolseth
  2. SnapObjects
  3. Monday, 29 July 2019

I am getting an error when exporting a datawindow using the C# Model Generator to a snapdevelop web api.  When I open the C# Model Generation window I am asked to select/setup a database connection profile which I am able to do.  The test connection option works fine.  At the final stage when I select the project and datawindow folder, I get an error saying that the database connection was not saved correctly.

This was for a SQL Server database.  It worked fine when using Oracle for another snapdevelop api project.  Any thoughts and/or suggestions on how best to resolve this error?  Attached are two images showing the successful test connection and the error.

Thanks, Tom

Attachments (2)
Thomas Rolseth Accepted Answer Pending Moderation
0
Votes
Undo

I created 2 new api's (one basic and one with .NET datastore) from scratch using SnapDevelop and can export a datawindow now to either using the C# Model Generator.  I guess it was an anomaly with the first api I created.  Thanks for all the responses and feedback.

Tom

Comment
There are no comments made yet.
  1. Friday, 2 August 2019
  2. SnapObjects
  3. # 1
Ricardo Jasso Accepted Answer Pending Moderation
0
Votes
Undo

Does the C# project already exists? Can you try creating a new C# project from scratch inside a user folder like My Documents where you are sure you have read/write permisions, before generating the C# model? If you stil are getting the same error message after trying to generate the C# model can you look at the appsettings.json file to verify that the connection string has not been inserted at all?

Comment
There are no comments made yet.
  1. Thursday, 1 August 2019
  2. SnapObjects
  3. # 2
Thomas Rolseth Accepted Answer Pending Moderation
0
Votes
Undo

So does this mean there is a bug in PB or SnapDevelop?  Are there any workarounds?  Per a suggestion on this thread, I tried doing this after starting PB as administrator and I moved the api solution out of the inetpub\wwwroot folder to another location on my C drive so that permissions would not be an issue.  However, I am still getting the same error.

Thanks, Tom

Comment
I'm not sure whether there is a bug in PB or SnapDevelop. The easiest way I can imagine to reproduce the issue is to change the appsettings.json file to read-only, but it doesn't seem to be the reason for this case.



Have you ever tried to create a new C# project, then use PB - C# Model Generator to export models to it and see there is any issue?



You can also create a new C# project, then create a DataContext using the same connection, then check whether the connection string is added to the appsettings.json file.



If the error still exists, I suggest that you open a support ticket and upload your PB, C# sample project, and an empty database.



Regards,

Logan
  1. Logan Liu
  2. Wednesday, 31 July 2019
There are no comments made yet.
  1. Tuesday, 30 July 2019
  2. SnapObjects
  3. # 3
Thomas Rolseth Accepted Answer Pending Moderation
0
Votes
Undo

Thanks for your suggestions.  Tried both but no luck.

Comment
There are no comments made yet.
  1. Tuesday, 30 July 2019
  2. SnapObjects
  3. # 4
Logan Liu Accepted Answer Pending Moderation
0
Votes
Undo

Hi Thomas,

This error occurs when it fails to save connection string to appsettings.json.

And I have reported this issue to Appeon because I think this error message is not clear enough.

 

Regards,

Logan

Comment
There are no comments made yet.
  1. Tuesday, 30 July 2019
  2. SnapObjects
  3. # 5
Ricardo Jasso Accepted Answer Pending Moderation
0
Votes
Undo

It could be that SnapDevelop does not have permissions to write to C:\inetpub\wwwroot\EMANAGER_API\...

Try placing the project inside your Documents folder and generating the model again.

Or running PB as an administrator.

Regards,

Ricardo

 

Comment
There are no comments made yet.
  1. Monday, 29 July 2019
  2. SnapObjects
  3. # 6
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Thanks Thomas;

  That version of SS is supported by SnapObjects.

Regards ... Chris

Comment
There are no comments made yet.
  1. Monday, 29 July 2019
  2. SnapObjects
  3. # 7
Thomas Rolseth Accepted Answer Pending Moderation
0
Votes
Undo

Version 14

Attachments (1)
Comment
There are no comments made yet.
  1. Monday, 29 July 2019
  2. SnapObjects
  3. # 8
Thomas Rolseth Accepted Answer Pending Moderation
0
Votes
Undo

I am using SQL Server Express build 17.9.1 -- see attached.

Attachments (1)
Comment
That's the version of SQL Server Management Studio, not of the SQL Server engine. You can get the SQL Server engine version by running "select @@version" on a query window.
  1. Ricardo Jasso
  2. Monday, 29 July 2019
There are no comments made yet.
  1. Monday, 29 July 2019
  2. SnapObjects
  3. # 9
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Thomas;

   What version of SS are you trying to use?

Regards ... Chris

Comment
There are no comments made yet.
  1. Monday, 29 July 2019
  2. SnapObjects
  3. # 10
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.