Hi All,
I want to use Microsoft Enterprise library Data Application Block for MS Access database (OLEDB provider)
I want parameter based INSERT functionality with enterprise library (Just like we do for SQL provider with parameter based code like - database.params.Add("@EmpName", this.EmpName);
I want the same thing for MS Access database connection.
Could anybody please let me know How could I do this?
Thanks in advance.
Will this code work?
SirDemon, Thanks for explanation.. I know everything related to INSERT, Update and Delete for SQL. I want compatible it with MS ACCESS . Okay tell me, is below code will work ?
string query = "INSERT INTO DB (EmployeeID, Name) VALUES (@EmployeeID, @Name)
Database db = DatabaseFactory.CreateDatabase();
DbCommand sqlCommand = db.GetCommandFromText(query);
db.AddInParameter(sqlCommand, "@EmployeeID", this.EmployeeID);
db.AddInParameter(sqlCommand, "@Name", this.Name);
Will this example will work in MS Access database.