Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now