Represents an SQL statement or stored procedure to execute against a data source using OLE DB provider.
Questions tagged [oledbcommand]
451 questions
0
votes
2 answers
Select Columns with Multiple Ranges from Excel using OleDb
My current requirement is I need to select multiple ranges from an excel sheet(DUMMY.xls) in a single query and put it into a DataTable(fooData1) :
As you can see from the image above I have columns from A to F.
Therefore I am filtering out the…

LetsKickSomeAss in .net
- 536
- 1
- 8
- 22
0
votes
1 answer
VB .NET OleDbCommand returns Missing semicolon (;) at end of SQL statement
I am using VB .Net to loop through a regex Match and generate a sql statement. I'm creating the sql like this
sql = "Insert Into Agencies (Address) Values"
While MatchObj.Success
sql = sql & "(""" & MatchObj.Groups(1).Value & """), "
…

user1457296
- 239
- 1
- 3
- 8
0
votes
1 answer
c# OleDbCommand Overflow
I have this simple class which should perform a normal INSERT INTO a table, but ExecuteNonQuery give me: OVERFLOW ERROR.
Can you tell me why? Please.
OleDbCommand cmd = new OleDbCommand(selectSQLNewData, con);
OleDbDataReader reader =…

FrankTan
- 1,626
- 6
- 28
- 63
0
votes
1 answer
oledb command not fetching values
through following query i trying to merge three things parEmail , parEmployeeLogin , and parStaffID
now in the case one is null i get whole NameValue null .
SELECT (parFirstname +' '+ parSurname) AS NAME,
(parEmail +','+ parEmployeeLogin +','+…

parthiv777
- 22
- 5
0
votes
1 answer
Cannot figure out how to fix syntax error (missing operator) in query expression error in C#
I'm having an issue with an error written above and cannot find a exact way to fix it.
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("Select count(*) from [contractors$] where " + category + " like '*@name*'",…

Raider00321
- 57
- 1
- 9
0
votes
1 answer
Is it safe to access OleDBDataReader after Command is closed
In java, you cannot access the ResultSet once the Statement is closed, although many times you get a small amount of fetched data making it appear to be open. But in general it is against the API rules.
But in OLEDB, I'm wondering if the same rule…

Jerico Sandhorn
- 1,880
- 1
- 18
- 24
-1
votes
1 answer
Oledb ExecuteNonQuery Syntax Error in INSERT INTO
I'm trying to insert values into an Access database with C#, however I am getting a Syntax error All of the data types in the database and the C# code are correct.
Here is the error message: error message
here is the code:
string insert =
…

los
- 11
- 2
-1
votes
1 answer
How to reindex primary key table in OLEDB with VB.NET
I created my own index primary key with the .NET progran VB.NET. So how can my solution re-index the primary key and then load the database
Thanks
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
…

roy
- 693
- 2
- 11
-1
votes
1 answer
How to creata a 2-column combination into a primary key in OLEDB with VB.NET
So I did an update in the "RPD" table and the database does not have a primary key then my solution must create a primary key in the "PNM" column but I can only update only 1 row so the solution is whether it can be by combining the "PNM" column…

roy
- 693
- 2
- 11
-1
votes
1 answer
ERROR - Syntax error in INSERT INTO statement
I am trying to insert data into an MS Access DB through a VB.net Windows Forms App
when executing this code
Dim con As New OleDbConnection(CS)
Dim cmd As New OleDbCommand("INSERT INTO Ports ([PortNumber] , [DistributionBoardLocation] ,…

Jacob Binns
- 11
- 4
-1
votes
1 answer
SQL (INSERT INTO) COMMAND DOES NOT WORK IN OLEDB IN VB.NET
I want to update in the "CIU" column in the database "GSDTS" and retrieve the data or values from the database "IFGTS" in the column "PRSOBNET" based on the conditions of the "ITM" column and the "GDN" column or warehouse. Do I have to do sql update…

roy
- 693
- 2
- 11
-1
votes
2 answers
Range Query ~ VB
Trying to do a OleDbCommand to find a row in an excel sheet. Each row has a low number and a high number in different cells. No rows have overlapping numbers. I am not getting any results nor errors. Though I know I am a row's range. 205221 is the…

stefan_aus_hannover
- 1,777
- 12
- 13
-1
votes
1 answer
OleDb.OleDbException Data type mismatch in criteria expression
I want to have a query like this but I get errors:
"Select *
From Products
Where (ProductName) = '" + productName.Text + "' and (Revise) = '" + a + "'";
where I have product name and revise at the same table as 2 different columns.
I have…

Nightingale
- 133
- 1
- 7
-1
votes
2 answers
Why do I get this exception when querying an Access database?
I need a little help here please lend me a hand. I want to fill my combo box with the data coming from my database. I'm using MS access. What I'm trying to do is fill my combo box with just a name or just a single column from my database. I'm having…

lelouch
- 35
- 8
-1
votes
1 answer
How do you add parameters to a count query ran on an excel spreadsheet via oledb?
I am trying to count the number of values on a column that are before a certain date. The below is my current attempt. I am able to run this no problem without the where section, however of course this is needed for the correct value to be…

Ollie Sharratt
- 95
- 14