oledbcommand

Two Inner Joins in OleDb SQL query [duplicate]

浪子不回头ぞ 提交于 2021-01-27 13:33:38
问题 This question already has answers here : SQL multiple join statement (3 answers) Closed 2 years ago . I'm trying to make an SQL query with an OleDbCommand into an Access database (.accdb). While this command works fine (in a OleDbCommand.ExecuteReader() ): string command = "SELECT cred.* " + "FROM TB_CREDENTIALS cred " + "INNER JOIN TB_REL_USERS_CREDENTIALS rel ON cred.CRED_ID = rel.REL_USR_CRED_CRED_ID "; This other doesn't, and I can't understand why (all examples I see around use the exact

Two Inner Joins in OleDb SQL query [duplicate]

人走茶凉 提交于 2021-01-27 13:30:35
问题 This question already has answers here : SQL multiple join statement (3 answers) Closed 2 years ago . I'm trying to make an SQL query with an OleDbCommand into an Access database (.accdb). While this command works fine (in a OleDbCommand.ExecuteReader() ): string command = "SELECT cred.* " + "FROM TB_CREDENTIALS cred " + "INNER JOIN TB_REL_USERS_CREDENTIALS rel ON cred.CRED_ID = rel.REL_USR_CRED_CRED_ID "; This other doesn't, and I can't understand why (all examples I see around use the exact

OleDB Parameters

戏子无情 提交于 2020-01-11 11:51:31
问题 I have this access db that I have a ddl for the state name and a ddl for the year. I have a gridview that I'd like to pass the value of the state drop down list into where clause. Obviously if I could use sql with the named parameters I would but this is what I'm stuck with and not sure exactly how to format it correctly. the drop down list is name ddlStates. In the parameters I've tried mycommand.Parameters.Add("@ddlStates") here is the data set public DataSet GetData() { DataSet ds; using

How do I do many SQL queries as transactions?

狂风中的少年 提交于 2020-01-07 03:57:05
问题 I have been doing codes that do DELETE , UPDATE , INSERT , SELECT in Databases in school. The problem is that it can do just one query simultaneously. Something like this: OleDbConnection con = DAL.GetConnection(); con.Open(); if (con.State == ConnectionState.Open) //si la conexion esta abierta... { string sql = string.Format(" INSERT INTO lol (...)"); //----->I shortened this above because it's not important <----- OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandType

I am getting an error when I try to update records in my access database

自作多情 提交于 2020-01-05 04:41:17
问题 I have a small program that connects to an access database, and what I am trying to do is update(edit) a selected record via an edit form. When I execute my code, I get this error: System.Data.OleDb.OleDbException was unhandled Message=Syntax error (missing operator) in query expression '5346 S. Eubank blvd'. Source=Microsoft Access Database Engine ErrorCode=-2147217900 Needless to say, it is for the Address field.. Here is my code block: private void saveChangeBtn_Click(object sender,

Execute Oracle Function from SSIS OLE DB Command

99封情书 提交于 2019-12-25 12:13:31
问题 I am trying to call a function from oracle using OLE DB Command for SSIS, I have the connection set up Correctly but I think my Syntax for calling the function is incorrect? EXEC UPDATE_PERSON ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? output I have used this on a SQL stored proc for testing & it has worked. the oracal connection is 3rd party & they have just supplied the function name & expected parameters. I should get 1 return parameter. The Error: Error at Data Flow Task [OLE DB

prevent Excel sheet opening on OLEDBCommand query

守給你的承諾、 提交于 2019-12-25 08:36:48
问题 I am working with c# in WPF. Pulling data into datatables. Everything was working OK until I changed to using the actual worksheet name as pulled from the sheet via a foreach (worksheet in workbook) loop. Now that I have the actual worksheet name and include it in my OLEDbCommand, the worksheet open on the screen. I would like to prevent/stop the Excel file from opening on the screen as it is not needed nor desired. Below is the connection string and the beginning of the try/catch that has

Excel does not have updated values using oledb c#

无人久伴 提交于 2019-12-24 20:22:42
问题 I am new to C# and trying to write values to an excel file using OLEDB. The problem here is the first time if there is no excel file present in that location it works fine and prints the value to excel, but the second time if the excel is present it does not overwrite or write a new value to the excel. I also need to run this in a loop as I have four rows to print and not one. Need help with this. This is my code snippet and I know I it has code for only one row to print but I don't know the

Reading tables using OleDBConnection

非 Y 不嫁゛ 提交于 2019-12-24 16:14:21
问题 First off, i'm new to VB and this is my first project using OleDBConnection. ok, so i'm trying to the most simple thing using oleDbConnection (i assume). I just want to read data from a table in the Access DB and display that information to dropboxes (or anything) in my winForm. Public Class QueManger Dim dbConnection As OleDbConnection Dim dbCommand As OleDbCommand Dim dbDataAdapter As OleDbDataAdapter Dim ConnectString As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & "Data Source = \

SSIS return value of Stored Procedure within an OLE DB Command

橙三吉。 提交于 2019-12-20 21:01:32
问题 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 parameters on the stored procedure to handle "id" output; but I am unsure how this can be handled with return values when the procedure uses a select to return the