473,387 Members | 1,492 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,387 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 2105

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 -...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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,...

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.