I have fetched data from database as a
complete dataset which has only one table in it.
Made a DataTableReader from it and it is working as same as DataReader.
Simple Example Below.
DataBase.cs
public static class DataBase
{
private static VerticaConnection vConnection = null;
private static VerticaCommand vCommand = null;
private static VerticaDataAdapter vAdapter = null;
string private static void GetConnection()
{
GetAppSettings(); //get connection string from config
vConnection = new VerticaConnection(<connectionstring>);
vCommand = new VerticaCommand();
vAdapter = new VerticaDataAdapter(vCommand);
}
public static System.Data.DataSet getData(string query)
{
try{
GetConnection();
vCommand.CommandText = query;
vCommand.Connection = vConnection;
vAdapter.SelectCommand = vCommand;
System.Data.DataSet ds = new System.Data.DataSet();
Join the conversation! Your thoughts help the community grow.