SCOPE_IDENTITY Exception









up vote
1
down vote

favorite












I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception




no such function SCOPE_IDENTITY




Table class



public class User

public int Id get; set;
public string Name get; set;
public int Age get; set;



Simplest piece of code to test



static void Main( string args )

SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();

var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();



As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY exception.



Any assistance would be greatly appreciated










share|improve this question









New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
    – marc_s
    Nov 10 at 12:05











  • Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
    – hypothesys
    Nov 10 at 12:20














up vote
1
down vote

favorite












I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception




no such function SCOPE_IDENTITY




Table class



public class User

public int Id get; set;
public string Name get; set;
public int Age get; set;



Simplest piece of code to test



static void Main( string args )

SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();

var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();



As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY exception.



Any assistance would be greatly appreciated










share|improve this question









New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
    – marc_s
    Nov 10 at 12:05











  • Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
    – hypothesys
    Nov 10 at 12:20












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception




no such function SCOPE_IDENTITY




Table class



public class User

public int Id get; set;
public string Name get; set;
public int Age get; set;



Simplest piece of code to test



static void Main( string args )

SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();

var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();



As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY exception.



Any assistance would be greatly appreciated










share|improve this question









New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception




no such function SCOPE_IDENTITY




Table class



public class User

public int Id get; set;
public string Name get; set;
public int Age get; set;



Simplest piece of code to test



static void Main( string args )

SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();

var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();



As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY exception.



Any assistance would be greatly appreciated







dapper-simplecrud






share|improve this question









New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 10 at 12:05









marc_s

564k12510891242




564k12510891242






New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 10 at 11:48









hypothesys

61




61




New contributor




hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






hypothesys is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
    – marc_s
    Nov 10 at 12:05











  • Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
    – hypothesys
    Nov 10 at 12:20
















  • SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
    – marc_s
    Nov 10 at 12:05











  • Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
    – hypothesys
    Nov 10 at 12:20















SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
– marc_s
Nov 10 at 12:05





SCOPE_IDENTITY is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
– marc_s
Nov 10 at 12:05













Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20




Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20












1 Answer
1






active

oldest

votes

















up vote
1
down vote













Judging from the Github page, it seems the current release has dropped support for SQLite:




Database support



There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);




Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).






share|improve this answer




















  • Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
    – hypothesys
    Nov 10 at 12:32











  • Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
    – hypothesys
    Nov 10 at 12:49










  • @hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
    – marc_s
    Nov 10 at 12:54











  • I do now! Brilliant, problem solved. Thanks again.
    – hypothesys
    Nov 10 at 13:10










  • @hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
    – marc_s
    Nov 10 at 13:41










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






hypothesys is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238627%2fscope-identity-exception%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













Judging from the Github page, it seems the current release has dropped support for SQLite:




Database support



There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);




Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).






share|improve this answer




















  • Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
    – hypothesys
    Nov 10 at 12:32











  • Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
    – hypothesys
    Nov 10 at 12:49










  • @hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
    – marc_s
    Nov 10 at 12:54











  • I do now! Brilliant, problem solved. Thanks again.
    – hypothesys
    Nov 10 at 13:10










  • @hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
    – marc_s
    Nov 10 at 13:41














up vote
1
down vote













Judging from the Github page, it seems the current release has dropped support for SQLite:




Database support



There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);




Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).






share|improve this answer




















  • Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
    – hypothesys
    Nov 10 at 12:32











  • Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
    – hypothesys
    Nov 10 at 12:49










  • @hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
    – marc_s
    Nov 10 at 12:54











  • I do now! Brilliant, problem solved. Thanks again.
    – hypothesys
    Nov 10 at 13:10










  • @hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
    – marc_s
    Nov 10 at 13:41












up vote
1
down vote










up vote
1
down vote









Judging from the Github page, it seems the current release has dropped support for SQLite:




Database support



There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);




Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).






share|improve this answer












Judging from the Github page, it seems the current release has dropped support for SQLite:




Database support



There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);



SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);




Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 12:26









marc_s

564k12510891242




564k12510891242











  • Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
    – hypothesys
    Nov 10 at 12:32











  • Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
    – hypothesys
    Nov 10 at 12:49










  • @hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
    – marc_s
    Nov 10 at 12:54











  • I do now! Brilliant, problem solved. Thanks again.
    – hypothesys
    Nov 10 at 13:10










  • @hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
    – marc_s
    Nov 10 at 13:41
















  • Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
    – hypothesys
    Nov 10 at 12:32











  • Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
    – hypothesys
    Nov 10 at 12:49










  • @hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
    – marc_s
    Nov 10 at 12:54











  • I do now! Brilliant, problem solved. Thanks again.
    – hypothesys
    Nov 10 at 13:10










  • @hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
    – marc_s
    Nov 10 at 13:41















Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32





Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32













Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49




Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49












@hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
– marc_s
Nov 10 at 12:54





@hypothesys: ok, so the support is back in there - and are you calling SimpleCRUD.SetDialect(Dialect.SQLite) somewhere in your code?
– marc_s
Nov 10 at 12:54













I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10




I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10












@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41




@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41










hypothesys is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















hypothesys is a new contributor. Be nice, and check out our Code of Conduct.












hypothesys is a new contributor. Be nice, and check out our Code of Conduct.











hypothesys is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238627%2fscope-identity-exception%23new-answer', 'question_page');

);

Post as a guest














































































Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党