Coffeehouse Thread

10 posts

Dumb SQL question, please help.

Back to Forum: Coffeehouse
  • User profile image
    magicalclick

    Hello, I have a dumb SQL C# question.

    I am able to add the server in my C# project, but, how do I write insert/delete/update queries in my C# code? Like what reference I should add? And what class and object I should use? Just the simple way, not the Entity Framework way.

    I am using SQL Compact because I don't want the user installing SQL servers. How do I do this? Thank you.

     

     

    BTW, SQLCE as storage limitation of 4GB? I actually need a lot more than that and I am using NTFS, so would the file size still limited? Thank you.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    kettch

    Using EF is probably the simplest way to get started without having to write a lot of data access code.

    Otherwise you should get started here

    It's not hard once you figure it out, but it's probably easier to get up to speed with basic CRUD by using EF.

  • User profile image
    magicalclick

    thanks man, I just found out a way using

    System.Data.SqlServerCe

    As long as I have this namespaces, I should be able to do stuff. I already can insert now. Thank you.

     

    BTW, SQLCE as storage limitation of 4GB? I actually need a lot more than that and I am using NTFS, so would the file size still limited? Thank you.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    JoshRoss

    @magicalclick: This could be a fun project. I have a SQLCE database that I use for my Windows Mobile application. Unfortunately the tooling really sucks, and I had to write most of my own CRUD.

    If you want to go the linq to sql route, try sqlMetal.

    -Josh

  • User profile image
    magicalclick

    For now, I would just use none linq way because this is more of acdemic stuff, which implementation would be too specific on what technology is used. But, thanks for all the help. I actually would want to invest in Linq down the road. I have read a bit of Linq before, but, samples always better.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    devSpeed

    SQLCe 4gb limit is the Same as SQL Server Express. It is an artifical size limit imposed by microsoft. It is not related to the type of file system. It is per database though.  I guess you could design your application to use multiple database files.

  • User profile image
    JoshRoss

    You also don't get clustered indexes, views, stored procedures, or many of the constructs available on the other editions.  It's kind of like working with a model train set. 

    God, I loved the smell of my electric train set. It had a button that made the engine-train generate smoke.

  • User profile image
    Bass

    Sqlite is another compact/embeddable DB but without any artificial limitations. There is an ADO.NET connector available with EF support if needed.

  • User profile image
    magicalclick

    arrrggg, why do they add artificial limitations to it? I can understand Express, but, Embeded is very limited to multi-connections, which already made it a local storage driven system. I think I will go with SQLite this time since it also have a managed version.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    Setag_Yrneh

    SQLite powers Android storage

    http://developer.android.com/guide/topics/data/data-storage.html

    A subset of SQLite was in HTML5 as the local storage engine until just recently. Now they have switched to Indexed DB

    http://www.w3.org/TR/IndexedDB/

    Here is the Mozilla team's article on that.

    http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/

    Basically, anywhere you would have used a .mdb in the past, you would use SQLite now.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.