Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Write a sample example of ADO.Net?
using System;
using System.Data;
using System.Data.OleDb;

// Step 1.Open Database Connection
OleDbConnection conn = new
                      OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inventory\inventory\db\invent.mdb;");

// Step 2.Connection database opened 
conn.Open();

// Step 3.Create DataSet and Command objects
OleDbCommand cmd = new OleDbCommand(
                            "SELECT * FROM empr4r",
                            conn);

// Step 4.Execute the command
cmd.ExecuteScalar();

// Step 5.Closed this connection 
conn.Close();
Posted By: Name:Rajesh Kr URL: Write a sample example of ADO.Net?