Attempting to create SQLite DB and using Appconfig.xml [Answered]

53 Replies
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
This thing It should return a number. The number is the amount of actions performed; It should return 1
Monsieur Wholesome
Does it though?
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
its return type should be int, not void
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
instead of questioning me, what about you simply hover over it and check it out
Monsieur Wholesome
Correction: It's "rows affected"
Monsieur Wholesome
Also, have you tried first opening the connection and then creating a command? Hmm
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
The code is literally at the beginning of your program, run it and enlighten us
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
https://github.com/codingdamnitdan/CodingTracker/blob/master/CodingTracker/DatabaseAndTables.cs#L24 Instead of not storing what it returns, save it in a variable, so do int result = tableCmd.ExecuteNonQuery();
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
in first instance, sus
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
oo, you even have ssms opened lovely yes
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
if you take the same command you have there and you simply paste it into ssms; Does it work?
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
Youre using sql though, not sqlite? oh nvm damn
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
Does the sqlite file exist? From your program
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
the db file that your connection string is pointing at As far as I understood it, the method is supposed to create it, right?
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
That's what I understand from "CreateDatabase"... that is creates the database
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
There is a method called SQLiteConnection.CreateFile() Use it Actually, that might not be from this nuget https://stackoverflow.com/a/46084676 Now that is hilarious https://stackoverflow.com/a/64620743 Hmmm, i see
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
okay, so check what value connectionString has
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
Fookin xml all its fault
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
Try this
Monsieur Wholesome
Yeah
Monsieur Wholesome
Stack Overflow
What is App.config in C#.NET? How to use it?
I have done a project in C#.NET where my database file is an Excel workbook. Since the location of the connection string is hard coded in my coding, there is no problem for installing it in my syst...
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
heh
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
What's the config
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Monsieur Wholesome
sigh, I give up xml should die off already
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord3y ago
✅ This post has been marked as answered!

Did you find this page helpful?