Solved

Data binding question

Posted on 2006-10-30
5
217 Views
Last Modified: 2010-04-16
Hi experts,

I want to create a simple windows form using VS2005 C# 2.0 to do the following:
1) It has a binding navigator, a group of radio buttons to filter records and a datagridview control.
2) they are all bind to a single table in SQL server.
3) the radio button is to filter groups of records in the table.
4) the navigator has add, delete and save button to allow user to insert,
        update,delete and save the changes back to the table (based on the
        filtered critria).
       
Could you advice on the steps to do the above?
Your help is appreciated.
0
Comment
Question by:michellechan57
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Mihai Stancescu
ID: 17840136
I think will be helpful if you create you select base on the radio selected.
I mean, for example, you can do this:
 if (radio1.Checked)
 {
     sqlString = "select top 10 * from Table1";
 }
and so on... (depending on how many radio buttons you have, and how many filters you can create on that table...)

And then you can use this string to pass it to the SqlCommand component.
Afterwards you can use the binding navigator to add, delete, or update the records...

Hope helps.
Regards,
Mishu  
0
 
LVL 3

Accepted Solution

by:
zajda82 earned 500 total points
ID: 17840578
I would put one layer between SQL data and DataGrid.

Bind data between SQL and DataView object. DataView has a RowFilter property, which could help you to apply your radio buttons filters. Then set this DataView as a DataSource of your Grid.
0
 

Author Comment

by:michellechan57
ID: 17840660
Sorry guys, appreciate if you can elaborate a bit more. Thanks.

0
 
LVL 11

Expert Comment

by:Mihai Stancescu
ID: 17840706
You need a code example?
0
 

Author Comment

by:michellechan57
ID: 17842543
If it helps to understand.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question