Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
34a149e5
Commit
34a149e5
authored
Aug 09, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 SQLiteHelper.SQLiteDbContext 当表没有数据 FreeID 出错
parent
8e287a49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
SQLiteDbContext.cs
Project.SQLiteHelper/SQLiteHelper/SQLiteDbContext.cs
+4
-1
UnitTest1.cs
Project.SQLiteHelper/UnitTestProject1/UnitTest1.cs
+2
-0
No files found.
Project.SQLiteHelper/SQLiteHelper/SQLiteDbContext.cs
View file @
34a149e5
...
@@ -88,7 +88,10 @@ namespace SQLite
...
@@ -88,7 +88,10 @@ namespace SQLite
{
{
string
cmd
=
$"SELECT MAX(ID) FROM
{
tablename
}
"
;
string
cmd
=
$"SELECT MAX(ID) FROM
{
tablename
}
"
;
var
reponse
=
sqliteHelper
.
ExecuteScalar
(
cmd
);
var
reponse
=
sqliteHelper
.
ExecuteScalar
(
cmd
);
return
System
.
Convert
.
ToInt64
(
reponse
)
+
1
;
if
(
reponse
is
DBNull
)
return
0
;
else
return
System
.
Convert
.
ToInt64
(
reponse
)
+
1
;
}
}
...
...
Project.SQLiteHelper/UnitTestProject1/UnitTest1.cs
View file @
34a149e5
...
@@ -131,5 +131,7 @@ namespace UnitTestProject1
...
@@ -131,5 +131,7 @@ namespace UnitTestProject1
}
}
Assert
.
IsNull
(
ex
);
Assert
.
IsNull
(
ex
);
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment