Questions tagged [oledbcommand]

Represents an SQL statement or stored procedure to execute against a data source using OLE DB provider.

417 questions
0
votes
3 answers

SELECT Columns WHERE one column Is Distinct?

Can anyone help me with the query ? I've tried the following but it comes up with an error SELECT Column1, Column2, Column3 FROM Table WHERE [Column1] NOT IN (SELECT [Column1] FROM Table GROUP BY [Column1] HAVING COUNT([Column]) > 1) Invalid MEMO,…
Pantelis
  • 2,020
  • 3
  • 23
  • 39
0
votes
1 answer

How to delete value from table when having multiple conditions?

I'm trying to delete all data from Table where index=Textbox1.Text and idnmb=Textbox2.Text When I remove this part + "AND id_nmb = " + data2 it works but not what I want. I have this code : private void button1_Click(object sender,…
0
votes
1 answer

Specifying function inside insert statement in OleDbCommand

We have legacy data which is stored in MSSQL database as varchar, even though the data is really binary. In new application we're using OleDbCommand (because we are trying to use common code to access MSSQL+Oracle+Sybase) databases. I am able to…
Alex
  • 1,172
  • 13
  • 28
0
votes
1 answer

How to Create an Excel File in C#; Office 2007; Win 7 64bit?

Previously my C# app used this command to create an Excel file: try { //SELECT INTO command string cnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AccfilePath + ";Persist…
cjjeeper
  • 83
  • 3
  • 4
  • 13
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…
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
  • 199
  • 1
  • 2
  • 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 =…
T-student
  • 1,494
  • 5
  • 27
  • 62
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
  • 4
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*'",…
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,470
  • 1
  • 13
  • 23
-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…
-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…
-1
votes
1 answer

OLEDB error E_OUTOFMEMORY (0x8007000E) while trying to insert into Access Database from c#

I just wanted to post my question / solution to a deep problem we just encountered and solved. I didn't find any direct answer on the internet except a CLUE here : http://members.iiug.org/forums/ids/index.cgi/noframes/read/2476 Big picture, we…
Simon
  • 1,690
  • 1
  • 17
  • 20
-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…
-1
votes
1 answer

OleDb Update Query is not updating the database

I'm trying to update 4 columns in my database where the UID matches, the query runs fine with no errors output but the database remains unchanged. The database is fully closed and nothing else has it open except the code. I'm quite new to using…
user12363579