473,434 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Update datagrid

I Apoligize for my writing but I speak spanish.
I'm starting with the datagrid and I want to know how I can to update
a datagrid after update a database. I want to do this without leave
the datagrid screen. I was doing with refresh and some more
instruction but I can't do it. Please help me.
Nov 21 '05 #1
2 3940
Fabian,

I assume you are using a windowforms datagrid.

That you never update direct with code (you do it typing however I think
that is not what you ask).

In a windowforms datagrid you have always to update the datasource, which is
a datatable probably filtered by a dataview.

By the way there are a lot of non native English speakers active in this
newsgroup. So do not apoligize for your writing.

I hope this gives some ideas?

Cor
I Apoligize for my writing but I speak spanish.
I'm starting with the datagrid and I want to know how I can to update
a datagrid after update a database. I want to do this without leave
the datagrid screen. I was doing with refresh and some more
instruction but I can't do it. Please help me.

Nov 21 '05 #2
JBK
OK assuming that you are binding the datagrid to a dataset. Call the dataset
ds1, the dataadapter da1 and the datagrid dg1 and assuming that you have
generated the dataset using the wizard in the forms editor.

dim ds2 as new ds1
da1.fill(ds2)
dim dsChange as dataset
-------------------------------------
in form load---------------
dg1.datasource = ds2.mytablename
--------------------------------------
in a button_click event

dim dsChange as dataset

if ds1.haschanges then
dsChange = ds1.getchanges
da1.update(dsChange)
ds1.acceptchanges
end if

------------------------------------------
create a button called save or update and put the button_click code in there
you can use datatables too

bryan

"fabian" <fa*************@earthlink.net> wrote in message
news:54**************************@posting.google.c om...
I Apoligize for my writing but I speak spanish.
I'm starting with the datagrid and I want to know how I can to update
a datagrid after update a database. I want to do this without leave
the datagrid screen. I was doing with refresh and some more
instruction but I can't do it. Please help me.

Nov 21 '05 #3

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

Similar topics

2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
3
by: D. Shane Fowlkes | last post by:
I have a Datagrid which in theory, should allow you to edit and update the records. I've stripped my test page down so that it's only attempting to update one field - "description". Yet when I...
4
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
4
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft...
3
by: Larry Woods | last post by:
I have a datagrid that is carrying all fields of a record...except one. Now I want to update the underlying database via a dataadapter. The update is working but the field that is "left out" is...
5
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
1
by: geeteshss | last post by:
Dear all, actually i spent a whole month on the R&D of datagrid edit ,update,cancel events but recently my guide told me to make it user friendly because no user would like to go on searching rows...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.