Gets the first value for specified sql query based on either on column name or column index
[Visual Basic]
Overridable Protected Function GetFirstValueForCurrentColumn() As Object
[C#]
protected virtual object GetFirstValueForCurrentColumn();
Return Value
The value of selected column in the first row
Example
public string GetUser(int UserId)
{
ColumnName="LastName";
// or ColumnIndex=0;
SourceTable="pDocuments";
SelectString = "SELECT * FROM Documents";
//SelectString = "--name of stored procedure--";
//CmdType = CommandType.StoredProcedure; This must be set with a stored procedure
return Convert.ToString(GetFirstValueForCurrentColumn());
}See Also
Reader Class | Reader Members | Magnusson.Data.SqlClient Namespace