>Example >[Visual Basic, C#] The following example creates multiple instances of OleDbParameter through the OleDbParameterCollection collection within the OleDbDataAdapter. These parameters are used to select data from the data source and place the data in the DataSet. This example assumes that a DataSet and an OleDbDataAdapter have already been created with the appropriate schema, commands, and connection. > >[Visual Basic] >Public Sub AddOleDbParameters() > ' ... > ' create myDataSet and myDataAdapter > ' ... >myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", OleDbType.VarChar, 80).Value = "toasters" >myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", OleDbType.Integer).Value = 239 >myDataAdapter.Fill(myDataSet) >End Sub 'AddOleDbParameters > > >[C#] >public void AddOleDbParameters() > { > // ... > // create myDataSet and myDataAdapter > // ... > myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", OleDbType.VarChar, 80).Value = "toasters"; > myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", OleDbType.Integer).Value = 239; > myDataAdapter.Fill(myDataSet); > } >