Monday, October 10, 2011

Simple SQLite Application


protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            
            SQLiteConnection conn = new SQLiteConnection("Data Source=" + Server.MapPath("sqlitedb.db") + ";Version=3;");
            SQLiteDataAdapter adap = new SQLiteDataAdapter("select * from table", conn);
            conn.Open();
            DataTable dt = new DataTable();
            adap.Fill(dt);
            grd.DataSource = dt;
            grd.DataBind();
            conn.Close();
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }

No comments:

Post a Comment