The number of the parameters in the collection must be equal to the number of parameter placeholders within the command text, or an exception will be generated. The following example creates multiple instances of that are exposed as a collection through the object within . These parameters are used to select data within the data source and place the data in the . This code example assumes that a DataSet object and an instance of were created properly with the appropriate schema, commands, and connection. Public Sub AddParameters() ' ... ' create myDataSet and myDataAdapter ' ... myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters" myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239 myDataAdapter.Fill(myDataSet) End Sub 'AddSqlParameters public void AddSqlParameters() { // ... // create myDataSet and myDataAdapter // ... myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters"; myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239; myDataAdapter.Fill(myDataSet); }