•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,584 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,650 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 248 | Replies: 6 | Solved
![]() |
•
•
Join Date: May 2008
Posts: 23
Reputation:
Rep Power: 1
Solved Threads: 0
Scenario: I have 2 gridviews, clientgridview for showing the clients and the projectgridview for showing the projects. If I Click on the Client name on the the clientgridview i will be directed to the project gridview to show the different projects of the client
Problem: when i click on the name of my client, projectgridview displays all the projects that are stored on my database. I need to display only the projects that are associated to the selected client(ProjectId is the PK in m ProjectTable and is FK in ClientTable).
Can anyone help me get the corrent syntax to filter the projectId...
SELECT * FROM Project WHERE ProjectId=@Project;
I used this syntax and it didnt work..hope you guys can figure out how to filter this correctly..
Problem: when i click on the name of my client, projectgridview displays all the projects that are stored on my database. I need to display only the projects that are associated to the selected client(ProjectId is the PK in m ProjectTable and is FK in ClientTable).
Can anyone help me get the corrent syntax to filter the projectId...
SELECT * FROM Project WHERE ProjectId=@Project;
I used this syntax and it didnt work..hope you guys can figure out how to filter this correctly..
Last edited by fayenot : Jun 2nd, 2008 at 3:06 am.
•
•
Join Date: Mar 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 7
hi,
in projects table there should be a coloumn like clientid.so if u click on client naem just pass client id.and write query like this
...so this will filter the projects according to client.hope this wil help you,.thanking you.
in projects table there should be a coloumn like clientid.so if u click on client naem just pass client id.and write query like this
select * from project where clientid=@clientid
•
•
Join Date: May 2008
Posts: 23
Reputation:
Rep Power: 1
Solved Threads: 0
hi there..
thanks for the reply but unfortunately it didnt work for me..i believe there still a code that needs to be added on the selecting event of the datasource(that's only my opinion) but if you guys have some different idea aside from using a sql syntax please feel free to reply in this post...thanks
thanks for the reply but unfortunately it didnt work for me..i believe there still a code that needs to be added on the selecting event of the datasource(that's only my opinion) but if you guys have some different idea aside from using a sql syntax please feel free to reply in this post...thanks
Ur coding is right!, but you need to pass the correct client id to the variable @project, I want to know the structure of your master and child table.
If you got your answer, please mark the thread as Solved.
Thanks & Regards,
RajaRajan. R
rajarajan07@rediffmail.com
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
- Filtering My sql through Php using drop down menu and text field (PHP)
- filter recordset with checkbox using SQL (Visual Basic 4 / 5 / 6)
- How does views work in MS SQL (MS SQL)
- Office XP/2002 Access not filtering (MS Access and FileMaker Pro)
Other Threads in the ASP.NET Forum
- Previous Thread: Element 'html' cannot be nested within element 'div'
- Next Thread: Comparing data from database using LINQ


Linear Mode