473,490 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OleDbCommand Problem

Hi

I have the following Problem:

I have an Access DB.

Tablename: Formate;

TableColoumns: ID (=Numeric)
Name (=string)

I wrote a Console Application to SELECT, INSERT, UPDATE the Table.

string oleConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=.......\FormatTest.mdb";

string update = "UPDATE Formate SET Name = @text WHERE ID = 1";

OleDbConnection oleConnection = new OleDbConnection(oleConnectionString);

OleDbCommand oleCommand = new OleDbCommand(update,oleConnection);

oleCommand.Parameters.Add("@anyValueName",999);
oleCommand.Parameters.Add("@text","Test Entry");

try
{
oleConnection.Open();
oleCommand.ExecuteNonQuery();
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
if(oleConnection.State == ConnectionState.Open)
oleConnection.Close();
}

After that I looked into the Table and the Updatequery wrote 999 instead of
"Test Entry" in the Table.

I tried the same with the Sql Namespace and a Table in a SQL Server and the
Update was correct.

Has anybody an idea??
Nov 13 '05 #1
0 2918

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1027
by: jerim | last post by:
Hi I want to run an Updatequery against my Access DB, but it writes the false Value into the Table. Code: string oleConnectionString = "Provider=........"; string update = "UPDATE...
2
2677
by: Christopher | last post by:
Could Anyone help me! I'm currenly working on an application which involves SQL Statements. And my current problem is that when i execute the SQL statement on MS Access 2003 the Insert Statement...
0
1050
by: Tom Wild | last post by:
Hi I am creating a webform in VB.Net which connects to an Access database. I can get the webform to connect to the database fine and also to download data but when I try and update the...
1
2021
by: Simon Harris | last post by:
Hi All, I wish to populate more than one datagrid from the same OleDBCommand. The code I have is: Dim objCmd As New OleDbCommand(strSql, objConn) Then... ...
0
7108
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
6967
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
7142
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
7181
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
4875
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
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
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 ...
0
272
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.