The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MySqlParameterCollection.xml 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <MyDocs>
  2. <MyMembers name="Class">
  3. <remarks>
  4. The number of the parameters in the collection must be equal to the number of
  5. parameter placeholders within the command text, or an exception will be generated.
  6. </remarks>
  7. <example>
  8. The following example creates multiple instances of <see cref="MySqlParameter"/>
  9. through the <B>MySqlParameterCollection</B> collection within the <see cref="MySqlDataAdapter"/>.
  10. These parameters are used to select data within the data source and place the data in
  11. the <see cref="System.Data.DataSet"/>. This code assumes that a <B>DataSet</B> and a <B>MySqlDataAdapter</B>
  12. have already been created with the appropriate schema, commands, and connection.
  13. <code lang="vbnet">
  14. Public Sub AddParameters()
  15. ' ...
  16. ' create myDataSet and myDataAdapter
  17. ' ...
  18. myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters"
  19. myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239
  20. myDataAdapter.Fill(myDataSet)
  21. End Sub 'AddSqlParameters
  22. </code>
  23. <code lang="C#">
  24. public void AddSqlParameters()
  25. {
  26. // ...
  27. // create myDataSet and myDataAdapter
  28. // ...
  29. myDataAdapter.SelectCommand.Parameters.Add("@CategoryName", MySqlDbType.VarChar, 80).Value = "toasters";
  30. myDataAdapter.SelectCommand.Parameters.Add("@SerialNum", MySqlDbType.Long).Value = 239;
  31. myDataAdapter.Fill(myDataSet);
  32. }
  33. </code>
  34. </example>
  35. </MyMembers>
  36. </MyDocs>