Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Data binding question

Posted on 2006-10-30
5
Medium Priority
?
220 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 1500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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