Fill a dataset according to the query in propery SelectString
[Visual Basic]
Overridable Protected Function GetData() As Integer
[C#]
protected virtual int GetData();
Return Value
The number of rows in the dataset
Example
public DataSet GetAllDocumentsForPenUserWithText(int PenId)
{
SourceTable="Documents";
SelectString = "SELECT * FROM Documents WHERE PenId="+PenId;
CmdType = CommandType.Text;
int rowsAffected = GetData();
return DataSetToUse;
}--------------
or
public DataSet GetAllDocumentsForPenUserWithStoredProcedure(int PenId)
{
SelectString = "--name of stored procedure--";
CmdType = CommandType.StoredProcedure; //This must be set with a stored procedure
selectParams = new SqlParameter[2];
//Specify the input/output parameters
selectParams[0] = new SqlParameter("@PenId", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "TestId", DataRowVersion.Current,PenId);
int rowsAffected = GetData();
return DataSetToUse;
}See Also
NMReader Class | NMReader Members | netMage.Data.SqlClient Namespace