Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:15:32+00:00 2026-06-04T10:15:32+00:00

I am using SQlite as a database in a C# winforms application. My project

  • 0

I am using SQlite as a database in a C# winforms application.

My project involves some select simple queries, inserts, deletes.

Currently, I have written all these sql, Ado.net queries in the codebehind.

For eg:

   private void frmPlant_Load(object sender, EventArgs e)
    {
        FillData();
    }
    void FillData()
    {
        dataGridView1.AutoGenerateColumns = true;
        string query = @"SELECT * FROM  [Table1]";

        using (SQLiteConnection conn = new SQLiteConnection(connString))
        {
            conn.Open();
            da = new SQLiteDataAdapter(query, conn);
            ds = new DataSet();
            da.Fill(ds, "T1");
            dt = ds.Tables[0];
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "T1";
            dataGridView1.Columns["TId"].HeaderText = "SNo";
            dataGridView1.Columns["Tcode"].Visible = false;
            dataGridView1.Columns["TID"].Width = 50;
            dataGridView1.Columns["Tcode"].Width = 70;
        }
    }

I have quiet a bit of code like this which interacts with the DB.

Question: Instead of writing these ado.net connections, sql query in the code behind, I want to use a 2 tier/3tier architecture. This should involve writing all the database stuff(ado.net execute scalar, reader, sql queries in another DBUtilitesclass/project and simply calling this DBUtilitesclass from the code behind.

Please suggest any tutorials to do this.

PS: I am using sqlite which does not support stored procedures.

Thank u
Sun

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:15:34+00:00Added an answer on June 4, 2026 at 10:15 am

    Refer

    http://www.switchonthecode.com/tutorials/csharp-tutorial-writing-a-dotnet-wrapper-for-sqlite

    http://snipplr.com/view/41708/

    http://www.codeproject.com/Articles/22165/Using-SQLite-in-your-C-Application

    Hope this helps

    Thanks

    Deepu

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database winforms application using SQLite written in C#. I'm attempting to
I'm writing a WinForms database application using SQLite and C#. I have a sqlite
I have an android application using an SQLite database. I open the database when
I'm developing an Android application and i'm using a Sqlite database to store some
I have doing some POC in Ruby-on-Rails and using sqlite database, while doing this
I have simple login form I am using SQLite database which has fields like
I've a winforms application that is using SQLite database. There is no encryption on
I have a simple sqlite database with two tables. When I manually delete (using
I am using the Sqlite Database in my Application, I have already upload my
I'm using SQLite database and I'm wondering whether I'm allowed to write queries as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.