473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problems abstracting out data access layer from aspx pages

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;
}
Nov 17 '05 #1
0 1105

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
3
by: Mr Newbie | last post by:
I am messing around with Web User Controls at present and (think) I have discovered the following. 1.) The identifier for the control in the code behind must match the ID for the control on the...
2
by: asad | last post by:
hello, how ru all pls tell me how can i create DAL and how can i use it in my ASP.NET pages thanks
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
4
by: pratham | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines...
3
by: kbutterly | last post by:
Good morning, I have seen two different types of data access layers and I am wondering which, if either, is considered best practice, or if one is better suited to certain situations than the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.