CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Posts
    2

    Question Ado.net using IDBCommand

    How can I use the stored procedure with the help of IDBCommand to save my new record in the database.

  2. #2
    Join Date
    Feb 2008
    Posts
    2

    Re: Ado.net using IDBCommand

    Please send me the answer with example using IDBCommand.

  3. #3
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Ado.net using IDBCommand

    Quote Originally Posted by jaineeshthakur
    How can I use the stored procedure with the help of IDBCommand to save my new record in the database.
    Your question is somewhat incomplete. What database are you talking about? And how are you connecting to this database. What does this stored procedure return?

  4. #4
    Join Date
    Sep 2007
    Posts
    82

    Re: Ado.net using IDBCommand

    I think you could probably do something like this.....

    Code:
    string connectionString = <your Connection String>;
    //Right here your connection type could be anything OleDb, Odbc, etc
    IDbConnection conn = new SqlConnection(connectionString);
    IDbCommand cmd = conn.CreateCommand();
    cmd.CommandText = <your Stored Procedure>;
    cmd.CommandType = CommandType.StoreProcedure;
    //Add your parameters to the stored procedure
    cmd.ExecuteNonQuery();
    Is that what you are looking for????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured