Control for DB + SP's?

Discussion in 'ASP .Net' started by Lasse Edsvik, Sep 22, 2004.

  1. Lasse Edsvik

    Lasse Edsvik Guest

    Hello

    I was wondering if you guys could give me some pointers on how to get where
    i want to :) I know asp in and out, but havent tried asp.net that much.

    when i build asp apps i always use OleDB provider and Stored procedures
    which I in most cases pass parameters to... which i imagine you've done a
    million times too....

    anyway..... was wondering how to create a control (?) to make it as easy to
    use as:
    ....
    <psuedocode>

    Something db = new Something();
    db.Command "MySP";
    db.Setparameter("@Parm1",var1);
    db.Setparameter("@Parm2",var2);
    db.Execute();

    </psuedocode>

    I've looked at some OleDb tutorials and its just too much...... cant imagine
    it has to take like 100 lines of code to do something trough the oledb
    provider......

    I'd appreciate any help
    TIA
    /Lasse
    Lasse Edsvik, Sep 22, 2004
    #1
    1. Advertising

  2. Hi Lasse,

    This is an example of what I use for SQL. You should be able to just change
    the SQL stuff to OleDB. Good Luck! Ken.

    Dim objConnection As New SqlConnection(strDSN)
    Dim objDS As New DataSet()
    Dim objDA As New SqlDataAdapter()
    Dim objCommand As New SqlCommand()

    objCommand.CommandText = "WS_Quote_GetQuoteHistory"
    objCommand.CommandType = CommandType.StoredProcedure
    objCommand.Connection = objConnection
    objConnection.Open()
    objDA.SelectCommand = objCommand
    objCommand.Parameters.Add("@CarrierID", SqlDbType.Int).Value =
    intCarrierID
    objCommand.Parameters.Add("@StartDate", SqlDbType.DateTime).Value =
    dtStartDate
    objCommand.Parameters.Add("@EndDate", SqlDbType.DateTime).Value =
    dtEndDate
    objDA.Fill(objDS, "ActiveQuotes")
    objConnection.Close()

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight

    "Lasse Edsvik" <> wrote in message
    news:...
    > Hello
    >
    > I was wondering if you guys could give me some pointers on how to get

    where
    > i want to :) I know asp in and out, but havent tried asp.net that much.
    >
    > when i build asp apps i always use OleDB provider and Stored procedures
    > which I in most cases pass parameters to... which i imagine you've done a
    > million times too....
    >
    > anyway..... was wondering how to create a control (?) to make it as easy

    to
    > use as:
    > ...
    > <psuedocode>
    >
    > Something db = new Something();
    > db.Command "MySP";
    > db.Setparameter("@Parm1",var1);
    > db.Setparameter("@Parm2",var2);
    > db.Execute();
    >
    > </psuedocode>
    >
    > I've looked at some OleDb tutorials and its just too much...... cant

    imagine
    > it has to take like 100 lines of code to do something trough the oledb
    > provider......
    >
    > I'd appreciate any help
    > TIA
    > /Lasse
    >
    >
    >
    Ken Dopierala Jr., Sep 22, 2004
    #2
    1. Advertising

  3. "Lasse Edsvik" <> wrote in message
    news:...
    > Hello
    >
    > I was wondering if you guys could give me some pointers on how to get
    > where i want to :) I know asp in and out, but havent tried asp.net that
    > much.
    >
    > when i build asp apps i always use OleDB provider and Stored procedures
    > which I in most cases pass parameters to... which i imagine you've done a
    > million times too....
    >
    > anyway..... was wondering how to create a control (?) to make it as easy
    > to use as:
    > ...
    > <psuedocode>
    >
    > Something db = new Something();
    > db.Command "MySP";
    > db.Setparameter("@Parm1",var1);
    > db.Setparameter("@Parm2",var2);
    > db.Execute();
    >
    > </psuedocode>


    Take a look at how this is done in ASP.NET 2.0 with Data Source Controls.

    John Saunders
    John Saunders, Sep 22, 2004
    #3
    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. Replies:
    0
    Views:
    718
  2. Matthew Louden
    Replies:
    1
    Views:
    6,906
    Scott M.
    Oct 11, 2003
  3. Mad Scientist Jr
    Replies:
    0
    Views:
    633
    Mad Scientist Jr
    Mar 22, 2006
  4. shapper
    Replies:
    6
    Views:
    952
    shapper
    Dec 26, 2007
  5. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    541
    Jonathan Wood
    Feb 2, 2010
Loading...

Share This Page