Represents an SQL statement or stored procedure to execute against a data source using OLE DB provider.
Questions tagged [oledbcommand]
451 questions
-1
votes
1 answer
Insert syntax error in oledbconnection
What is the problem in this code?
for (int i = 1; i <= kalanum; i++)
{
foreach (Control ctr in panel1.Controls)
{
if (ctr is TextBox && ctr.Name == i.ToString())
{
int kalaid =…

Reza Zamani
- 11
-1
votes
1 answer
oledbcommand executenonquery access update error
when i run this code it shows error, please help me!
`int code = int.Parse(tbxcode.Text);
string name = tbxname.Text;
string description = tbxdescription.Text;
bool active = true;
int idcompany = cbxcompany.SelectedIndex;
string kala =…

sepehr2121
- 87
- 8
-1
votes
1 answer
oledb datatable update using paramaters failing
I am trying to write the update command for a oledb dataadapter. I have had a variety of errors. I think my stumbling point is the stupid field names that I can do nothing about.
Perhaps someone can see my mistake?
The Database is access
The…

GDutton
- 164
- 14
-1
votes
2 answers
OleDbDataReader inside a OleDbDataReader
I have 2 Tables. I want to get all ID's from Table1, and while I am inside the frist OleDbCommand I want to check if the ID is in Table2 too.
I tried this:
using (OleDbCommand cmd = new OleDbCommand("SELECT ID FROM Table1 WHERE NAME=:NAME)
{
…

user576914
- 199
- 1
- 8
- 22
-1
votes
1 answer
c#, how to Reuse the SqlCommand and OleDbCommand
this is the url i refer to: http://support.microsoft.com/kb/317559
i study their method and had applied them, everything is fine until i include 2_2, error msg: No current query in data reader.
I already close my drSelect1_1 under 2_1 if statement.…

melvintcs
- 551
- 3
- 13
- 34
-2
votes
1 answer
Why do I always get a Syntax in UPDATE Statement whenever I try to update my records in OleDBSQL?
I always get this error whenever I try to update the record in OleDBSQL. Here is my code:
private void update(int id, string fname, string user, string pass, string email, string address, string ci, string bday)
{
//SQL STMT
…
-2
votes
1 answer
How to use IN clause with SQLParameters?
My function works perfectly if I provide one instance of ComputerName value. My question is how to modify SQL query so it could accept an array? I don't believe creating a loop to query a database several times is a proper way. For example, I think…

user2978216
- 474
- 2
- 6
- 19
-2
votes
2 answers
Why compile error “Use of unassigned local variable”?
i keep getting this error, but I don't know why, I get it here:
Label1.Text = fgmail.ToString();
and here's the full code:
string st = this.pfun.Text;
string sqlstr2 = "select * from hsinfo WHERE rname='" + st + "'";
OleDbCommand cmd = new…

Raghad
- 35
- 1
- 6
-2
votes
1 answer
How to dynamically the label number
This is a tennis tournament simulation program I'm Trying to make a tree. Everything its working perfectly but I have a big problem. I can't progress to the next stage with the winners of the firts games. Because I can't change the "target" label…

João Figueiredo
- 107
- 1
- 1
- 12
-2
votes
1 answer
How can I get return value from a stored procedure and use it in script task using OLE DB Command Task(Provider, Providerlocation) in SSIS?
enter image description here
How to get return value from OLE DB Command Task and use it in Script task?

user2326218
- 1
- 1
-2
votes
1 answer
How to insert data in single column(cell) of new row in c#?
I have an .accdb file with four tables in it
Product_Particulars
Cust_Details
Variable_fields
Permanant_fields
The number of column in the 'Variable_fields' table is not fixed (changed using 'ALTER TABLE' OleDb nonQuery). But it has two fixed…

Rajib Majumdar
- 29
- 9
-2
votes
2 answers
Creating OleDBConnection
I am migrating code from VS2010 to VS2013 and my syntax in VS2010 shows compile errors in 13?!? Can someone assist me with why these two compile errors are being thrown?
Syntax error, ',' expected
{ expected
And this is the syntax that works w/o…

MasterOfStupidQuestions
- 925
- 1
- 16
- 37
-2
votes
1 answer
Updating data in database
I have a problem trying to update this data but giving error messages all the time...
private void btnEnterReturn_Click(object sender, EventArgs e)
{
OleDbConnection connect = new OleDbConnection();
connect.ConnectionString =…

user3516177
- 1
- 1
-3
votes
1 answer
which is the best and fast command parameters in oledb in vb.net
Dear All Programmer,
which is the best and fast parameter command in oledb in vb.net please explain the details with the option code below because I want to use the CRUD application in the access database so that I do not become wrong in applying…

roy
- 693
- 2
- 11
-3
votes
2 answers
How to change data type of a column in DataTable
I am using the following code to read from a SELECT Sql query and then fill my DataTable from it (dt is my DataTable, cs is my connection string and query is the Sql script):
using (OleDbConnection conn = new OleDbConnection(cs))
{
conn.Open();
…

disasterkid
- 6,948
- 25
- 94
- 179