Hello all
I am using microsoft enterprise libraries for the first time, I wrote code to create database object and command, then I execute the command using Executedataset(command Object), I have no problem till this, then I try to get a datatable for the first item, to asign it to the Gridview I have, I got a null referance exception ..
Here is my code:
FileConfigurationSource fileSource = new FileConfigurationSource(@"filesource.config"); DatabaseProviderFactory dbFactory = new DatabaseProviderFactory(fileSource);
Database dbLTC = dbFactory.Create("LTCConnectionString");
DbCommand dbCommand = dbLTC.GetSqlStringCommand("select rin from master where officeid = 107"); try {
DataSet
dset = dbLTC.ExecuteDataSet(dbCommand);
GridView1.DataSource = dset.Tables[0];
GridView1.DataBind();
Thanks and best regards