Questions tagged [oledbcommand]

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

451 questions
3
votes
1 answer

SUMIF SQL VIA OLEDB in VB.NET

I want sumif results in the database "GSGTS/t3" in the "BLC" column with the number criteria in the "PNM" column. I haven't been able to create sql for the sumif process. With the explanation below : the result of the value of 185000 for the number…
roy
  • 693
  • 2
  • 11
3
votes
4 answers

Error in executing an OleDbCommand.. "Must declare the scalar variable "@MaxID"."

private void AddValue(string strValue) { //get the maximum id for Lists first int MaxID = DataOperations.ReturnMaxIDInATable("Lists", connString); int iSqlStatus = 0; string query = "INSERT INTO Lists(ID, ListName,…
Rej Maranan
  • 27
  • 1
  • 3
3
votes
1 answer

Which SSIS executable is best practise to use for delete command

I have 2 DB's on same SQL 2016 std. server. I need to delete Prod table data that matches ID's in the Arh DB table. I am doing this in batches of 10000 rows. Table's on Prod and Arh DB are with same schema. I need to delete a large amount of data…
Aleksandar
  • 55
  • 1
  • 7
3
votes
1 answer

SSIS 'Column' and 'Parameter' cannot convert between unicode and non-unicode string data types

I have a Data Flow Task that does this: From two different OLE DB Sources, run a SQL Command to select some data Merge Join the two DB sources Lookup to a different SQL DB Source, check if the data already exists or not Based on Lookup Match Output…
ichachan
  • 637
  • 1
  • 10
  • 34
3
votes
3 answers

How do I structure an OleDbCommand Query so that I can take Tables from one .MDB, and replace them in another .MDB

I am trying to take tables from one Access Database File, add them to another Access Database file with the exact same structure but with different information. I need to overwrite any existing tables. I am almost done with my project this is last…
OneShot
  • 609
  • 8
  • 20
  • 32
3
votes
1 answer

Export Access report as PDF

I'm doing an ASP.NET application in C# that connects to an Access database and now I want that it exports a report as PDF. Here is my code that only connects to Access, I was thinking of running an access macro or running a command with…
3
votes
0 answers

Excel OleDb C# - Cannot select range if worksheet has special characters

I have run into a snag when reading info from a workbook in excel that contains a "#" in the name of the sheet. I am able to select the WHOLE worksheet but not a range in the worksheet. Code: using (OleDbConnection conn = new OleDbConnection()) …
3
votes
0 answers

How to get rows count of rowset in OLE DB

How is possible to get rows count of rowset in OLE DB? I have filled RowSet using CCommand and CAccessor and now I dont know how to get rows count. I can go through all rows using MoveNext() but it does not seem efective. Thanks
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
3
votes
3 answers

OleDataAdapter Fill Method Returning Empty Rows To Data Table

Here is my code: public static DataTable GetDataFromSpreadsheet(OleDbConnection conn) { DataTable dt = new DataTable(); OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", conn); conn.Open(); …
Dillon Willis
  • 131
  • 3
  • 10
3
votes
1 answer

SSIS - Updating a table with a OLE DB Command

I need to translate the next SQL Query in SSIS: (Each table belong to a different source - SQL Server & ORACLE) update A set A.col1 = B.col1 A.col2 = B.col1 from table A inner join table B B on A.col3 = Col3 where A.col4 = value 1 and A.col5 =…
d2907
  • 798
  • 3
  • 15
  • 45
3
votes
1 answer

Microsoft ACE OLEDB 12.0 - F1 syntax for headerless .CSV causes exception

I am switching from using the 'Microsoft.Jet.OLEDB.4.0' provider to 'Microsoft.ACE.OLEDB.12.0' as I am launching my program on a 64-bit system, and I understand ACE has superseded Jet for 64-bit use. I haven't changed the syntax of the query I pass…
3
votes
4 answers

Execute multiple queries

I am using OleDB for executing my queries in C#, Is there any way I can execute multiple queries in one command statement? I tried to separate them with semi-colon (;) but it gives error "Characters found at the end" I have to execute a few hundreds…
smartali89
  • 209
  • 2
  • 8
3
votes
3 answers

Storing an image into an Attachment field in an Access database

I'm writing a VB application where I need to store an image in the database. The user selects the image on their computer, which gives me the path as a string. Here's my attempt at it, however I'm getting the error "An INSERT INTO query cannot…
Michael
  • 171
  • 1
  • 3
  • 8
3
votes
1 answer

C# MS Access oledbcommand.executeNonQuery UPDATE no error, no change

Im trying to use the following script to Update values in an MS Access database. I have verified that the generated query is valid and that it works if I input it inside MS Access. Also I verified that oledbcommand.executeNonQuery() returns the…
MichaelTaylor3D
  • 1,615
  • 3
  • 18
  • 32
3
votes
0 answers

Oledb skips the first column of excel file. The first column is empty

The problem is that the first column is empty and it can not be read. To read the file, I wrote the following code: MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "'" + filename + "'" + ";Extended…
Jin
  • 127
  • 3
  • 11
1
2
3
30 31