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

How to update dataGridView and also update database?

6
i have this code:

Expand|Select|Wrap|Line Numbers
  1. string conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Khai\\Documents\\MyNum…
  2. string queryM = "SELECT * FROM magnum WHERE todayDate = #" + pickedDate.Date + "#";
  3. OleDbDataAdapter dAdapterM = new OleDbDataAdapter(queryM, conString);
  4. OleDbCommandBuilder cBuilderM = new OleDbCommandBuilder(dAdapterM);
  5. DataTable dtableM = new DataTable();
  6.  
  7. dAdapterM.Fill(dtableM); 
  8. BindingSource bSourceM = new BindingSource();
  9. bSourceM.DataSource = dtableM;
  10. magnumView.DataSource = dtableM; 
  11.  
  12. dAdapterM.Update(dtableM);

when the data on the dataGridView change, the original database also update by it self, but it cant be done.. i have search for many place.. but didn get the thing also
May 29 '10 #1
1 2732
PRR
750 Expert 512MB
Could you be more clear? Can you clearly define what you want to do?
May 31 '10 #2

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

Similar topics

6
by: Fred Geurtsen | last post by:
Question about updating a access Database Record! Normally i'm working with SQLserver, but i have to do this with access and it's not working. My error is: Operation must use an updateable query....
7
by: Arne Beruldsen | last post by:
When I go to update my datagridview...I get this error Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information. ...
2
by: Sid Price | last post by:
I have an application that has already been deployed and we need to add a new column to some of the tables in the application database. We are using an access database. We have a solution working...
1
by: blazinjoe1 | last post by:
Hey guys, I have tryed something new code with updating an access database but the error Syntax error in UPDATE statement occurs every time i try to update. Can some please help me figure...
1
by: dillipdhal | last post by:
Hi This is Dillip from HSBC Software,Hyd. Now I m working in a financial domain. Please help me in "How can I insert data from a datagridview to database in vb .net and also retrive the data "
0
by: Pascal | last post by:
Hello I began with vbnet and databinding. I created a database containing a table access Students. In a form frmListEleves I slipped and deposited the table in question and a datagridview was...
1
by: MFayaz | last post by:
Hello! I have to refresh datagridview when database update , IS there any way to solution that my datagridview auto refresh when any user update database. Thanks in Advance
5
by: sreenu123 | last post by:
Hello All, Here's what I'm trying to do: I'm loading a datagridview with data from a dataset. I want to be able to update data in the datagridview and then save changes back to the dataset or...
3
by: sachinkale123 | last post by:
I am using SQL Adapter to select data from a table in SQL Server Database. After creating Object I am filling that to a datatable. Assum that dataset has 5 row. After that I m updating that dataset...
2
by: crownrajesh | last post by:
First of all thanks for all who reply this Question.i have a datagridview with first column as combobox and rest as textbox column. i would like to fill the datagridview manually using c# code for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.