October 23, 2011 at 5:37 am
Hello, all.
My enviroment is:
ASP.NET Dynamic Data project (as data model is ADO.NET Entity Framework data model),
database on SQL Server 2005(compability 90).
The following diagram(attached file) shows a part of my database scheme.
The main table from these is "Office". The users want to see the link to the "Office" in each table that take a part in relationships with one. I think it could be done if i add the additional column(for example, computed column) in each other table(except "Communication" table because "Office" and "Communication" are connected directly and so "Communication" have link to table "Office") and then make UDF that will return, for example, Office_Address by identifier table.
Is there another way to do something like? As i understand using Computed Column and UDF is not best practice? (Sorry for my little English.)
October 24, 2011 at 2:00 am
Konstantin Konstantinov (10/23/2011)
The main table from these is "Office". The users want to see the link to the "Office" in each table that take a part in relationships with one.
Users? Do you expose tables directly to users?
Isn't there an ASP application to handle database access?
I think it could be done if i add the additional column(for example, computed column) in each other table
If I understand correctly, you're querying data, so a simple JOIN would do the trick. Why do you think you should add a computed column?
I'm sorry if I didn't understand your problem: if so, you could try to explain things with an example.
Hope this helps
Gianluca
-- Gianluca Sartori
October 24, 2011 at 5:11 am
Users? Do you expose tables directly to users?
Yes, i do. I use Dynamic Data with Scaffolding. ASP.NET analyzes the application's data model and generates Web pages dynamically based on the data in the data model(ADO.NET Entity Framework data source in my case) so i do not need to write classes for work with database and i do not need to write code for CRUD operations too. So in a Dynamic Data Web application query would be generated automatically according to my database scheme. Although it is possible to do this without using scaffolding. But i would like to do this on database scheme level.
If I understand correctly, you're querying data, so a simple JOIN would do the trick. Why do you think you should add a computed column?
I'm sorry if I didn't understand your problem: if so, you could try to explain things with an example.
I am so sorry for my not exactly clear question. I am not querying data.
October 24, 2011 at 6:03 am
I've never used scaffolding and I'm not sure what to suggest. If it was my application, I would use a view to retrieve the aditional column and expose the view instead of the base table.
Does this make sense to you?
-- Gianluca Sartori
October 24, 2011 at 7:44 am
Thank you, Gianluca Sartori!
I have already thought about using views in my web application, but i think that if i will use view users could not to edit data.
October 24, 2011 at 7:52 am
Is that a limitation in the ASP code?
In SQLServer, under many circumnstances, views are updateable, so it would be no problem.
-- Gianluca Sartori
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply