Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
Hello Guys,

I am building my new website, which is my first web site, and I don't know much about programming.

I was trying to search for 3 tier architecture and was trying to write my DAL and found out something called Table Adapter.
I created a pubs.xsd and looking at some links I was able to configure it, but the problem is they wrote the following code in the page load event.

PubsTableAdapters.authorsTableAdapter myadapter = new PubsTableAdapters.authorsTableAdapter();
        Pubs.authorsDataTable myauthors;
        myauthors = myadapter.GetAuthors();
        foreach(Pubs.authorsRow authorrow in myauthors)
        Response.Write("Author: " + authorrow.au_fname + "  " + authorrow.au_lname+  "<br />");


This line of code is giving me an error saying you missing a reference or assembly or a namespace.

This is the link I was following:

http://dotnetstories.wordpress.com/2008/11/26/working-with-dal-data-access-layer-bllbusiness-logic-layer-in-aspnet-web-applications/[^]

Please help me.
I am stuck.

Thanks in Advance.
Posted
Updated 9-Jun-11 21:43pm
v3
Comments
[no name] 10-Jun-11 3:08am    
Edited for Code Block.
Dalek Dave 10-Jun-11 3:44am    
Edited for Grammar.

1 solution

You are probably working with typed datasets. If that is the case, the table adapters for your datasets will be generated by Visual Studio. The type of the table adapter is not known in your code, resulting in the error.

That means that you did not define the typed dataset (and the tableadapter) in your assembly or you did not properly reference the assembly where it comes from.

Here is some info on strongly typed datasets[^] on MSDN to help you get more familiar with them.
 
Share this answer
 
Comments
ubaidh sayed 10-Jun-11 5:38am    
CDP1802 : Thanks , That helped me :-)
[no name] 10-Jun-11 6:57am    
Great :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900