Hi all,
I am really new to ASP.net, so thought I would go through one of the samples on here.
I have started the Working with Data in ASP.NET 2.0 :: Creating a Data Access Layer sample, but I get stuck when i add the code to AllProducts.aspx.cs for some reason, I can add the directive 'using NorthwindTableAdapters' when I compile after adding this directive, I get an error ...
Error 143 The type or namespace name 'NorthWindTableAdapters' could not be found (are you missing a using directive or an assembly reference?) C:\data\tutorial\Default.aspx.cs 10 7 C:\data\tutorial\
Any ideas why I am getting this?
Thanks
Pete
Did u added the northwind database to app_data folder?
you need to add that at first.
Hi Crige,
I added the connection to data connections in the Solution explorer, and also added a dataset item to the project as per the tutorial.
How do I add the database to the app_data_folder, when I right click on app_data I get an add new option dialogue, when I look at the database icon in this dialogue, it shows 'empty database' the database I am using is an existing database on the server...
Pete
I am having the same problem. I'm using SQL 2000 instead of the App_Data approach. The document explains how to use this approach but does not explain that the Northwind database is REQUIRED to be in the App_Data folder. Are you sure that this is required? If not, then what else could be the problem?
Thanks,
Larry
You're not going to believe this...
The class name is case-sensitive... NorthwindTableAdapters must be entered as NorthWindTableAdapters (with a capital W). I noticed this by adding an ObjectDataSource to AllProducts.aspx and then selecting a business object in the 'configure data source' screen. The class name is displayed with a capital W.
At least this gets me past this error message... hope it does the same for you.
Thanks,
Larry
Apparently, I named my DataSet NorthWind, with a capital W. My previous post will only resolve the problem if you did the same...
Note that the tutorial did NOT use a capital W, so I introduced this 'bug' myself by naming the xsd file wrong.
At any rate, it's fixed now so it's time to move on.
0 comments:
Post a Comment