473,406 Members | 2,894 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,406 software developers and data experts.

Save changes in datagrid

I typed this codes in a button, but this codes not work:
Expand|Select|Wrap|Line Numbers
  1. Dim Save As New DataSet
  2. Save = BGKCDataset.GetChanges()
  3. Try
  4.   If Not (Save Is Nothing) Then
  5.     BGKCCentralDatasSqlDataAdapter.Update(Save)
  6.     BGKCCentralDatasSqlDataAdapter.Fill(BGKCDataset.Tbl_BGKCCentralDatas)
  7.   End If
  8. Catch ex As Exception
  9.   MsgBox(ex.Message)
  10. End Try
Can you help me save changes in this problem?

Thanks
Aug 9 '12 #1
1 1562
Frinavale
9,735 Expert Mod 8TB
Well I'm not sure why it's not working.
Did you check the database and it isn't updated?
Did you get some sort of exception when running the code?
What is the error message?

The only thing that I noticed is that you are declaring a Save as a New DataSet when you don't need to.

You could just have:
Expand|Select|Wrap|Line Numbers
  1. Dim Save As DataSet = BGKCDataset.GetChanges()
  2. Try
  3.   If Not (Save Is Nothing) Then
  4.     BGKCCentralDatasSqlDataAdapter.Update(Save)
  5.     BGKCCentralDatasSqlDataAdapter.Fill(BGKCDataset.Tbl_BGKCCentralDatas)
  6.   Else
  7.     MessageBox.Show("There were no changes")
  8.   End If
  9. Catch ex As Exception
  10.   MsgBox(ex.Message)
  11. End Try
Please post more details about what the problem is so that we can help you more.

-Frinny
Aug 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
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...
1
by: DFS | last post by:
I'm using a query as the SourceObject for a subform. When I change any of the column widths and try to close the form I'm prompted to save changes to the layout. Anyone know how to suppress...
0
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...
4
by: keithb | last post by:
How can an application change settings in the web.config file? I need to allow users to configure SMTP email settings with functionality similar to that provided developers by the ASP.NET Web Site...
0
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...
2
by: =?Utf-8?B?RGlvZ28gQWx2ZXMgLSBTb2Z0d2FyZSBEZXZlbG9w | last post by:
Greetings to you all I have a listbox with some data loaded from the database... When I select each record, it will fill a form that I have in the same window... What I wanted is that when...
2
by: vibee | last post by:
fairly simple question but dont know how to do it...how do i prompt the user to ensure that the user wants to save changes made to an entry. thanks
11
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...
2
by: cj | last post by:
Dim myExcelConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & filename & "; Extended Properties=""Excel 8.0""") Dim myExcelSqlCommand As String...
0
by: josef gonjales | last post by:
dear sir i am new to vb.net, i am using visual studio 2010 academic version and ms access 2007 .I have draged textboxes and a datagrid to win form and able to insert/delete textbox inputs into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.