calling and use the StoredProcedure

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Is it possible to use a StoredProcedure when you have SqlDataAdapter or is
it
only possible when you have SqlCommand like
SqlCommand thisCommand = myConnection.CreateCommand;
thisCommand.CommandType = CommandType.StoredProcedure;
thisCommand.CommandText = "MyStoredprocedure";

As far as I can see how would you tell SqlDataAdaper that you will use a
StoredProcedure ?

//Tony
 
Hello Tony,

the dataAdapter's SelectCommand property must be assigned to a sqlCommand
object with the commandtype set to 'CommandType.StoredProcedure' as you did
in your sample.

(yourDataAdapter.SelectCommand = yourSqlCommand)

Regards

Frank
 
Back
Top