TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Stephen Fletcher
NA
4
0
AccessDataSource in VisualStudio2003
Oct 5 2006 4:53 AM
Hi,
I'm a newbie and am plugging my way through Murach's ASP.NET 2 for VS2005.
As I'm developing with VS2003 there are a few differences.
The example (which I'm determined to get through, one way or another) uses AccessDataSource.
These don't exist in VS2003.
I am succesfully connecting to a SQL Server database, retrieving data and binding a list to a drop-down.
I have a function GetSelectedProduct, which needs to retrieve a Product object (with name, price, image name etc.) from the DB when a product is selected from the drop-down described above.
The example (listed below) casts the datasource as a dataview, uses a rowfilter and populates the Product object.
Any help or advice is greatly appreciated.
private Product GetSelectedProduct()
{
DataView productsTable = (DataView) AccessDataSource1.Select(DataSourceSelectArguments.Empty);
productsTable.RowFilter = "ProductID = '" + ddlProducts.SelectedValue + "'";
DataRowView row = (DataRowView) productsTable[0];
Product p = new Product();
p.ProductID = row["ProductID"].ToString();
...
return p;
}
Reply
Answers (
0
)
Error to add Using System.Collections.Generic
C # Abilities