473,508 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c# Database Problem

7 New Member
I have a lil problem , maybe someone here can help me ?
i have an access database called "UserDetails".
I can Write to it , i can read from it , all is good .
now i wana Update some fields in it , maybe even a full row , i dont really mind .
so my code goes like this :
Expand|Select|Wrap|Line Numbers
  1. string stAccessConn = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=TestDriveDatabase.mdb";
  2. OleDbConnection DBconn = new OleDbConnection(stAccessConn);
  3. OleDbCommand MyAccessCommand = new OleDbCommand(stAccessSelect, DBconn);
  4. OleDbDataAdapter MyDataAdapter = new OleDbDataAdapter(MyAccessCommand);
  5.  
  6. DBconn.Open();
  7. DataSet myds = new DataSet();
  8. MyDataAdapter.Fill(myds, "UserDetails");
  9. myds.Tables[0].Rows[1]["FirstName"] = "******";
  10. OleDbCommandBuilder mybuilder = new OleDbCommandBuilder(MyDataAdapter);
  11. DBconn.Close();
it looks like it all works , yet the file wont change !! :(
anyone ??
Jul 11 '07 #1
4 971
weaknessforcats
9,208 Recognized Expert Moderator Expert
Moving this to the Access forum.
Jul 11 '07 #2
JKing
1,206 Recognized Expert Top Contributor
Hi it's been a while since I've used C# but I think see a probelm in this line:
Expand|Select|Wrap|Line Numbers
  1. myds.Tables[0].Rows[1]["FirstName"] = "censored";
  2.  
Do you not need a .(dot) between Rows[1] and ["FirstName"]?
Jul 11 '07 #3
NeoPa
32,557 Recognized Expert Moderator MVP
Please do NOT use obscene language in these forums.
I am locking this thread, so if JKing's answer is not to your liking I suggest you repost the question without the obscenity.
Jul 11 '07 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
This question is being moved to the .NET forum. It doesn't belong in the access forum.
Jul 11 '07 #5

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

Similar topics

5
3024
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
7
12643
by: Graham Taylor | last post by:
I've tried posting this in the 'microsoft.public.access' but I will post it here also, as I think it might be the webserver which is causing my problem. --------- I have an Access 2003 database...
2
2672
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing...
19
5405
by: adirat | last post by:
I have read a lot on this subject on newsgroups and other access related websites on data corruption, but since we are still not able to isolate the problem – I am posting this detailed explanation...
15
2526
by: philip | last post by:
On a form, I have a datagridview. This datagridview is constructed on a dataset filled by a tableadapter. The table adapter do very well what it must do when filling dataset. Insertions,...
9
3815
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
18
9106
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
6
6598
by: xeqister | last post by:
Greetings, We are having a situation here whereby one of our staff created a very huge 32K buffer pool in a production database and caused the database to go down. When we try to reconnect to the...
12
6230
by: Steve | last post by:
I have a database that raises an error when you try to open it and it doesn't open. Trying to open the database with the OpenDatabase method raises the same error. Trying to import any objects...
4
2713
by: raidvvan | last post by:
Hi there, We have been looking for some time now for a database system that can fit a large distributed computing project, but we haven't been able to find one. I was hoping that someone can...
0
7231
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
7132
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
7401
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...
1
7063
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
7504
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...
1
5059
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
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.