N
Nightcrawler
This is what I have
1. Two tables, User and Country. User contains UserId, UserName and
Country contains CountryId, and CountryName.
2. I dragged in both tables from SQL server 2005 into a dataset and
has VS 2005 create the standard Select, Update, Insert, Delete stored
procedures.
3. I have a aspx page with a datalist that has an objectdatasource
poiting to the User Tableadapter which simply displays the User data
on the page.
Now, for each row that is displayed I currently have to fire an
OnItemDataBound event, take the CountryId, execute a storedprocedure
to get the CountryName based, find a Label within the template for the
row and display the CountryName. So basically I execute one SP to get
the Users than an additional Stored Procedure for each row. So if I
have 10 users, I have to hit the database 11 times.
I know I can cache the country table since it is not gonna change at
all BUT what if the Country table (in theory) grew alot, then caching
would not be an option. Is there a clean and efficient way of
displaying foreign key values and still keeping the ease of strongly
typed datasets without doing timeconsuming custom coding?
Please let me know.
Thanks in advance
1. Two tables, User and Country. User contains UserId, UserName and
Country contains CountryId, and CountryName.
2. I dragged in both tables from SQL server 2005 into a dataset and
has VS 2005 create the standard Select, Update, Insert, Delete stored
procedures.
3. I have a aspx page with a datalist that has an objectdatasource
poiting to the User Tableadapter which simply displays the User data
on the page.
Now, for each row that is displayed I currently have to fire an
OnItemDataBound event, take the CountryId, execute a storedprocedure
to get the CountryName based, find a Label within the template for the
row and display the CountryName. So basically I execute one SP to get
the Users than an additional Stored Procedure for each row. So if I
have 10 users, I have to hit the database 11 times.
I know I can cache the country table since it is not gonna change at
all BUT what if the Country table (in theory) grew alot, then caching
would not be an option. Is there a clean and efficient way of
displaying foreign key values and still keeping the ease of strongly
typed datasets without doing timeconsuming custom coding?
Please let me know.
Thanks in advance