SQL .NET Data Provider
SqlDataAdapter sql com = new SqlDataAdapter("select * from employee", sqlcon);
OLE DB .NET Data Provider
OleDbDataAdapter adocom = new OleDbDataAdapter("select * from employee", adocon);
Populating the Dataset:
DataSet ds = new DataSet(); //Creation
adocom.Fill(ds, "employee");//OLE DB .NET Data Provider
sqlcom.Fill (ds, "employee");// SQL.NET Data Provider
SQL .NET Data Provider
Inserting Data:
SqlCommand inscom = new SqlCommand("insert into employee values ('ARD25437A','John','P','Baxter',7, 100,0877,'1989-11-11T00:00:00 ')",sqlcon);
Updating Data:
SqlCommand mycommand = new SqlCommand("UPDATE employee SET job_id=11 WHERE fname='Pedro'", sqlcon);
Deleting Data:
SqlCommand delcom = new SqlCommand("delete from employee WHERE fname='Lesley'", sqlcon);
adocom.Fill(ds, "employee");//OLE DB .NET Data Provider
sqlcom.Fill (ds, "employee");// SQL.NET Data Provider
SQL .NET Data Provider
Inserting Data:
SqlCommand inscom = new SqlCommand("insert into employee values ('ARD25437A','John','P','Baxter',7, 100,0877,'1989-11-11T00:00:00 ')",sqlcon);
Updating Data:
SqlCommand mycommand = new SqlCommand("UPDATE employee SET job_id=11 WHERE fname='Pedro'", sqlcon);
Deleting Data:
SqlCommand delcom = new SqlCommand("delete from employee WHERE fname='Lesley'", sqlcon);
OLE DB .NET Data Provider Inserting Data: OleDbCommand inscom = new OleDbCommand("insert into employee values ('ARD25437A','John','P','Baxter', 7, 100,0877,'1989-11-11T00:00:00 ')",adocon); Updating Data: OleDbCommand mycommand = new OleDbCommand("UPDATE employee SET job_id=11 WHERE fname='Pedro'", adocon); Deleting Data: OleDbCommand delcom = new OleDbCommand("delete from employee WHERE fname='Lesley'", adocon); |
Connection and Execute Command
s:
delcom.Connection.Open();
delcom.ExecuteNonQuery();
delcom.Connection.Close();
delcom.Connection.Close();
No comments:
Post a Comment