Last post Dec 29, 2008 03:44 PM by sjnaughton
Dec 20, 2008 05:46 PM|mjta|LINK
I am setting up dynamic data website according to Joe's dynamic data video tutorials in
www.asp.net ........I can't figure out and I'm not experienced enough to know better how to set up a filter or whatever it takes to only show records for the logged in user...I think it takes a column in a table of the records
I want to retrive, but I don't know how to code the event....
also.....see a previous post I have about this.....I'm just narrowing it down as much as I can....thanks
Dec 22, 2008 09:19 AM|sjnaughton|LINK
I have two articles on my blog depending on whether you are using DD with Linq to SQL or Entity Framework?
This one for the Entity Framework (EF) bits
DynamicData - Automatic Column Update For Entity Framework
And this one for Linq to SQL (L2S)
Automatic Column Update
And this one for adding filtering to the page.
Limit the Filter Fields
Hope this helps [:D]
Dec 22, 2008 10:49 AM|mjta|LINK
That should probably help, but the drawback is it is a above my head...I'll look more closely at it and try to make sense of it....for I'm just a little ol' bean counter trying to add some sophistication to my existence.
Dec 22, 2008 10:54 AM|sjnaughton|LINK
Let me know what you are using (Linq to SQL or Entity Framework) and I'll post you working example if you like. [:D]
Dec 22, 2008 11:42 AM|mjta|LINK
Dec 22, 2008 12:48 PM|sjnaughton|LINK
I've never looked at that but I asume it will generate Linq to SQL dbml files etc. So I post a sample in a day or so [:D]
Dec 22, 2008 01:02 PM|sjnaughton|LINK
well here's one (in good old Blue Peter tradition) that I prepared earlier I just ran it up and tested it so it's good [:D]
Give that a go and let me know if its ok.
P.S. it's in SQL Server 2008 Express [:(]
Dec 28, 2008 03:59 PM|mjta|LINK
error that the database is version 655 and mine is 612. Any quick fix to this?...Or send me the database specs and I'll reconstruct it....thanks
Dec 28, 2008 07:15 PM|sjnaughton|LINK
If your running SQL Server 2008 the you still have a prerelease on you system, I know as I was in the same position until recenly [:D]
Dec 29, 2008 10:26 AM|mjta|LINK
thanks for your help. I have a couple of questions...
1. wouldn't happen to have it in VB, would you?
2. Where in the code does the user filtering take place?
Dec 29, 2008 11:52 AM|mjta|LINK
I am trying to filter records by userID....take a look at the changes I am trying to use below for the userID filter and see if you can offer anything....
I get stuck at the line....GridDataSource.WhereParameters.Add(parameter(currentUserID);
table = GridDataSource.GetTable();
Title = table.DisplayName;
GridView1.PageIndex = 0;
Dec 29, 2008 12:52 PM|sjnaughton|LINK
Over the next couple of days I will try to know up a VB version and test it [:D]
Dec 29, 2008 02:27 PM|mjta|LINK
Another thing I'd like to ask....Why are you using Created By (UserName) to filter records instead of UserID? Is there some advantage to this?
Dec 29, 2008 03:44 PM|sjnaughton|LINK
Quick and dirty code [:D], it's just for demo. Someone asks a question and I build a solution tending to concetrate of whats easyest to understand (well hopefully) [:D]