oledb

How to replace IDs of users with their fullNames in the current scenario?

对着背影说爱祢 提交于 2020-01-06 06:46:25
问题 I have two databases with the following schema: tbl_users(userID, fullName, emailID, password) userID is the Primary Key tbl_savings(savingsID, creditorName, amount, interestRate, interestType, interestCalculationMethod, ownerID, dataEnteredByID) savingsID is the Primary Key. ownerID is a Foreign Key on userID of tbl_users with a one-to-many relationship. ownerID specifies the ID of the owner of the saving. Similarly, dataEnteredByID specifies the ID of the person who entered the data. I have

Read excel via ADO.NET with SQL Server commands?

喜欢而已 提交于 2020-01-06 05:50:06
问题 I can read XLS file with this code : string path =@"c:\r\1.xlsx"; OleDbConnection MyConnection = new OleDbConnection(@"provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + path + @"';HDR=Yes;Jet OLEDB:Engine Type=37"); OleDbDataAdapter MyCommand = new OleDbDataAdapter("select * from [Sheet1$]", MyConnection); DataSet DtSet = new DataSet(); MyCommand.Fill(DtSet); ... ... However - when I enhance the query to include some SQL Server commands like select *,case when 1=1 then 'a' else 'b' end as rr

Syntax error in update statement

久未见 提交于 2020-01-06 05:41:07
问题 code: string query1 = @"UPDATE global_mapping set escape_id = " + dataGridView1.Rows[i].Cells[2].Value + ",function_id = " + dataGridView1.Rows[i].Cells[3].Value + ",function_name = '" + dataGridView1.Rows[i].Cells[4].Value + "',parameter_name = '" + dataGridView1.Rows[i].Cells[5].Value + "',parameter_validity = '" + dataGridView1.Rows[i].Cells[6].Value + "',statusparameter_id = " + dataGridView1.Rows[i].Cells[7].Value + ",acb_datatype = '" + dataGridView1.Rows[i].Cells[8].Value + "',data

How do I correctly handle CR when reading text files with OleDB

假如想象 提交于 2020-01-06 05:34:11
问题 I have text files that are Tab delimited. I created a Schema.ini like so: [MY_FILE.TAB] Format=TabDelimited ColNameHeader=False Col1=id Short Col2=data Text This is the code I use to read it (C#): using (var connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FolderToData\;Extended Properties='text;FMT=delimited'")) { using (var command = new OleDbCommand("SELECT * FROM MY_FILE.TAB", connection)) { var table = new DataTable(); using (var adapter = new

oledb exception syntax error in insert into statement (0x80040E14) in C#

纵饮孤独 提交于 2020-01-06 03:17:37
问题 I'm having and exception in my insert into statement.But the data is inserting to the table correctly. can someone please show me the error in this code. private void btnAddNewSale_Click(object sender, EventArgs e) { string StrQuery; connection.Open(); OleDbCommand command = new OleDbCommand(); command.Connection = connection; for (int i = 0; i < DataGridViewAddSale.Rows.Count; i++) { StrQuery = "insert into BillItem (billNumber,storeItemNumber,numberOfItems,priceForEach,totalValue) values ("

'Microsoft.ACE.OLEDB.12.0' provider is not registered -but it is

六眼飞鱼酱① 提交于 2020-01-05 19:06:13
问题 Short and sweet: app works on x86 machine but not on x64 (tried on a 2008 Server and a Windows 8) Microsoft Access Database Engine 2010 already installed (also have Microsoft Office 2007 Access Database Engine installed) MS Office not installed confirmed the existence of C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\ACEOLEDB.DLL Code: string conn = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;"; OleDbConnection _connOle = new

OLEDB CASE WHEN in SELECT Query [closed]

大憨熊 提交于 2020-01-05 16:52:52
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago . How can use case when statement with oledb to excel file ? Like select prodid, case prodid when 1 then 'fine' when 2 then 'good' end 回答1: You'll have to use IIF instead of CASE when querying Excel, eg SELECT

OLEDB CASE WHEN in SELECT Query [closed]

妖精的绣舞 提交于 2020-01-05 16:49:19
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago . How can use case when statement with oledb to excel file ? Like select prodid, case prodid when 1 then 'fine' when 2 then 'good' end 回答1: You'll have to use IIF instead of CASE when querying Excel, eg SELECT

Crystal Reports -Invalid Argument provided. Failed to open a rowset. ADO.Net xml

为君一笑 提交于 2020-01-05 10:04:15
问题 Okay here is the scenario I have a VB6 application that is getting re-written for asp.net 3.5. I have a grundle of Crystal Reports that are getting updated to Crystal Reports 10.5 (which is included in Visual Studio 2008). All of the old reports used OLEDB. What I am doing is taking the sql statements used in the reports and putting them in the database. I next run an automated process to create a Dataset from those select statements and I serialize the DataSet and save the schema and data as

Valid SQL query fails when executed from VB Script

試著忘記壹切 提交于 2020-01-05 07:57:11
问题 I have SQL query that successfully runs in the SQL management studio, but when I'm running the same query from VB script it fails with error: Microsoft OLE DB Provider for SQL Server: Incorrect syntax near the keyword 'ALTER'. My SQL query is: SET XACT_ABORT ON; BEGIN TRANSACTION VersionBuild BEGIN TRANSACTION GO CREATE TABLE dbo.TimeTemplate ( id int NOT NULL IDENTITY (1, 1), startTime datetime NOT NULL, endTime datetime NOT NULL ) ON [PRIMARY] GO ALTER TABLE dbo.TimeTemplate ADD CONSTRAINT