DataAdapter

Discussion in 'ASP .Net' started by Shalini Noronha, Aug 7, 2003.

  1. Hi

    I use a DataAdapter. To which is pass a Stored Proc and
    Connection

    SqlDataAdapter DA = new SqlDataAdapter("storedProd",Conn);
    how do i pass parameters to my stored proc

    Kindly Help
    Shalini Noronha, Aug 7, 2003
    #1
    1. Advertising

  2. Shalini,

    You should create a SqlCommand object

    SqlClient.SqlCommand SqlCommand;
    SqlCommand.CommandText = "storedProd";
    SqlCommand.CommandType = CommandType.StoredProcedure;
    SqlCommand.Parameters.Add(New SqlClient.SqlParameter("@MyFirstParameter",
    [Value As Object]);
    SqlCommand.Parameters.Add(New SqlClient.SqlParameter("@MySecondParameter",
    [Value As Object]);

    SqlCommand.Connection = Conn

    SqlDataAdapter DA = new SqlDataAdapter(SqlCommand);

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Shalini Noronha" <> wrote in message
    news:032901c35d19$4e32e630$...
    > Hi
    >
    > I use a DataAdapter. To which is pass a Stored Proc and
    > Connection
    >
    > SqlDataAdapter DA = new SqlDataAdapter("storedProd",Conn);
    > how do i pass parameters to my stored proc
    >
    > Kindly Help
    S. Justin Gengo, Aug 7, 2003
    #2
    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. Eric A. Johnson

    VB.NET DataAdapter question

    Eric A. Johnson, Oct 17, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    5,040
  2. Paul
    Replies:
    0
    Views:
    637
  3. Boris Zakharin
    Replies:
    0
    Views:
    953
    Boris Zakharin
    Aug 4, 2003
  4. Galen Harris

    dataadapter.update -- dataset from session

    Galen Harris, Oct 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    534
    Jacob Yang [MSFT]
    Oct 24, 2003
  5. Galen Harris
    Replies:
    1
    Views:
    458
    Patrik Löwendahl
    Oct 24, 2003
Loading...

Share This Page