I have recently placed a web application on a remote server for testing. This application uses a range of SQL Server (Express) databases to hold card and user information, of which all are linked into my master database. The database is referred to in my web.config file.
I have made .bak files from my databases and restored them on my server, with the connection string now showing:
<add key="ConnectionString" value="server=localhost; database=DatabaseMaster; uid=...; pwd=..."/>
On my local computer the application is fine and throws no exceptions. However, upon connecting to my application via the web server, and trying to retrieve data from my cards table a NullReferenceException error is thrown. I have checked my code via breakpoints on the following code:
private void FillGrid()
{
DataSet ds = new DataSet();
//get data from session
ds = (DataSet)SessionNavigator.GetDataFromCurrentPage
(PageParams.Customer.DataCards);
if (ds != null)
{
DataView dv = ds.Tables["Cards"].DefaultView;
gridCtrl.RowsCount = dv.Count;
gridCtrl.BindGrid(dv);
}
}
My checks have found that the DataSet ds is indeed not null, and in fact it seems that the application is not recognising the table "Cards", there being no reference to an instance of the object in the table.
Confusingly enough, other tables (such as for users) have no problems whatsoever on the server. Also, manipulating data related to the card objects (such as making transactions and changing points values) are reflected in the SQL Server Management Studio.
I am inexperienced with SQL Server so I may be wrong but I don't think it has anything to do with the database itself.
So SO, are there any glaringly obvious steps that I may have missed when setting up the application that are causing these issues? If so, are there any reference materials that you can recommend?
Edit: After Searching through the PageParams Enumerable and looking closely at the ds Dataset, I have found that ds is not null but has a value of {System.Data.DataSet} containing System.Data.DataTableCollection with a list of size 0.