Updates the database by using text strings or stored procedures. Set either the InsertString,DeleteString or the Update string to the sql query or the name of the stored procedure. Add sql parameters to be used in the stored procedure.
[Visual Basic]
Overloads Protected Function Update() As Integer
[C#]
protected int Update();
Return Value
The number of rows affected in the table
Example
public int UpdateUserInfo(string PenId,string EMailAddress,string Title,string Category)
{
insertParams = new SqlParameter[4];
insertParams[0] = new SqlParameter("@PenId",SqlDbType.VarChar, 50, ParameterDirection.Input, false, 10, 0, "PenId", DataRowVersion.Current, PenId);
insertParams[1] = new SqlParameter("@EMailAddress",SqlDbType.VarChar, 50, ParameterDirection.Input, false, 10, 0, "EMailAddress", DataRowVersion.Current, EMailAdress);
insertParams[2] = new SqlParameter("@Title",SqlDbType.VarChar, 50, ParameterDirection.Input, false, 10, 0, "Title", DataRowVersion.Current, Title);
insertParams[3] = new SqlParameter("@DocumentId",SqlDbType.Int,4);
insertParams[3].Direction = ParameterDirection.Output;
SourceTable ="--Table Name--";
InsertString="--Name of Stored Procedure--";
CmdType = CommandType.StoredProcedure;
return Update();
}See Also
NMAdapter Class | NMAdapter Members | netMage.Data.SqlClient Namespace | NMAdapter.Update Overload List