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

Update Data in an Access Database with ASP.Net C#

Hi all,

im totaly new to forums and this is my first post ever to please excuse if the form isn't correct.

I have big problems to understand the complete correlation of dataset, dataadapter and so on.

My Exact problem:
I have an access Database from where I want to read some data, give the user the possibility to change and write back to tha Database.

My actual Try:

String myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\\Projekte\\Vstudio\\WebSites\\Freischalt ung\\db\\P_AC.mdb";
// Object erzeugen
OleDbConnection myConnection = new OleDbConnection(myConnectionString);
//Verbindung öffnen
myConnection.Open();

//SQL statement in Variable


OleDbDataAdapter myAdapter = new OleDbDataAdapter();
string mySelect = "SELECT [LfdNr], [KdNr], [Firma] ,[Anrede] FROM [Aktivierungen] WHERE ([LfdNr] = 1)";
myAdapter.SelectCommand = new OleDbCommand(mySelect, myConnection);
string mywrite = "UPDATE [Aktivierungen] SET LfdNr=?, KdNr=?, Firma=?, Anrede=? WHERE ([LfdNr] = 1)" ;
//string mywrite = "UPDATE Aktivierungen SET LfdNr = @LfdNr, KdNr = @KdNr, Firma = @Firma,Anrede = @Anrede WHERE (LfdNr = 1)";
myAdapter.UpdateCommand = new OleDbCommand(mywrite, myConnection);
DataSet mydataset = new DataSet();
myAdapter.Fill(mydataset,"Aktivierungen");
mydataset.Tables["Aktivierungen"].Rows[0]["KdNr"] = "12345";
myAdapter.Update(mydataset, "Aktivierungen");

When I try this I get the Errormessage:
Für mindestens einen erforderlichen Parameter wurde kein Wert angegeben
(translated: for at least one necessary parameter was no value given)

I try to find a solution since about 2 days and tried all forums and books I can find but up to now nothing helps.
Jul 12 '07 #1
0 2101

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

Similar topics

12
by: jimserac | last post by:
I had previously posted this in an Access forum with negative results so will try here. Although this question specifies an Access database, I also wish to accomplish this with a large MS SQL...
2
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
1
by: Darn | last post by:
Hi all How do i solve this problem. I'm web developer from Malaysia, the problem occurs when i ftp an Access database which i'm using for this particular web site for it's database.The form...
2
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
2
by: Ville Mattila | last post by:
Hi there, I will post my question to this group too bacause the .data group seems to be rather quiet. I've been playing with VB.NET and ADO for a week now and find the different data handling...
4
by: George | last post by:
Hi all, I am having trouble with updating my data in an Access database. here is my code: Imports System.Data.OleDb Dim AppPath As String = Mid(Application.ExecutablePath, 1,...
6
by: Tark Siala | last post by:
hi i'm using VS.NET 2005 +SP1 C#, and i connect access database by ADO.NET 2.0. i'm using Dataset to (insert,update,delete) and in get data i use (Datareader), but my problem when i do this: 1 -...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.