DataSource Controls :: Access Layer - Northwind Tutorial - Unable To Find The NorthwindTableAdapters.ProductsTableAdapter Class
Mar 31, 2010
I've been attempting to walk through the "Creating a Data Access Layer" tutorial found [URL] I create the DB connection, create the typed dataset and table adapter, specify the sql, etc. When I add the code to the presentation layer (in this case a page called AllProducts.aspx) I am unable to find the NorthwindTableAdapters.ProductsTableAdapter class. I tried to import the NorthwindTableAdapters namespace, but it is not showing up. Looking in the solution explorer Class View confirms that there is a Northwind class, but not the namespace I'm l ooking for. I've tried several online tutorials that all have essentially the same steps, and I'm getting the same results.
I've been attempting to walk through the "Creating a Data Access Layer" tutorial found [URL]I create the DB connection, create the typed dataset and table adapter, specify the sql, etc.When I add the code to the presentation layer (in this case a page called AllProducts.aspx) I am unable to find the NorthwindTableAdapters.ProductsTableAdapter class. I tried to import the NorthwindTableAdapters namespace, but it is not showing up. Looking in the solution explorer Class View confirms that there is a Northwind class, but not the namespace I'm looking for.
I've tried several online tutorials that all have essentially the same steps, and I'm getting the same results.Can anyone give me a push in the right direction?I'm getting error: Namespace or type specified in the Imports 'NorthwindTableAdapters' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member.I think I might need to add a reference OR they may be creating a separate class and importing it into their main project. If that's the case, the tutorials do not mention this.
SuppliersTest2.aspx.vb: Imports NorthwindTableAdapters Partial Class SuppliersTest2 Inherits System.Web.UI.Page
i need the northwind databse. i dont have it in the database where i can find it and who to add it to my database in sql server so can i c it in the combo box off the database
I'm now reading this article:[URL]But I don't understnad why this is better than just writing code, methods that connects to DB and get from stored procedore what I need. Why is it better to use so much DataSets for all the tables and more.
I can use similar code below to select a row in my database when I enter a value (username) in text box and it successfully retrieves.however, I'd also like to delete row from database based on the username i enter in text box. My code runs but no row is deleted...my code is:
I keep all of my code in codeLib.cs and use it on various ASP.NET pages. However, I still have to do the databind(); in the code behind page for each aspx file. How can I eliminate all code in the aspx file so I just have the UI in the aspxand the code and databind(); in codeLib.cs.
I am using DotNetOpenAuth in my ASP.Net Website. I have modified it to work with Facebook Connect as well, using the same methods and database structures. Now I have come across a problem.
I have added a Facebook Connect button to a login page. From that HTML button, I have to somehow pull information from the Facebook Connect connection and pass it into a method to authenticate the user. The way I am currently doing this is by:
Calling a Javascript Function on the onlogin function of the FBML/HTML Facebook Connect button. The javascript function calls a Web service to login, which it does correctly. The web service calls my data access layer to login. And here is the problem: FormsAuthentication.SetAuthCookie is set at the data access layer. The Cookie is beyond the scope of the user's page and therefore is not set in the browser. This means that the user is authenticated, but the user's browser is never notified. So, I need to figure out if this is a bad way of doing what I need or if there is a better way to accomplish what I need. I am just not sure and have been trying to find answers for hours.
My repositories throw exceptions (System.Exception) when some things go bad and I know this is bad practice.. so i will create a custom exception (DataException). My question is should this custom ex class be in the repository layer or the domain layer? Im thinking it should be in Domain layer where all business objects and repository interfaces live but just want to make sure.
Are there scenarios where it makes sense to encapsulate a data access layer (of a ASP.NET webapplication) with WCF or WCF Data Services ? Makes it sense to use a service inside the application ?
I am building a web site following the tutorials on asp.net. I am using dataset as data access lay, and writing classes to access the dataset. But the example is just basic ideas, how do I retrieve individual table column value in the business layer?For example, if I have a table called Product, I only want to find out what is the product name by product id. I did this in my ProductBLL:
public ProductBLL { public int GetProductName(string productId) { ProductDataSet.ProductDataTable prodData = Adapter.GetProductById(productId); [code]...
Is there a better way, or am I doing this correctly? Can anybody give me a reference to a more complicated business logic model?
i was attaching northwind database with sql server 2005 so while attaching it gives me an error an exception occured while executing a transct -sql statemnet or batch ,unable to eon physical file "C:sql server 2000 sample database orthwnd.mdf"
I have a Dynamic Data application to which I have added a class for extending EDM. Everything works great, but now I am trying to set an entity property value equal to a value in session state - and its not recognizing the Session command. I'm trying to do something like this:
audit.action_by = CStr(Session("person_name"))
I think this is because I do not have the class Inheriting Page, but if I do add Inherits Page it breaks other stuff. How can I have the class include the ability to utilize sessions directly without inheriting Page?
I have a Web Site project running on VD2008, with an Access back end and .NET 3.5, C#.
I have created the project several times and added the usual App_Code, Pages, App_Data, Properties, folders. I created a Master Page and several content pages BUT I am unable to get to the folders or root where there is a Class (code) file.
I have tried all the usual lines...
using SumaCard.App_Code
OR
SumaCard.App_Code.FTP_Code ftpc = new SumaCard.App_Code.FTP_Code();
but nothing works? I have been hasseling over this for 2 days now.
What have I missed? Maybe I built the project wrongly? (Project | New Project | Visual C# | Web | ASP.NET Web Application |??
I was wondering if anyone had a tutorial or overview of the best way to store html in a MS SQL database, and then calling it back up and displaying it and should I save the decoded html in ntext?
here i have in 3-tier architecture , how to pass the data between DAL and BAL. i am using grid view to edit the data,when ever i click on the edit button all the corresponding fields should come to textboxes. i tried for delete ,it works fine bt not working to EDIT.
i have problem white Object datasource. i have a multi-tier Application that include common layer ,DAL Layer,business logic and persantation layerwhen i add a object datasource to my page, it bring me only common layer classes . but i want use bisuiness layer classes what do i do ?
when trying to setup either sql or access DataSource control or Add- Connection in server explorer, i get the error 'the system cannot find the file specified' for my main user acct, its an admin for another admin acct going for same db, it works fine! in the past the 'cannot find file' error has sometimes turned out to be a permissions problem, but shouldn't be with 2 admin accounts. this is a .mdb and i can run access2003 no problem.i've checked the machine.config file for a bunch of suggestions on posts and even some registry keys, so far all checks out. evidently vs2005 has unique settings for each user, eg. i had to turn on line numbering for 2nd user. somehow i messed up my vs2005 settings for the problem user? or some registry key?
I am trying to create strogly typed datasets for my project. When I right click on the xsd file that I need to generate a strongly typed dataset for I can't find the 'Advanced' properties as described in the below article (almost half way down)[URL]As I do not see the Advanced properties option I can't find the 'Custom Tool' property/option to set its value to 'MSDatasetGenerator'. Do I have to install some kind of patch on my VS 2005?