Hello,
It's the first time that I program in C# with Visual Studio and I've got a problem,
I would like to know where is my error!
This is my code: -
OleDbConnection conn = null;
-
private void button1_Click(object sender, EventArgs e)
-
{
-
-
-
try
-
{
-
conn = new OleDbConnection("Provider=OraOLEDB.Oracle;"
-
+ "Data Source=***********;"
-
+ "User ID=**************;"
-
+ "Password=***************;");
-
conn.Open();
-
-
OleDbCommand cmd = new OleDbCommand("INSERT INTO user_mpl (Value1,Value2,Value3) VALUES (?,?,?);", conn);
-
//OleDbParameter param1 = new OleDbParameter();
-
//OleDbParameter param2 = new OleDbParameter();
-
//param1.ParameterName = "@user";
-
//param2.ParameterName = "@password";
-
//param1.Value = textBox1.Text;
-
//param2.Value = textBox2.Text;
-
cmd.Parameters.Add("@Value1", OleDbType.Integer).Value =textBox3.Text;
-
cmd.Parameters.Add("@Value2", OleDbType.VarChar, 10).Value = textBox2.Text;
-
cmd.Parameters.Add("@Value3", OleDbType.VarChar, 10).Value =textBox1.Text;
-
-
-
cmd.ExecuteNonQuery();
-
-
-
}
-
finally
-
{
-
-
conn.Close();
-
}
-
-
}
-
My message error is:
"Invalid Chararcter" for cmd.ExecuteNonQ uery();
Thanks for your Help
Sabine
1 3045
Welcome to the site. First check the input from your textboxes. Then see if that input matches the data type of your field design.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Job Lot |
last post by:
I have written the following function which returns OleDbConnection object.
If global variable g_strDbPath contains an invalid file name or path name the
catch block throws an error with appropriate error message, but if
g_strDbPath is blank then the catch block throws an error saying “No error
information available: DB_SEC_E_AUTH_FAILED(0x80040E4D).” In this case
connection string is incorrect so why doesn’t it throws as appropriate...
|
by: Lilly |
last post by:
Hi all.
I'm really sorry for this post, I'm sure most of you will think it's a
silly question, but the following doesn't work and I'm really new to
ASP.NET:
<%@ Page Language="C#" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<script runat="server">
|
by: Matthias Kwiedor |
last post by:
Hello!
My Application is Multi-Threaded, where i have several threads which get
datas and write them to the database, or have to read from the database
to compare the datas and make updates if needed.
The Database is MS Access.
Connection String:
|
by: Seth |
last post by:
First off, my apologies if this is in the wrong newsgroup, but I hope
I'm close enough.
I'm trying to do some parsing of a CSV file using OleDbConnection, but
for some reason, when I populate my DataSet, it is trimming the trailing
spaces. Anybody know why?
Here is my code:
System.Data.OleDb.OleDbConnection connection = null;
|
by: Tim |
last post by:
I work on a dll with mfc support in C++ .NET. I include the following statemwents, but the complier does not allow me to do
OleDbConnection * cnNwind = new OleDbConnection()
The error msg says "OleDbConnection undeclared identifier
Please help, thanks
using namespace System
using namespace System::Data
| |
by: COHENMARVIN |
last post by:
I put the following code in my asp.net page:
dbPath = MapPath("/FBDB/db1_newport2003.mdb")
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect = strConnect & "Data Source=" & dbpath & ";"
objConnect = new OleDbConnection(strConnect)
=============================
but I get the following error:
<b>* Error while updating original data</b>.<br
|
by: Souloron |
last post by:
Here what I did:
string cmdText = String.Format(("CREATE TABLE {0} (dno int primary key, Sunday char(5), Monday char(5), Tuesday char(5), Wednesday char(5), Thursday char(5), Friday char(5))"), tableName);
OleDbConnection conn = new OleDbConnection(Form1.ConnectionString);
conn.Open();
OleDbCommand cmd = new OleDbCommand(cmdText, conn);
...
|
by: SyGC |
last post by:
Hello,
Im trying to connect to a MySQL DB on my home network (testing purposes) using the following VB.NET code;
Imports System.Data.OleDb
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim SQLConnection As OleDbConnection
|
by: MightyFeldar |
last post by:
I've looked just about everywhere and pieced together as best as I can the code to update the tracking number in a CSV file for an order that has shipped out from our company so we can upload the file to our online shopping cart. I have 1 file with 3 columns that is an export from our shipping program, and the file that needs to be updated that we download from the shopping cart, insert the tracking numbers and re-upload.
File 1:...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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 we have to send another system
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |