473,856 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to save changes to datagrid from a Windows form in vb.net

I'm new to the VB.net world and have been reading alot of books and threw newsgroups
Is it even posable to save user input from a form to a data grid. I could just edit the data gri
but would prefer useing the user form to import the data

Any help would be greatly appreciated

Thanks
Homey
Nov 22 '05 #1
4 2987
Cor
Hi Homey,

Can you explain this a little bit more because?.

A datagrid is a so called control on a dataform that can hold data on a
form.
A dataform it self has no property that can hold input data.

Cor
I'm new to the VB.net world and have been reading alot of books and threw newsgroups. Is it even posable to save user input from a form to a data grid. I could just edit the data grid but would prefer useing the user form to import the data.

Any help would be greatly appreciated!

Thanks,
Homey

Nov 22 '05 #2
Hi Cor, Thanks!
I take it the data in thedatagrid is just a image of what has been
imported from the dataSet and theDataSet is just an image of the
database. What do I need to do to use a user form to add information to
the dataset and from there update the database? I see I can bind the
text box to the dataset but how do I import that data from the textbox
to the dataset? I might have rambled a little there.

Homey

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 22 '05 #3
Cor
Hi William,

What you are writing is true.
The sequence (one of the possibilities)
A database -> a dataset -> a control -> a dataset -> a database

A datatadapter.fi ll -> a dataset -> a datagrid.dataso urce -> a dataset -> a
dataadapter.upd ate
A datatadapter.fi ll -> a dataset -> binded textboxes -> a dataset -> a
dataadapter.upd ate

With the datagrid everything goes automaticly. Although there are some
strange things one of them not to forget is that you always have to say
"endcurrentedit " (have a search for that if you needed it) to get the last
datagrid change into the dataset.

With the textbox you have to bind that textbox text to the dataset telling
wich column is used (The syntax is almost the same as I write in natural
language above)

You go than through the textbox using the currencymanager position , have
also a look for it, it tells which row in the dataset is the current row,
(it has nothing to do with money, as some think).

I hope this helps a little bit.
Hi Cor, Thanks!
I take it the data in thedatagrid is just a image of what has been
imported from the dataSet and theDataSet is just an image of the
database. What do I need to do to use a user form to add information to
the dataset and from there update the database? I see I can bind the
text box to the dataset but how do I import that data from the textbox
to the dataset? I might have rambled a little there.

Homey

Nov 22 '05 #4

Thanks again Cor,
I did a little more reading this morning and with your help I now
understand what the structure is alot better.
I noticed the DataGrid is realy just a place holder for the dataView
that can be minipulated to hold multiple DataBase tables in the
DataGrid. I'll work with this and figure it out. Thanks again you've a
great help.

Bill
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 22 '05 #5

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

Similar topics

4
560
by: HomeyDaClown | last post by:
I'm new to the VB.net world and have been reading alot of books and threw newsgroups Is it even posable to save user input from a form to a data grid. I could just edit the data gri but would prefer useing the user form to import the data Any help would be greatly appreciated Thanks Homey
2
3281
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you use the F2 key to enter edit mode and then hit TAB or ESCAPE without actually editing the value, dotnet crashes with a null reference error.
4
10978
by: Angel | last post by:
How can I update the datatable with the datagrid values after the datagrid itself has been modified.? I assume it's not automatically done. Thanks.
2
2316
by: deko | last post by:
I create an XmlDataDocument Dataset when the main form of my WinForms app opens. The user will make changes to the Dataset, and then those changes should be saved to the XML file when the code runs xdd.Save(xmlFile). But I get an error when I try to save the Dataset back to the XML file: "The process cannot access the file "C:\Projects.xml" because it is being used by another process." Is this because I'm in Debug mode? How do I persist...
2
4830
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different row selected in the datagrid. I want to save the changes that user make in the textboxes when they select a different row in the datagrid. I tried capturing the textbox.text at datagrid's CurrentCellChanged event but by then the textbox.text...
0
1292
by: tafs7 | last post by:
Hello, I have a custom datagrid control that works great. But I was thinking about adding some functionality to it. Currently, I use the datagrid to display one record at a time, and with item templates, if you click the edit button, the datagrid becomes a nice form to make changes. Kinda like a big rolodex, and as you page you flip thru each record individually. My question is this: how can I have some kind of server side script
1
1323
by: jaYPee | last post by:
I have downloaded the 101 Code Samples for Visual Basic .NET 2002. I've seen "VB.NET - Data Access - Build a Master-Detail Windows Form" that really helps me a lot. but the problem is i don't know how to edit the 2 datagrid and save the changes i made. any help for this topic is highly appreciated. thanks in advance
0
3636
by: Patty05 | last post by:
I have a datagrid on a form that update properly when form loads. When the program runs and I type in/add a new row in the datagrid, it does not save the changes. Any help would be greatly appreaciated. Thanks. Code below: Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "
4
2000
by: nch1978 | last post by:
I am new to programming and am sorry if this post is in the wrong area. I have a listbox bound to a table and a datagrid bound to another one with a connection through xml. I can change the data within the grid, with the following through a button on a different tab page within the form, but it does not save changes to the database, just shows them on the datagrid until the program is closed: 'Temporary Datasets to store the inserted or...
11
4149
by: gyap88 | last post by:
Hello i m using vb 2005 express to do my project. I m suppose to create a datagrid to allow user to make changes to the database. The program display the database in a datagrid where users can juz make changes there. I encountered a problem when user are trying save changes. The following code is executed when the save button is click: Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click ...
0
9920
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
11063
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
10699
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
10390
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7932
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
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
5762
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4580
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
4176
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.