473,383 Members | 1,792 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,383 software developers and data experts.

Saving Data from DataGridView into Database.

80 64KB
Hey guys,

I've been playing with this for a few days now and just can't seem to get it working.

I'll explain what I have to do:
Open a file and read it in to the datagridview (done)
Save data into the database. <- what I need help with

So what I've tried
Expand|Select|Wrap|Line Numbers
  1. private void btnUpdate_Click(object sender, EventArgs e) //TODO: Update Database met gegevens die zijn toegevoegd.
  2.         {
  3.             try
  4.             {
  5.                 connect.Open();
  6.                 dAdapter.Update(dTable);
  7.             }
  8.             catch (Exception ex)
  9.             {
  10.                 MessageBox.Show(ex.ToString());
  11.                 btnUpdate.Enabled = true;
  12.             }
  13.             finally
  14.             {
  15.                 connect.Close();
  16.             }
  17.         }
But this doesn't work, I don't get an error from the exception it just doesn't save. If someone would help it would be awesome.

Michael
Feb 18 '13 #1
0 1591

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

Similar topics

0
by: Tommy Christian | last post by:
Hi! Anyone who knows about saving serialized data to database, coz I have a problem with that. If I just serialize my session data and then deserialize it, it works. But when I save it...
5
by: Tony | last post by:
Ok. im new to programming. and sorry for fuzzy discription :) I am using a program called leechget. this is download manager that i use on the net. When i add a dowload , i can see the information...
1
by: pmclinn | last post by:
I have a formated a structure as follows: <Serializable()>public structure stcOutPut private data as string private visi as string end structure Instances of this strucuture are stored in an...
0
by: RSH | last post by:
Hi, I have created a WinForm that uses a series of dynamic DDLs to select Databases/tables and then loads the data into a DataGridView. The 2.0 Datagridview allows users to reorder columns etc...
1
by: Magnus | last post by:
I'm testing walkthrough saving data to a Database (Multiple Tables). http://msdn2.microsoft.com/en-us/library/4esb49b4(VS.80).aspx In the famous Customer/Order example, I'm getting referential...
3
by: csharpa | last post by:
Hi, I’m using VS2005 and I’m trying to link the C# windows form to MSSQL. I used BindingNavigator Control to read the data. After that I add sqlcommand and sqldataadapter to send the data to the...
0
by: =?Utf-8?B?QkFUT04=?= | last post by:
I have realy big problem I try lot of things but never success! I need a HELP! Problem is in that I made database in Microsoft access and connect her to C# form and datagridview. and it...
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I made web site using asp.net 2.0 Vb.Net. The project depends on database in the local machine. The web site has • Create User Wizard and • Login form When the user is...
2
by: Zeljko Bilandzija | last post by:
Hi, can somebody help me in this? I want to insert some data in table on this way; i have button, and in Button_Click event handler i have integer variable with some data (for example,...
1
by: Limno | last post by:
Can anyone suggest me how to pass datagridview data to database. Process must be like this, if the user enter multiple data into the datagridview after user press "save" button, datagridview data...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.