Using SQLite in C# - Building Simple, Powerful, Portable Databases for Your Application

Поделиться
HTML-код
  • Опубликовано: 21 июл 2024
  • Have you ever wanted to store data for an application but didn't want to deal with the hassle of a full database server? Or maybe you wanted to have one database per installation. Those and many other scenarios are a perfect fit for SQLite. Today I am going to show you how to get started using SQLite in C#. We will build a small database, attach it to a C# project, and then wire up our project to read from and write to the database.
    SQLite From Start to Finish course (now renamed to Bill Time): www.iamtimcorey.com/salespage...
    Source Code: leadmagnets.app/?Resource=SQL...
    Patreon: / iamtimcorey
    Newsletter signup: signup.iamtimcorey.com/
    Thanks to Ralfs HBK for the chapter breakdown:
    0:00 - Intro
    1:14 - Demo app overview (win form app)
    4:30 - What is SQLite
    5:09 - How to create and build SQLite Database: DB Browser for SQLite
    11:17 - Database Structure
    13:04 - Adding the Database to the project
    15:26 - Adding the Connection string
    18:15 - SQLite and Dapper NUGet packages
    21:58 - Data access setup
    28:17 - Retrieving data form DB: LoadPeople()
    30:14 - Sending data to DB: SavePerson()
    31:51 - Wiring up the Demo app
    33:08 - Workings with the Database
    36:18 - Summary and concluding remarks

