Solved

What are the ways to display/update grid data using WinForms and WebForms?

Posted on 2008-10-03
2
349 Views
Last Modified: 2013-12-17
I want to play with creating a grid view for WinForms and WebForms which both give me read access to table data, but also to empower the user to  update by way of that same control.

Which of  these is read only?  Which allow me to write the data back to  the database.  I expect to set the Data Source to a DataSet.

Please tell me which controls do what type of  data access.  Also, how do I write the changes back to the DataSet, then force the DataSet to update the database?  Using C#.NET 2.0.


Thankls,
newbieweb


A web page can have a:

GridView
DetailsView
FormView

A WinForm can  have a:
DataGridViewer
ReportViewer
0
Comment
Question by:newbieweb
[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 Comments
 
LVL 5

Accepted Solution

by:
gemailj earned 250 total points
ID: 22640357
there a great difference between GridView (web) and DataGridViewer (Windows) because the nature of the web application is completely differ than Win application

you can make all your change in DataGridViewer and if the datasource of it is a dataset and the DataGridViewer allows editing and insertion the DataGridViewer write all changes to the dounded DataSet
the you can Call GetChanges() to Update them ---- this is the win apps disconnected scenario

but the GridView (web apps) the disconnected scenario is not applicable
you have to make the data change directly to the database
objDataAdapter.Update(ds.GetChanges()); //winforms
 
 
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {
            con.Open();
            SqlCommand cmd = new SqlCommand();
            //add the parameters values
            cmd.ExecuteNonQuery();
        }
        finally
        {
            con.Close();
        }
    }

Open in new window

0
 
LVL 6

Assisted Solution

by:RishadanPort
RishadanPort earned 250 total points
ID: 22640372
I am pretty sure that all of these WinForms have the ability for read and write access such that it also effects the Data Source.

I have used a DataGridView, and I am positive it has the ability of what you are trying to achieve, here is an example that uses DataGridView that binds the data to a data set

http://blog.paranoidferret.com/index.php/2007/09/05/c-tutorial-binding-a-datagridview-to-a-database/
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

628 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