I am going through a revision of my product where I am trying to
abstract out the data access layer, where I have traditionally just
dragged/dropped data adapters and generated datasets using Visual
Studio on my web forms. I am using the following document as a guide:
http://msdn.microsoft.com/library/de...tml/BOAGag.asp
The problems that I am seeing are that I am getting empty result sets,
even tho db trace shows the proper query is occuring which would
return some rows.
As a smaller problem, I can no longer see my data source when trying
to use PropertyBuilder for lists/grids. Where does the Visual Studio
UI get it's dropdown list for DataSource in that list/grid property?
My CustomerDataSet class extends from DataSet and the instance on the
aspx class is marked protected just like before I began the data
access layer exercise.
I have attached the relevent code snippets - any help would be great!
Thanks,
Tim
===
----------------------
TestPage.aspx:
----------------------
private void Page_Load(object sender, System.EventArgs e)
{
CustomerDALC customerDALC = new CustomerDALC();
customerDS = customerDALC.GetCustomers();
Label1.Text = customerDS.Tables[0].Rows.Count.ToString(); // returns
0!
}
----------------------
CustomerDALC.cs:
----------------------
public CustomerDataSet GetCustomers()
{
SqlConnection dbConn = new SqlConnection(connString);
string selectCommand = "SELECT customerId, name, paymentInfoId from
Customer";
SqlDataAdapter customerDA = new SqlDataAdapter(selectCommand,
dbConn);
CustomerDataSet customerDS = new CustomerDataSet();
customerDA.Fill(customerDS);
return customerDS;
}