Комментарии • 784

  • @gerrycallaghan5519
    @gerrycallaghan5519 5 лет назад +2

    Tim's courses are by far the most clear and concise I've done. Having the code to download to play with is so useful. A great resource.

  • @MichaelMyersDoverPA
    @MichaelMyersDoverPA 3 года назад +4

    Thank you for a great, direct and useful tutorial for SQLite in C#. I am new to SQLite and this video was a real example of a quality presentation with real-world scenarios of using C# with a file-based database system in a contained environment. Well done, sir.

  • @ManieVerster
    @ManieVerster 4 месяца назад +1

    Hi Tim, you know the saying you cannot teach an old dog new tricks? Well, you busted that one. You taught this old dog a new trick and it's just marvellous. Thanks man!!!!

    • @IAmTimCorey
      @IAmTimCorey  4 месяца назад

      Awesome! I’m glad it was helpful.

  • @maciejk125
    @maciejk125 5 лет назад +1

    I had to learn a bit of java lately, forcing me to watch some different tutorials, and let me say this, you have achieved your goal. You do make learning c# easier.

  • @ZajoSTi
    @ZajoSTi 6 лет назад +1

    Glad to see you have pulled through. And thank you for another great video.

  • @nopelganger
    @nopelganger 4 года назад +1

    This is an incredible tutorial, even if it just covering the very basics.
    i gotta admit, in itself SQLite is quite a powerful tool.
    Thanks a lot, Tim!

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      You are most welcome. Thanks for watching.

  • @tanu3873
    @tanu3873 6 лет назад +2

    Great video! I'm happy you're back!

  • @katerose6161
    @katerose6161 3 года назад +2

    Love you, Tim!!! I cannot describe how happy I am to find this tutorial :DDD Thank you endlessly !

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      Be sure to check out the whole channel - ruclips.net/channel/UC-ptWR16ITQyYOglXyQmpzw. Use the search icon under the Subscribe button to search within the channel to find the training you need next.

  • @janne_kekalainen
    @janne_kekalainen 5 лет назад +2

    Your channel is a gold mine. Super awesome content.

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      I appreciate the kind words.

  • @djchaseful
    @djchaseful 2 года назад +3

    Tim Corey, Thanks! I can't express how much I have learned from your videos.

    • @IAmTimCorey
      @IAmTimCorey  2 года назад

      I’m glad my content has been so helpful.

  • @MikePageDev
    @MikePageDev 6 лет назад +1

    This is the video I have been waiting for. Thanks Tim. I have a number of projects I get me teeth in to now.

    • @IAmTimCorey
      @IAmTimCorey  6 лет назад

      Excellent!

    • @MikePageDev
      @MikePageDev 6 лет назад

      Just need to decide witch one to start with lol

  • @samjaouhar7246
    @samjaouhar7246 3 года назад +1

    thanks, Tim for all the videos and effort your providing. you are a legend, you are the best teacher ever. definitely, I will have a course with you one day.

  • @manukartofanu
    @manukartofanu 3 года назад +3

    Thank you for a great introduction to SQLite!

  • @GiorgiBekurashvili
    @GiorgiBekurashvili 6 месяцев назад +2

    Your tutorials are so clear and straight to the point! ❤

    • @IAmTimCorey
      @IAmTimCorey  6 месяцев назад

      I am glad they are helpful.

  • @harag9
    @harag9 6 лет назад

    Nice tutorial Tim, looking forward to the full course.

  • @n9434178
    @n9434178 6 лет назад

    Great video - looking forward to doing the full course

  • @alcidesneto6415
    @alcidesneto6415 3 года назад +1

    I am going to use this tutorial in some personal tools! Thanks a lot, Tim!

  • @heinrichwurstwatten7553
    @heinrichwurstwatten7553 6 лет назад

    YES, I have been waiting for this!

  • @acidhauss7018
    @acidhauss7018 5 лет назад +9

    By far and away the best C# material on youtube, thanks for all your help.

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      You are most welcome. Thanks for watching.

  • @nishan375
    @nishan375 3 года назад

    Thanks. I am definitely buying your start to finish course.

  • @grampygamer8584
    @grampygamer8584 5 лет назад +1

    Superb tutorial yet again! you never fail buddy :)

  • @ptsg
    @ptsg 4 года назад

    Extremely clear explanation, great job!

  • @ghostcode829
    @ghostcode829 5 лет назад +1

    Thank you so much for this! You're an absolute lifesaver!

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      You are most welcome. Thanks for watching.

  • @afterbunny257
    @afterbunny257 4 года назад +7

    17:26 Relative connection string
    19:11 - 21:50 Dependent packages
    26:00 Get connection string in library project
    29:47 Query list of PersonModel from db
    31:50 Write a person to db

    • @IAmTimCorey
      @IAmTimCorey  4 года назад +2

      I added it to the description. Thanks so much.

    • @afterbunny257
      @afterbunny257 4 года назад

      @@IAmTimCorey Can you set up a pay method for AliPay? I believe there are many Chinese subscriber like me who what to enroll your course. Most chinese don't use credit cards.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      Unfortunately, I don't have the ability to do that. Teachable (my host) only provides Stripe and PayPal.

  • @RalfsBalodis
    @RalfsBalodis 3 года назад +8

    0:00 - Intro
    1:14 - Demo app overview (win form app)
    4:30 - What is SQLite
    5:09 - How to create and build SQLite Database: DB Browser for SQLite
    11:17 - Database Structure
    13:04 - Adding the Database to the project
    15:26 - Adding the Connection string
    18:15 - SQLite and Dapper NUGet packages
    21:58 - Data access setup
    28:17 - Retrieving data form DB: LoadPeople()
    30:14 - Sending data to DB: SavePerson()
    31:51 - Wiring up the Demo app
    33:08 - Workings with the Database
    36:18 - Summary and concluding remarks

  • @vanttildet3069
    @vanttildet3069 3 года назад +1

    Thanks for the great course and general sharing knowledge

  • @anshul1212
    @anshul1212 Год назад +1

    Boss ...you are just brilliant ......wooww...every topic explained very clearly.....u know what is missing in daily soap and u just bang on fish eye.....

  • @HopInTheCloud
    @HopInTheCloud 3 года назад

    Very good video. Exactly what I was looking for and the video already answered a lot of my questions.

  • @captainslowmtb7409
    @captainslowmtb7409 4 года назад +1

    Thank you so much for this video Tim, I've been looking for a basic video like this for a good few days, the whole SQL localdb vs SQL Express vs SQLite was just far too confusing when I knew SQLite was what I needed, I just couldn't find a video to show a simple connection (ignore me (apart from the thanks bit) as these might just be words from a rambling programming student).

  • @vanishdoma2675
    @vanishdoma2675 Год назад +1

    Thank you. it is what i was looking for!

  • @user-dw3xm5tb7r
    @user-dw3xm5tb7r 3 года назад

    when you use the var.Query(query , dynamicParameters);
    how does that save the data from the database? like if i have a person class with firstName field and i have a table with a firstName column, how does the Query... know to save the data in each column to the specific field needed in the object?

  • @khandakarrashedhassan8193
    @khandakarrashedhassan8193 3 года назад +2

    I just needed this. Thanks for the video. There are a lot of resources out there but they are just messy.

  • @MrCensorMe
    @MrCensorMe 4 года назад

    Thanks a lot for the video and explanation man, was easy to understand and extremely helpful.

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      You are most welcome. Thanks for watching.

  • @markcediegabinete2647
    @markcediegabinete2647 5 лет назад +1

    Thanks for this tutorial Tim

  • @michabarbarski7362
    @michabarbarski7362 9 месяцев назад +1

    Thank you for the excellent guide, you are a great teacher

  • @hansbyager5795
    @hansbyager5795 3 года назад +1

    i love the intro, iit explains EXACTLY what I am looking for, so in watching this, I went, yes... yees.. YES!!!

  • @fouadchelfi2590
    @fouadchelfi2590 2 года назад +1

    Thank you very much! very useful course.

  • @Jfarro
    @Jfarro 3 года назад

    Tim - "Its not too much to ask a person to give me a first and last name". Maddona- "Am I a Joke to you?! Do I not get to play in your database?" :P J/k, this is amazing and I'm subscribing just because of how well laid out this is. I needed something to explain c# and sql lite but didn't want a 3 hour course, and I needed some basics on the sql lite part as well. You did a great job with this!

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      I'm glad it was helpful. And yes, people will always have an exception to the rule, which makes creating any type of validation hard.

  • @balthaaa
    @balthaaa 4 года назад

    Great video tutorial! Thanks for that!

  • @williambell4591
    @williambell4591 4 года назад +1

    I love the simplicity if SQLite, especially with WPF development.
    I’m writing an app now that will allow the user to password protect specific records.
    For the average user, they won’t know how to open the .Db file, but I can’t help but ask, HOW can I encrypt the SQLite database?
    I’ve seen mentioned SQLite Cipher, but is that the best way to go when working w/WPF applications?
    Any suggestions are definitely appreciated!
    I also feel SQLite encryption would make a great follow up video to your other training on SQLite!
    Thanks!

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      It is just password protection (which is probably all you need) but have you tried this: stackoverflow.com/a/17855620/733798

  • @kitsunesuzuka1029
    @kitsunesuzuka1029 7 месяцев назад

    Hello Corey! I found your implementation of Sqlite a little bit different but interesting appoarch and I would like to know how this PersonalModel works and it's functions. I am a real noobie when it comes to this Models and I would like to ask if you have any videos about it and how it works because I can't seem to see any related videos of you regarding it. Thank you!

  • @mohamedazzouz6086
    @mohamedazzouz6086 4 месяца назад +1

    Hello Corey, Thank you for the excellent tutorial

  • @ajvenable7937
    @ajvenable7937 4 года назад

    Thanks for the video Tim

  • @samh4770
    @samh4770 3 года назад

    Is there a good way using this setup, that I could pass a network location that the user enters in the UI, into the Sqlite connection as the data source... instead of using the db file created by the app. So rather than a new database being written for each app... if multiples of this app were on the same network, they could both browse to the same db file location?

  • @nsreality2781
    @nsreality2781 5 лет назад

    super work Tim Corey

  • @DanFlakes
    @DanFlakes 3 года назад

    Thanks for informative video, Tim!

  • @djmj12714
    @djmj12714 2 года назад +1

    Thank you so much for posting this! New subscriber here!!

  • @user-uo4iu1co6c
    @user-uo4iu1co6c Год назад

    Waw, this is the best explaining. It's incredible

  • @sc0tty319
    @sc0tty319 4 года назад +1

    great tutorial!
    샘 짱이에요 :) 쉽게 잘 가르쳐주시네요 from s.korea

  • @edthetech
    @edthetech 4 года назад

    Awesome Tutorial. Thanks!

  • @Scarvarg
    @Scarvarg Год назад

    Hello Tim, I am a big fan, thank you for your content! I have a question related to this tutorial. When I build my application, open it using the .exe file and add some data (in RELEASE mode), all CRUD operations works fine. Once I make a change in the program, and I click on the RELEASE -> Build Solution, the database always gets wiped out and I have to start from scrach. It works fine on the DEBUG mode, keeps the data intact, I can rebuild it as much as I want and it will still be there, but once switched to RELEASE mode and the program gets re-built, I end up with a blank DB (all tables and columns are there but the data is gone). I have set Build Action -> "Content" and Copy to Output Directory -> "Copy if newer". Could you help me out please?

  • @kopilkaiser8991
    @kopilkaiser8991 Год назад +1

    It is a very good tutorial to learn to connect a database for quick use for your application

  • @bobbybooballin3218
    @bobbybooballin3218 5 лет назад

    Hi Tim!
    Great video that helped me kickstart my project. Thanks!
    I have issues regarding foreign keys that I would like to implement in my database, specifically with "on delete cascade". I have included "PRAGMA foreign_keys=true" in my connection string, but deleting a row in my "master" table does not result in its "children" being deleted. (Unless i delete the row by using DB Browser). Any hot tips would be highly appriciated.

  • @zerosandones7547
    @zerosandones7547 3 года назад

    Do I need to change my localdb's (service-based database or .mdf) "Copy to output directory" (@14:08) to "copy if newer"? Because by default it is Copy always, or is copy if newer only set for sqlite database?

  • @MdAbdullahAlFahim
    @MdAbdullahAlFahim 3 года назад

    Hey Tim! Your channel is the go to resource for my C# learning. Thanks!
    In VS2019, what template type should I select to create the DemoLibrary Project? By template I mean, when I try to create the project, I have to choose one of these (e.g., Console App, or Class Library, or WPF App, .......).

  • @robsonkinoshita6342
    @robsonkinoshita6342 4 года назад

    Thanks man! Helped me alot.

  • @jaskaransingh-ez4vf
    @jaskaransingh-ez4vf 3 года назад

    Hi Corey,
    Can you please share your thoughts on encrypting sqlite db?
    What may be the best and cheapest way to encrypt sqlite db?
    Thanks!

  • @gerrycallaghan5519
    @gerrycallaghan5519 5 лет назад

    Excellent video. Thank you

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      You are most welcome. Thanks for watching.

  • @sayna3
    @sayna3 2 года назад

    This helped me a lot, thank you

  • @trustingod0
    @trustingod0 Год назад +1

    Hello Tim Corey. I was wondering if you could please explain why the Database file that we created and saved to the WinFormUI project folder is not written to, but instead another Db file is created in the WinFormUI\bin\Debug directory that is written to? Also, if you have a link to some literature that explains why the Db in the Debug directory is used that would be helpful too. Thanks !!!

    • @IAmTimCorey
      @IAmTimCorey  Год назад +3

      The connection string tells the application where the database is. Since the connection string did not specify a path, it assumes a relative path (relative to the executable running the command that uses the connection string). That's why we have to copy the database into the debug folder. Also, by using a copy of the database instead of the one we include with our project, we won't have sample data in the database we give to customers (unless we want it in there).

  • @lucianiordache3229
    @lucianiordache3229 Год назад

    Hi, great video, watched till the end!
    What would you suggest as the optimal way of inserting a dataset in a SQLite datatable, since we cannot use table valued parameters?

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      Just loop through it, doing an insert per row. It feels inefficient, but it is actually not.

  • @UnknownMoses
    @UnknownMoses 4 месяца назад +2

    I know this is sort of outside the scope but, If you want to distribute your application with some tables containing data, I prefer using EmbeddedResource as the compile action and using that to create the db file if it doesn't exist at the specified path. This allows you control when the database file is copied/written. I feel like this offers more control over the database file on deployment when users execute the program. You can offer the user features such and restarting from scratch you can disconnect from the database, delete the db file and replace it with the embedded resource version of the database. Like for example if the database somehow got corrupted.

  • @janostrowski8932
    @janostrowski8932 Год назад +1

    Hi, first of all, thanks for your work.
    Am working on project and I need to ask like how would you edit the first or last name without deleting and creating new a record in your project.

    • @IAmTimCorey
      @IAmTimCorey  Год назад +2

      You mean like running an update statement? Like: update TableName set FirstName='Tim", LastName='Corey' where id=1

  • @belmiris1371
    @belmiris1371 4 года назад +1

    Thank you for the video! Just FYI, in WinForms you would want to use a Binding List, not an observable collection.

  • @rbfreitas
    @rbfreitas 3 года назад

    Thanks a lot for this video. Quite explanatory!!!

  • @jurgenbartalis1933
    @jurgenbartalis1933 3 года назад

    High quality like all your trainings! One question: which reporting tool can you recommend for c# and sqlite?

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      Get that one a lot. Exploring options so stay tuned.

  • @TheDaveStream
    @TheDaveStream 4 года назад

    Interesting video and certainly a lot of help but I have a couple of questions.
    For reference im working on a game server adapting open source code to tailor the game to how myself and a friend want it...started off as a hobby to keep sanity while in lockdown, but found im enjoying coding it and seeing what can be done.
    I want to be able to store 4 different things to a players characters and not 100% sure about how to go about retrieving and saving them.
    In the video you had it load at the start (or when you click refresh) and save as each entry was made, is that the best way to do dynamicaly changing values? load them into the players object when they connect and save the changed values to the database when they disconnect.... or is it better/possible to save them to the Db when they change (still reading them from stored values in the player object that will be updated at the same time) ?
    the values I want to store also lead me to another question: each player will have up to 20 professions and each profession has the following values:
    a boolean (i can use INT 1 or 0 for true false)
    A byte (int again..)
    A long (int? heres an issue how do you save a long thats over the 2 billion limit of int?)
    and my final question
    each player also needs a list of waypoints stored:
    containing,
    map name (string)map id (int) coords (Point...though essentially two ints, x and y)
    but is it even possible to save a list to a table in sql? those 4 data sets suggest this is not the database i am looking for...but then Blob...i dont know what Blob is lol
    Despite the fact im still searching around and looking into sql so may find the answer, I figured why not ask an expert lol. Sorry if these are really simple questions, I am only a hobby coder so its possible I am asking something dumb

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      Yes, you could read the data into a class object like I did in this video. Then use that object to update the values as you go. At the end (or whenever they update the data - whichever you choose), you could take this object and use it to save the data back to the database.
      If you needed to exceed the storage capacity of an integer, you would probably need to use the text type.
      If you want to save a set of data for a person, you would want to save that set in a different table and link it to the primary table by id.

  • @glendamabasa6423
    @glendamabasa6423 3 года назад

    You AMAZING Tim. Thank you

  • @huskypsycho7833
    @huskypsycho7833 5 лет назад

    Hello, loved the vid. I although have a question about my situation.
    I want to create an Windows Forms app in which the user can look for book titles/publishers/shelf number from book entities that are in an SQLite database. The application should be "portable" meaning it should all work between any computer with a single executable. Unlike your example where you just added entities, i want to manually add all the book titles along with publisher and shelf number (which shelf they are at)and have them stored in the database and the user should be able to search/delete/edit and add more to the db. For example if they search for shelf 4 to have all books on that shelf shown etc. What is the best way to go about this?
    Thank you

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      All that is possible. The idea of a single executable is fine as long as you know that the config file and any DLL files will also come with the executable (as will the database).

  • @ZeffTheKiller1994
    @ZeffTheKiller1994 3 года назад

    Thank you very much Tim.

  • @StudentCompanion
    @StudentCompanion 3 года назад

    What are the advantages of using SQLite over SQL localDB? I guess they are all file based database and with sql localdb you could easily migrate to a full SQL very easily by just changing a connection string I believe. Why would one prefer SQLite over localdb?
    Thanks

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      SQLite is designed to be portable with just a dll and the database file.

  •  6 лет назад

    Thank you very much Tim!

  • @jiminaaa1993
    @jiminaaa1993 4 года назад +1

    Thank you so much sir.... Nice and easy tutorial.

  • @ordishysa6305
    @ordishysa6305 6 лет назад

    A very comprehensive method Tim

  • @NotAHomelessGamer
    @NotAHomelessGamer 11 месяцев назад +1

    At 15:30 you go over communications with the database using App.config, but these references are no longer used in Net 6.0. What would you recommend people following along with your video at this point? Do you have another video that is similar to this but more up to date?

    • @IAmTimCorey
      @IAmTimCorey  11 месяцев назад +3

      You would use appsettings.json instead, but beyond that, there isn't much change in the code. Here is a video on appsettings: ruclips.net/video/_2_qksdQKCE/видео.html

  • @mariuszstruzyk8770
    @mariuszstruzyk8770 6 лет назад

    Hello Tim, I'm happy you're back ! I got a question, are you planning on doing a NHibernate 4+ course/tutorial?

    • @IAmTimCorey
      @IAmTimCorey  6 лет назад

      Probably not. It isn't something I use.

  • @ramazancatar2898
    @ramazancatar2898 2 года назад

    Hi i'm tryna make web app like exactly google drive (login with user and pass and download, upload, delete "any kind of media files") for my school project , i can't find helpful video except this but this isn't enough (has to be c#) . Any recommend ?

  • @henriklarsen7219
    @henriklarsen7219 Год назад

    Thanks for the video. I can't figure out where the Dapper is been used. So I actually think it is not needed for this example. Is this correct?

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      The Query and Execute methods are from Dapper. Query gets the data from SQLite and maps it to an IEnumerable for us. If we didn't have that, we would have to use ADO.NET and get a DataTable back that we would then have to manually map to models and carefully cast the data to the correct types. Execute goes the opposite direction. It takes our parameters in whatever type we give it and correctly builds the SQL command with SQL parameters in order to help prevent SQL injection. So yes, we definitely need Dapper here. Otherwise, we need to write a LOT of extra code.

  • @alexn4217
    @alexn4217 3 года назад

    Great course, Tim. I am a new subscriber and I have been learning more from your tutorials than I have on other learning platforms. I encountered an interesting issue with Dapper while coding your demo. It turns out that Dapper isn't a big fan of interfaces so when I tried to be "smart" and created a list of IPersonModel objects, the insert failed. I had to switch my type back to the actual type.

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      Yep, because Dapper is going to use an actual type to do work. It cannot take an interface because it doesn't know which type to use to do the actual work.

  • @deborahconde4634
    @deborahconde4634 3 года назад +2

    Tim Corey you saved my ass, love you

  • @connecting1409
    @connecting1409 3 года назад +1

    Hi Tim, i have a question. What is the purpose of the DemoLibrary project? Is that needed or can i have my models and NUGet packages in the UI project?

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      It keeps a separation between your business logic and data access from your user interface. Putting everything in your UI locks you in by tightly coupling your application together. By using a class library, we can disconnect this and make it easier to upgrade parts of our application without upgrading the entire thing.

  • @VANTYCSolutions
    @VANTYCSolutions 3 года назад

    Super video thanks!

  • @josbexerr5166
    @josbexerr5166 5 лет назад

    Gracias excelente Mister Tim.....

  • @gregorchard1629
    @gregorchard1629 3 года назад

    Tim, I found this video incredibly useful. I am just getting started on a project where I plan to use Blazor and SQLite, which are both new to me. However, I am struggling trying to get the "LastInsertRowId" after using SQLiteConnection() and executing an Insert in the way you describe in this video. The data is getting inserted into the table but I get the exeception "System.InvalidOperationException: Database connection not valid for getting last insert rowid" when I try to access cnn.LastInsertRowId. What needs to be done to get this to work?

    • @gregorchard1629
      @gregorchard1629 3 года назад

      It turns out that LastInsertRowId cannot be used aster using the SQLiteConnection() the way it is used in this video. Instead I had to use CreateConnection(), then set the connection string before opening the connection.

  • @suatsuphi
    @suatsuphi Год назад

    hi Tim, I need help about that how to compile sqlite with ICU. I cant search unicode character by lowercase or uppercase. so I have to get all data ram by AsEnumerable. Is there any other method for this? How to compile sqlite with ICU. Can you explain it by video

  • @sooryaprakash8984
    @sooryaprakash8984 4 года назад

    Tim, I agree the way of teaching is amazing with slow pace and injecting in viewers mind slowly and nicely.
    But at time confusing may be because of the method you took up about SQL connections and accessing.
    In fact I saw better methods in the net without confusion.
    Thanks any way...

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      Well, if you know an easier way of doing it for you, that's great!

    • @sooryaprakash8984
      @sooryaprakash8984 4 года назад

      Pls. don't mind Tim.
      Again and again I say your way of teaching is ultimate. That was the only video confusing a bit, rest all the best.

  • @Malikz29
    @Malikz29 5 лет назад +1

    Thanks for the useful videos.. One useful suggestion is please zoom to the text in focus to reduce strain in eyes especially for mobile phone user

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      I do what I can but trying to scale it for mobile is almost impossible.

  • @horse2water195
    @horse2water195 4 года назад

    IAmTimCorey, did you find a way around having to add a reference to System.Data.SQLite in the assembly consuming your library?

    • @IAmTimCorey
      @IAmTimCorey  4 года назад

      Nope, that is still the thing to do.

  • @gregfrllo
    @gregfrllo 5 лет назад

    Hi Tim, if i have 2 table that need to fetch data, do i have to write 2 queries for each model?
    Or can i write 1 query and just replace the table name and model with variable?

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      You could do a replacement of the query table name but I would be REALLY careful. That can introduce injection vulnerabilities if you don't do it right.

  • @zunaidhossain872
    @zunaidhossain872 2 года назад

    Great, Thank you so much.

  • @LuigiZambetti
    @LuigiZambetti 5 лет назад

    Hi Tim, could you make a video on using Sqlite and Dapper for reading an XML file and copy the elements content on a Sqlite table (or Oracle table)? (or give me some hints for this task).

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад +1

      Reading/writing XML is on the list. Not sure when I'll get to it since it isn't a huge need, but it is something a few people have asked for. The more that ask, the more important it becomes.

  • @fooballers7883
    @fooballers7883 10 месяцев назад +1

    Thank you for excellent tutorial....deeply appreciated.

  • @aresagathos2075
    @aresagathos2075 3 года назад

    The reason you need to reference the sql lib also in WinFormUI, is a visual studio bug, that sticks around.
    I usually use typeof on a class from sqlcore lib in the DemoLibrary, so visual studio see's you actually using it, and doesn't get rid of the .dll, and it doesn't need to be referenced in the WinFormUI.

  • @summerbreeze25syria
    @summerbreeze25syria 3 года назад

    Thank you for the video.

    • @IAmTimCorey
      @IAmTimCorey  3 года назад

      You are welcome.

    • @fredericklowe568
      @fredericklowe568 3 года назад

      Great video. But I have a problem with sqllite. It does not handle storage to well. What I mean is that once a data is deleted. It does not use that space again. So the database can get bloated with empty space.

  • @ketankatdare2102
    @ketankatdare2102 5 лет назад

    Awesome video first of all. What are your opinion for using sqlite if application generating say 1Gb data per year. Will it perform well.

    • @IAmTimCorey
      @IAmTimCorey  5 лет назад

      It depends. If that means 1GB of data and then you start over, SQLite is probably a good fit. If it is cumulative, you might want to think through your options. SQLite can contain terabytes of data but remember that it is one file. Trying to manage that file on disk could be an issue if you use this for years. It would probably be fine, but make sure you don't store it on a Fat32-formatted disk (max size would be 4GB, I believe, although I have heard that 2GB is the true max in some circumstances) and make sure your backup strategy can handle a large file. Honestly, even a 10GB file isn't horrible to deal with so you should be fine.

  • @PiratesK1999
    @PiratesK1999 Год назад

    Hey Tim, thank you for the video, I gave password to my connections string but I keep facing this error.
    System.Data.SQLite.SQLiteException: 'file is not a database
    file is not a database'
    it's Okay if I remove the password section from connection string, Idk if I need to use that password somewhere or something else. I appreciate if you help me with this

  • @eahofer
    @eahofer 3 года назад

    In adapting this to another table, I get the following error on the cnn.Query execution step: "A parameterless default constructor or one matching signature" followed by the fields in the table in db. I've checked the object, and all the field names match up.
    I have ensured that there is a constructor for the object that matches the signature exactly to what is shown in the error message.

    • @eahofer
      @eahofer 3 года назад

      Determined the issue; from SQLite, there are only bare bones types - and for int's it's Int64 while my contstructor was just int. I should not have assumed there would be an implicit casting.

    • @IAmTimCorey
      @IAmTimCorey  3 года назад +1

      Thank you for sharing this experience and the solution. I know it will help others

  • @trustingod0
    @trustingod0 8 месяцев назад

    Great Video Mr. Corey. I just have a quick question. My listbox loads with items worded demolibrary. personmodel, not sure why thats happening when I used .ToList on my returned output or maybe this issue involves a setting on the listbox not sure. Thanks !

    • @trustingod0
      @trustingod0 8 месяцев назад

      Nevermind. I realized I had commented out my display member line listPeopleListBox.DisplayMember = "FullName";

    • @IAmTimCorey
      @IAmTimCorey  8 месяцев назад +1

      I am glad you figured it out.

  • @tarik8834
    @tarik8834 2 года назад

    I'm getting the exception " System.Exception: 'Keyword not supported: 'version'. '"
    I checked everything in my stringConnections and everything is ok.
    Anyone has idea what could it be?

  • @iamjosedev
    @iamjosedev 2 года назад

    when I copy the files to another folder and proceed to execute the .exe it is ok, but when I do an insert or update it shows me the following message: Error "attempt to write a readonly database"
    Please help me, I want to make portable programs.