Questions tagged [oledbcommand]

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

451 questions
-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
-1
votes
1 answer

OleDbCommand ExecuteNonQuery() performance issues

I'm currently trying to write a huge amount of datasets to an access database. Unfortunately command.ExecuteNonQuery() seems to be very slow and I'm looking for a faster approach. I've been measuring the execution time of all parameter adds, but one…
Xentrax
  • 81
  • 3
  • 9
-1
votes
2 answers

Join tables from different databases (ADO.NET)

I have two databases and a UDL connection string to each one. I'd like to construct a query that joins tables from both databases. I'm doing a query from a single database like this. string query = "..."; using (OleDbConnection connection = new…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
-1
votes
2 answers

VB.Net Access Query Stop Rounding Decimal to Integer

i am using OleDbCommand for importing CSV when i am using query its rounding the decimal to integer. For Example My Table Data is Below SalID Commission 1 2.5 1 2.5 My Access query is select salID, Comission from table…
Allex
  • 141
  • 2
  • 16
-1
votes
1 answer

Getting a syntax error with INSERT INTO statement

I'm receiving the error of "C# Syntax error in INSERT INTO statement" for this part of code below: public static void SaveCurrentPlaylistToSheet(YouTubeVideo[] CurrentPlaylist, string playlistTitle) { ActiveSheetTitle = "Test"; //playlistTitle; …
Amitai Weil
  • 57
  • 2
  • 10
-1
votes
2 answers

How to ignore eror message "dbnull to string is not valid" and dont load empty cells to my vb form

When I click search button error occurs conversion dbnull to type string is not valid. I think there's no data in some cells in my database. its not a problem to have empty cells and if there are empty cells I don't want to load them to my…
-1
votes
2 answers

Im trying to INSERT data on a database with VB

I'm trying to Insert data on a access DataBase using Visual Basic with OleDbCommand, but it keeps returning me this error: Here's my code: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click …
João Figueiredo
  • 107
  • 1
  • 1
  • 12
-1
votes
2 answers

INSERT INTO Table (Column) VALUE (email)

I want to insert email in Table with only one column. I tried on 2 way. First time I tried with commandText and second time I tried with parapeters. But the both solution give me the same error. System.Data.OleDb.OleDbException: 'Syntax error in…
MiOnIs
  • 125
  • 12
-1
votes
1 answer

Selecting a range of, or the first x, columns with OleDb

Assume I have an Excel document with a single sheet in it. Where there is data in columns A-G, I can select all of them simply by using "SELECT * FROM [" + sheetname + "]". However, what if I want to specify columns? If there only happens to be a…
Wolfish
  • 960
  • 2
  • 8
  • 34
-1
votes
1 answer

C# OleDb Insert Integer with Parameter

I have a problem with insert command in C# WinForm. I need to insert special char so I need parameter or some alternative. But I can't insert the data into db. My 2nd column RecordNo allows unique and is a integer. This is where I'm facing trouble.…
Roshan
  • 83
  • 13
-1
votes
2 answers

SELECT COUNT Query Error

I've got this code, I'm trying to count Rows with specific payrollno in an accessdatabase datatable [Holiday]. string CountHolidayQuery = "SELECT COUNT FROM [Holiday] WHERE PayrollNo = @PayrollNo"; var CountHoliday = new…
Josh
  • 115
  • 1
  • 3
  • 17
-1
votes
1 answer

An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'

I am using Oledb connection for database connectivity but i am getting error be sure i am not using SQL server i am using Microsoft access 2013
Khawar Islam
  • 2,556
  • 2
  • 34
  • 56
-1
votes
1 answer

Syntax error in UPDATE statement. via cmd.nonexecutequery

If Me.TextBox1.Tag & "" = "" Then cmd.CommandText = "INSERT INTO Table1(CandidateID, Fname, Mname, Lname, Partylist, Pst, course) " & _ " VALUES (" & Me.TextBox1.Text & ", '" & Me.TextBox2.Text & "', '" & Me.TextBox3.Text & "', '" & _ …
-1
votes
2 answers

Copy Records From Access Table To Access Table

In C# I am trying to insert records from one access table to another access table, but I get the above error message. What is causing this error (OleDbException: No value given for one or more required parameters) as it is a straight Select *…
Bob Goblin
  • 1,251
  • 3
  • 16
  • 33
-1
votes
2 answers

OleDbCommand, No value given

With an Access table (Customers) and two fields (CustomerID, CustomerName): string queryString = "INSERT INTO Customers (CustomerID, CompanyName) VALUES (qqq, xyz)"; OleDbCommand command = new OleDbCommand(queryString,…
bhs67
  • 83
  • 1
  • 5