473,910 Members | 4,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#, grid and databinding

Hi,

Let's say that I bind a grid to a dataset populated from the content of
a DB table.

1- Does this grid will be updated if the content of the DB table is
modified?

2- Does DB table content can be modified by the grid content?

Thanks!
Marty
Jan 3 '06 #1
2 2673
Neither of these will happen for you - how could they? You bound that data
to a dataset - this is just whatever you retrieved from the database. But, a
dataset is just some rows/columns - it doesn't have to come from a database,
it doesn't know how it got populated, from what data source, how it can
update the data source, etc. The dataset could have been returned from a
web service, or populated manually, etc - there is no way for the dataset to
figure out where and how it should update when the user changes something on
the grid bound to the dataset. There is also no way for the dataset to
somehow monitor the database automatically waiting for changes - not to
mention all the possible problems you could have if the user updated a row
in the grid that now got updated in the database, and how to resolve this.

The list of reasons why this could never just happen automatically goes on
and on...

"Marty" <xm******@hotma il.com> wrote in message
news:roAuf.2976 9$m05.14240@clg rps12...
Hi,

Let's say that I bind a grid to a dataset populated from the content of a
DB table.

1- Does this grid will be updated if the content of the DB table is
modified?

2- Does DB table content can be modified by the grid content?

Thanks!
Marty

Jan 3 '06 #2
Hi Marina,

Thank you for your reply. I should have ask, "what is the best way to
do it?" :)

Do you have a link or tutorial I could read on the subject?

Thank you!
Marty


Marina wrote:
Neither of these will happen for you - how could they? You bound that data
to a dataset - this is just whatever you retrieved from the database. But, a
dataset is just some rows/columns - it doesn't have to come from a database,
it doesn't know how it got populated, from what data source, how it can
update the data source, etc. The dataset could have been returned from a
web service, or populated manually, etc - there is no way for the dataset to
figure out where and how it should update when the user changes something on
the grid bound to the dataset. There is also no way for the dataset to
somehow monitor the database automatically waiting for changes - not to
mention all the possible problems you could have if the user updated a row
in the grid that now got updated in the database, and how to resolve this.

The list of reasons why this could never just happen automatically goes on
and on...

"Marty" <xm******@hotma il.com> wrote in message
news:roAuf.2976 9$m05.14240@clg rps12...
Hi,

Let's say that I bind a grid to a dataset populated from the content of a
DB table.

1- Does this grid will be updated if the content of the DB table is
modified?

2- Does DB table content can be modified by the grid content?

Thanks!
Marty


Jan 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2078
by: kk | last post by:
I have 2 issues, please help ! 1st issue : -------------------------------------------------------- Loading Grid ------------ 1) creating new rows in a datatable and adding data a array list to datatable.
5
2383
by: sdbranum | last post by:
I have been using Visual C#.NET to code a large project having many data adapters, data sets, datagrids, multiple forms with tab pages, each containing various controls (mostly label, text boxes, check boxes, date pickers, combo boxes and datagrids). I have been coding alone on this project for about a year, and I have experienced many problems which have not been addressed by various SP's, including the recent SP1 to Framework.NET 1.1,...
2
2080
by: Kenneth | last post by:
Hi, I want to make sure I got the easiest way on how to bind a grid's datasource to a datatable. I've made an in-memory datatable Dim dtTotal As DataTable Dim drow As DataRow dtTotal = New DataTable("Total") ' Add two columns
0
1170
by: Simon | last post by:
I've created several columns at run time and added these to my datagrid using the following: Select Case templateType Case ListItemType.Header lc = New Literal lc.Text = "<B>" & columnName & "</B>" container.Controls.Add(lc) Case ListItemType.Item myLabel = New Label
3
1402
by: Sivaprasad | last post by:
Hello, Can anybody suggest me, which is the best grid that can be used in ASP.Net. The main functionality I'm looking for is I shoud be able to do heirarchical view of data. Need to do a row merge and column merge. And i dont' want to bind to anything. Similar to Video flex grid ( Now component one)
1
1799
by: larry mckay | last post by:
Hi, I'd like to use a datagrid with a 1. most grid's use SQL data adapters as a datasource. I'd like to use a parametrized query into a stored procedure (specifically a sqldatareader) instead of using the data adapter. does anyone have any code samples that will do this? I'm looking for gridname.datasource = mydatareader (if this is possible) where the sqldata reader returns a result set from a parametrized stored
4
1071
by: Atley | last post by:
I am using VB.net Ent Arch 2003. I have a dataset that was made through the wizard to create a Windows Data Form I have a DataGrid to show/edit the table from my DataSet. I want to: Be able to choose the subset of data from the table and then have that
3
9586
by: vineetbatta | last post by:
I have Custom Data class which stores data about single customer and then i store that customer objects in arraylist as shown below. Customer custdata = null; // Custom Data class for 1 customer data. ArrayList ar = new ArrayList(); // To store more than one customer object. for (int x = 0; x < 30; x++) { custdata = new Customer();
2
1843
by: Roger Frei | last post by:
Hello ng, I have a datagrid that is bound to a datasource. That works good so far. Now I want to add another column to my grid dynamically. That also works good until the first postback. The column is still there but for some reason its content is empty. I added the code underneath this post. The problem is that the delegate CreateCellTemplate is not called anymore. But why? I can't understand.. :-( Viewstate is enabled for the grid. ...
0
10037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9727
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4337
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.