I am migrating data that has to be inserted using stored procedures which already exist. The stored procedures have parameters and a return value (from a select statement) of an id for the row inserted. Within an OLE DB Command in SSIS I can call the stored procedure passing column values as the parameters and I usually use output paramt...
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 my brick wall.
I am using a separate class file named DatabaseHandling.cs to work with the...
I've been working on my issue for 30 hours. Each time I fix one thing a new error arises. All I want to do is take a DataTables from memory and simply update an Access .MDB file. Here is my code:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.T...
Hello!
I have (another) question about writing OleDbCommand's. I have a complex select command (includes several left joins) and OleDbCommandBuilder is unable to generate update commands for me.
I can't seem to grasp the magic behind writing update commands. I know the structure of the SQL update statement, however I am a bit puzzled a...
Hi I'm trying to insert in a ole db destination the result of a sp for each record in an ole db source,
the sp returns a record set
I have found this how to call a stored procedure in SSIS
but i still can't see the outpout columns in OleDb Command Output Columns
here is my sp:
create PROCEDURE [dbo].[GetData] (
@user varc...
Hello,
I am using OLEDB driver to call a Stored Procedure in Oracle DB.
The Stored Proc returns a cursor as the output.
I am able to call this Stored Proc using Oracle Data Source (System.Data.Oracle.OracleCommand), However I do not know how to call this SP using the OLEDB data source. Any help on how to specify the SP is returning a cur...
Hello
I created a scalar function in the DB
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[fn_GetUserId_Username]
(
@Username varchar(32)
)
RETURNS int
AS
BEGIN
DECLARE @UserId int
SELECT @UserId = UserId FROM [User] WHERE Username = @Username
RETURN @UserId
END
Now I want to ru...
I am using an OLE DB command in SSIS for which the SQL command looks like this:
UPDATE DBO.CLIENT
SET
TimeZoneID = ?,
DaylightSavingTime = ?,
ModifiedBy = ?,
MicrosPropertyID = ?,
IsOffline = ?,
GlobalReporting_MaskPatronNumberType = ?,
GlobalReporting_PatronNumberReadableCharacters = ?,
GlobalReporting_M...
Is there any way to access the prepared statement as sent to the SQL server?
Dim params(1) As OleDb.OleDbParameter
params(0) = New OleDb.OleDbParameter("@ID", OleDb.OleDbType.VarChar, 50)
params(0).Value = guiItemsGridView.Rows(e.RowIndex).Cells("ID").Value
params(1) = New OleDb.OleDbParam...
I create a table named "PathTable" in a MS-Access DB.
The table is like this:
------------------------------
| IP | Input | Output |
------------------------------
| 127.0.0.1 | XXXXX | YYYYYY |
------------------------------
When I programed these
String CommandString = "SELECT Input, Output FROM PathTable WHERE IP = '127.0.0...
I'm working on some OLE DB code that runs queries on MS SQL Server via ICommand::Execute. I'm converting this code to operate asynchronously by setting the DBPROPVAL_ASYNCH_INITIALIZE property on the command before executing.
I'd prefer to register a IDBAsynchNotify sink so that my code can be notified of events, as opposed to polling o...
Does it make a difference whether I use SQLCommand/SQLConnection instead of OleDbCommand/OleDbConnection. Do I get any advantages out of that, from a API-comfortability-, feature-, performance- or securitly perspective? Or any other perspective?
...
Hi,
I have an SQL statement that I'm executing through OleDb, the statement is something like this:
INSERT INTO mytable (name, dept) VALUES (@name, @dept);
I'm adding parameters to the OleDbCommand like this:
OleDbCommand Command = new OleDbCommand();
Command.Connection = Connection;
OleDbParameter Parameter1 = new OleDbParameter()...
Hi,
I am getting the following error while running a select statement (using OleDbCommand).
My query is
SELECT CME
FROM Personnel
WHERE CME = '11349D'
If objOleDbCom.ExecuteScalar() > 0 Then
When i execute the above statement i got this error
Conversion from string "11349D" to type 'Double' is not valid.
My field CME data t...
I've heard that Microsoft accepts that the name of ExecuteNonQuery method of command classes was given inappropriate. Is there any official information about it, or it is just a rumour?
...
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 of queries at once.
Edit: I am executing Insert Statements.
...
I know this is not a hell of an useful question but I can't help being bugged by it.
So,
Why said method (in *Command classes) is called
ExecuteNonQuery instead of ExecuteQuery?
Aren't those SQL statements we throw at DBs, queries?
...
So there are a lot of questions regarding this method on SO, but none seem to answer my question. I firstly had an issue with the connectionstring (although it seems to work in other areas of my code correctly). This was resolved easily.
Now the issue is with a simple SELECT query via a OLEDBCommand (Text) that keeps popping up the fol...
Hello,
I have a visual C# project and i'm trying to insert data in a MS Access Database when i press a button. Here is the code:
private void button1_Click(object sender, EventArgs e)
{
try
{
OleDbDataAdapter adapter=new OleDbDataAdapter();
adapter.InsertCommand = new OleD...
conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\database.mdb");
conn.Open();
com = new OleDbCommand(@"insert into group
(groupid,groupname,nature,effect)
values
(@groupid,@groupname,@nature,@effect)", conn);
com.Parameters.AddWith...