3
17
Fork 5
The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

45 Zeilen
1.6 KiB

<MyDocs>
<MyMembers name="Class">
<remarks>
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.
</remarks>
<example>
The following example creates multiple instances of <see cref="MySqlParameter"/>
through the <B>MySqlParameterCollection</B> collection within the <see cref="MySqlDataAdapter"/>.
These parameters are used to select data within the data source and place the data in
the <see cref="System.Data.DataSet"/>. This code assumes that a <B>DataSet</B> and a <B>MySqlDataAdapter</B>
have already been created with the appropriate schema, commands, and connection.
<code lang="vbnet">
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
</code>
<code lang="C#">
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);
}
</code>
</example>
</MyMembers>
</MyDocs>