Data Access Aplication Block and Access database

Discussion in 'ASP .Net' started by Fernando Lopes, Mar 29, 2005.

  1. 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
     
    Fernando Lopes, Mar 29, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Augusto

    Launch aplication

    Augusto, Jun 25, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    941
    Peter McMahon [MVP]
    Jun 26, 2003
  2. adam

    asp.net aplication in C# (help)

    adam, Jan 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    388
  3. Mukesh

    Data Acess aplication block

    Mukesh, Sep 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    644
    Cowboy \(Gregory A. Beamer\)
    Sep 9, 2006
  4. Mukesh
    Replies:
    3
    Views:
    605
    sloan
    Sep 11, 2006
  5. morrell
    Replies:
    1
    Views:
    999
    roy axenov
    Oct 10, 2006
Loading...

Share This Page