Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. OleDB using MS-Access

OleDB using MS-Access

Scheduled Pinned Locked Moved Database
graphics
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s4_sabahatf
    wrote on last edited by
    #1

    i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way /////////////////////////////////////////////////////////// OleDbConnection m_Connection = new OleDbConnection(Connection); m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb"; m_Connection.Open(); Connection ="DELETE FROM user WHERE username = @s";

    M 1 Reply Last reply
    0
    • S s4_sabahatf

      i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way /////////////////////////////////////////////////////////// OleDbConnection m_Connection = new OleDbConnection(Connection); m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb"; m_Connection.Open(); Connection ="DELETE FROM user WHERE username = @s";

      M Offline
      M Offline
      Muhammad Shahid Farooq
      wrote on last edited by
      #2

      using System.Data.OleDb; public class Database { OleDbConnection connection = new OleDbConnection(); OleDbCommand command = new OleDbCommand(); public void openConnection() { connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\use.mdb"; connection.Open(); } public void closeConnection() { if (connection.State != 0) { connection.Close(); } } public void executeNonQuery(string query) { command.Connection = connection; command.CommandText = query; openConnection(); command.ExecuteNonQuery(); closeConnection(); } } public class Test { Database ObjDatabase = new Database(); string strQuery; objDatabase.openConnection(); strQuery = "DELETE FROM User"; objDatabase.executeNonQuery(strQuery): objDatabase.closeConnection(); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups