Solved

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

Posted on 2008-10-03
2
341 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Latency in .net app using DB in .net 21 65
Show/Hide ASP.NET controls with JQuery best practices 3 47
What namespace do I need to import? 2 29
.NET 2008 VB and C# 6 27
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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