parameters in SqlDataAdapter ?

Results 1 to 2 of 2

Thread: parameters in SqlDataAdapter ?

  1. #1
    Join Date
    Dec 1969

    Default parameters in SqlDataAdapter ?

    how can i set Parameters to a query in SqlDataAdapter ?

  2. #2
    Join Date
    Dec 1969

    Default like this...

    Dim strCommandText As String = "Stored Procedure Name"<BR> Dim objConnect As New SqlConnection(strConnect)<BR> Dim objCommand As New SqlCommand(strCommandText, objConnect)<BR> objCommand.CommandType = CommandType.StoredProcedure<BR> Dim objParam As SqlParameter<BR><BR> objParam = objCommand.Parameters.Add("@param name", SqlDbType.varchar, 400)<BR> objParam.Direction = ParameterDirection.Input<BR> objParam.Value = "some value or other"<BR><BR> Dim objDataAdapter As New SqlDataAdapter(objCommand)<BR> Dim objDataSet As New DataSet()<BR><BR> objDataAdapter.Fill(objDataSet, "Name for your table")

Posting Permissions

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