1. Thomas Rolseth
  2. SnapObjects
  3. Monday, 29 July 2019 15:03 PM UTC

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)
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 29 July 2019 17:41 PM UTC
  2. SnapObjects
  3. # 1

Hi Thomas;

   What version of SS are you trying to use?

Regards ... Chris

Comment
There are no comments made yet.
Thomas Rolseth Accepted Answer Pending Moderation
  1. Monday, 29 July 2019 18:31 PM UTC
  2. SnapObjects
  3. # 2

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

Attachments (1)
Comment
  1. Ricardo Jasso
  2. Monday, 29 July 2019 18:39 PM UTC
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. Helpful
There are no comments made yet.
Thomas Rolseth Accepted Answer Pending Moderation
  1. Monday, 29 July 2019 18:44 PM UTC
  2. SnapObjects
  3. # 3

Version 14

Attachments (1)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 29 July 2019 20:35 PM UTC
  2. SnapObjects
  3. # 4

Thanks Thomas;

  That version of SS is supported by SnapObjects.

Regards ... Chris

Comment
There are no comments made yet.
Ricardo Jasso Accepted Answer Pending Moderation
  1. Monday, 29 July 2019 21:58 PM UTC
  2. SnapObjects
  3. # 5

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.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 30 July 2019 03:46 AM UTC
  2. SnapObjects
  3. # 6

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.
Thomas Rolseth Accepted Answer Pending Moderation
  1. Tuesday, 30 July 2019 18:16 PM UTC
  2. SnapObjects
  3. # 7

Thanks for your suggestions.  Tried both but no luck.

Comment
There are no comments made yet.
Thomas Rolseth Accepted Answer Pending Moderation
  1. Tuesday, 30 July 2019 18:19 PM UTC
  2. SnapObjects
  3. # 8

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
  1. Logan Liu @Appeon
  2. Wednesday, 31 July 2019 05:38 AM UTC
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. Helpful
There are no comments made yet.
Ricardo Jasso Accepted Answer Pending Moderation
  1. Thursday, 1 August 2019 22:16 PM UTC
  2. SnapObjects
  3. # 9

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.
Thomas Rolseth Accepted Answer Pending Moderation
  1. Friday, 2 August 2019 14:53 PM UTC
  2. SnapObjects
  3. # 10

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.
  • Page :
  • 1


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