Questions tagged [oledbcommand]

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

451 questions
0
votes
1 answer

OleDbDataReader gives Unsupported Data Type Error

I am using Oracle Db and calling a Simple Select Query but Oracle is throwing a weird error message: A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Unspecified error Oracle error occurred, but…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
0
votes
1 answer

OleDbCommand and Unicode Char

I have an application that run a lot of query using OleDbCommand. Every query is plain SQL text, and the command does not use parameters. Now, the application should support chinese char and I do not wanto to change every query by adding the N char…
Angelo Badellino
  • 2,141
  • 2
  • 24
  • 45
0
votes
2 answers

Insert into database table with OLE DB .NET Provider won't work

I am getting an error msg of "syntax error" for the INSERT INTO command when it gets to cmd.ExecuteNonQuery. It is important that I use string.Format, and that the structure stays as close to the current structure as possible. { …
user2217286
  • 19
  • 2
  • 3
0
votes
0 answers

multiple select statement in single OleDbCommand is not working

I am trying to select data from 2 access tables using a single command object. here is my code- using (OleDbCommand cmdCommand=new OleDbCommand()) { cmdCommand.CommandType = CommandType.Text; cmdCommand.CommandText = "select * from…
s.k.paul
  • 7,099
  • 28
  • 93
  • 168
0
votes
3 answers

Update specific cell of excel file using oledb

I want to update the specific cell of the excel file using oledb. Say I7 cell, for some reason always I1 is getting updated. Can anyone tell me what's wrong with this code? OleDbConnection oledbConn = new…
Atul Sureka
  • 3,085
  • 7
  • 39
  • 64
0
votes
4 answers

Find out which query caused an exception

I have an OleDbCommand for my inserts that I have tried to implement to avoid SQL injection. Before that I used simple strings for my queries and I didn't like that. Now my piece of code for inserting records looks like this: try { …
disasterkid
  • 6,948
  • 25
  • 94
  • 179
0
votes
2 answers

c# and ms-access database inserting

I want to save data by save button from : idbox (textbox) - empbox (combobox) - jobbox (combobox) - unitbox (combobox) - destbox (combobox) - detectivebox (combobox) - statebox (combobox) - investdate (datepicker) - investresult (textbox) into…
Ahmed Zoeil
  • 47
  • 1
  • 8
0
votes
1 answer

OleDbConnection error: Your network access was interrupted

I'm using ACE OLEDB to run a query on an MS Access mdb file. This works on x86 machines but fails on x64. C# code (built with target platform x86): string conn = "Provider=Microsoft.ACE.OLEDB.12.0;data source=" +…
Mossi
  • 997
  • 5
  • 15
  • 28
0
votes
1 answer

Update OleDb from DataGridView as Validated Using CommandBuilder

I just found out about the CommandBuilder, and thought it sounded straight foward and easy to use. Clearly I'm still missing things. I've got a DataGridView that successfully updates dbSet table called Customers. But it's not updating to the…
Atl LED
  • 656
  • 2
  • 8
  • 31
0
votes
1 answer

Issues using OleDbConnection to export an image in an excel document in c#

I want to export an image to an excel document in c# The image the following formats: System.Windows.Media.Imaging.BitmapImage These are the connection details: private const string OleDbConnection = "provider=Microsoft.Jet.OLEDB.4.0;Data…
MTA
  • 739
  • 2
  • 9
  • 29
0
votes
1 answer

OleDb ORDER BY RND() is not Work (C#)

Hello and Thank you for helping. I'm using the following code in my Data set Data Table Query (by Wizard) for sorting by random(ID Column). SELECT ID, Q, A_1, A_2, A_3, A_4, Correct FROM Quiz ORDER BY RND(Quiz.ID) When I test this…
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,060
  • 3
  • 25
  • 40
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,192
  • 14
  • 30
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
  • 93
  • 3
  • 4
  • 13