Data Access Aplication Block and Access database

F

Fernando Lopes

Hi there.
I'm using the DAAB in my app.
So, if I need to fill a dataset, using a SQL Server database, I use the
following code

helper.FillDataset(conn, "GetCustomersByID", ds, new string[] {
"Customers" }, new string[] { "ALFKI" });

Parameters:
conn = Connection
GetCustomersById = stored procedure name
ds = the dataset for fill
new string[] {"Customers"} = the table name
new string[] {"ALFKI"} = the id parameter for stored procesure search.

If I want to use Access database, how can I will do?
I will need to put if's in everywhere, like:

if (SqlServer)
helper.FillDataset(cs, "GetCustomersByID", ds, new string[] {
"Customers" }, new string[] { "ALFKI" });
if (Access)
helper.FillDataset(cs, CommandType.Text, "SELECT * FROM Customers WHERE
CustomerID = 'ALFKI'", ds, new string[] { "Customers" });


It seems insane for me!

Someone has another idea or got the same problem?

Tks.

Fernando
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top