oledbconnection

unable to import OleDbConnection in dotnet core entity framework

南笙酒味 提交于 2019-12-01 20:36:45
问题 unable to import OleDbConnection in dotnetcore entity framework while transferring data from excel to sqlserver 回答1: OleDb is not available in .NET Core, probably because it's not cross platform. Have a look at the System.Data.OleDb Namespace in .NET Core 2.0. Alternative For a decent alternative, have a look at the answer to this Stack Overflow question: How to get OleDb for reading excel in asp.net core project 来源: https://stackoverflow.com/questions/49993919/unable-to-import

Modify existing excel Connection Name in VBA

别来无恙 提交于 2019-12-01 19:47:18
I need to update the Connection Name of an excel workbook's sql connection. This is my attempt. I have been able to modify the Connection String and Command Text by doing a standard replace. Sub ConnectionString_modify() Dim i As Long Dim cnt As Long Dim modtext As String Dim modrange As String 'Grab nummber of workbook connections cnt = ActiveWorkbook.Connections.Count For i = 1 To cnt 'Changes to Connection string --This works modtext = ActiveWorkbook.Connections.Item(i).OLEDBConnection.Connection modtext = VBA.Replace(modtext, "_FY2013", "_FY2014") ActiveWorkbook.Connections.Item(i)

unable to import OleDbConnection in dotnet core entity framework

我只是一个虾纸丫 提交于 2019-12-01 19:43:49
unable to import OleDbConnection in dotnetcore entity framework while transferring data from excel to sqlserver OleDb is not available in .NET Core, probably because it's not cross platform. Have a look at the System.Data.OleDb Namespace in .NET Core 2.0. Alternative For a decent alternative, have a look at the answer to this Stack Overflow question: How to get OleDb for reading excel in asp.net core project 来源: https://stackoverflow.com/questions/49993919/unable-to-import-oledbconnection-in-dotnet-core-entity-framework

OleDbConnection Dispose very slow (2s)

爱⌒轻易说出口 提交于 2019-12-01 19:30:12
I have a problem with a OleDbConnection accessing a .mdb File on a Windows share in the same network. When it gets disposed at the end of the using part, it needs more than 2 seconds for that. Opening the connection and executing the query or filling the DataTable only needs up to 50ms. that's my code: private const string DbStConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;data source=\\master\db\datenezpz2004\dbST.mdb"; private const string DbStConnectionStringIp = @"Provider=Microsoft.ACE.OLEDB.12.0;data source=\\192.168.254.10\db\datenezpz2004\dbST.mdb"; using(var connection = new

OledbConnection Close and/or Dispose are very slow, take 20s to execute

心不动则不痛 提交于 2019-12-01 18:46:48
While using OleDbConnection to access sheet names of the excel files I encountered a problem. Everything in the code executes fine and works, until the OleDbConnection closes at the end of the using statement. This causes the program to stop for 15-20 seconds or more! I've tried getting rid of the using statement and individually using the OleDbConnection.Close() and OleDbConnection.Dispose() methods, both of those take incredibly long to execute as well. If I never close the connection at all, the program runs perfectly. //Closing connection is inredibly slow now for some reason using

C# OleDb Exception “No value given for one or more required parameters” while trying to delete from Access database

一曲冷凌霜 提交于 2019-12-01 18:18:32
问题 I have a table with "SEMESTER, SUBJECT, OFFER, RESULT" where "SEMESTER" & "SUBJECT" is PRIMARY KEY. When i use the query "DELETE FROM Course_Information WHERE Semester = 1 AND Subject = 'CSE-414' ; Its working perfectly in access database but i always get exception when i tried to use it in my c# code. Moreover its works if i use "DELETE FROM Course_Information WHERE Semester = 1 ; I want to use both "SUBJECT" & "SEMESTER" In the WHERE condition (Because there could be different subject in

C# OleDb Exception “No value given for one or more required parameters” while trying to delete from Access database

为君一笑 提交于 2019-12-01 17:42:55
I have a table with "SEMESTER, SUBJECT, OFFER, RESULT" where "SEMESTER" & "SUBJECT" is PRIMARY KEY. When i use the query "DELETE FROM Course_Information WHERE Semester = 1 AND Subject = 'CSE-414' ; Its working perfectly in access database but i always get exception when i tried to use it in my c# code. Moreover its works if i use "DELETE FROM Course_Information WHERE Semester = 1 ; I want to use both "SUBJECT" & "SEMESTER" In the WHERE condition (Because there could be different subject in the same semester) See my code, connection_string = aConnection.return_connectionString(connection_string

How to force ADO.Net to use only the System.String DataType in the readers TableSchema

两盒软妹~` 提交于 2019-12-01 16:03:16
I am using an OleDbConnection to query an Excel 2007 Spreadsheet. I want force the OleDbDataReader to use only string as the column datatype. The system is looking at the first 8 rows of data and inferring the data type to be Double. The problem is that on row 9 I have a string in that column and the OleDbDataReader is returning a Null value since it could not be cast to a Double. I have used these connection strings: Provider=Microsoft.ACE.OLEDB.12.0;Data Source="ExcelFile.xlsx";Persist Security Info=False;Extended Properties="Excel 12.0;IMEX=1;HDR=No" Provider=Microsoft.Jet.OLEDB.4.0;Data

How to force ADO.Net to use only the System.String DataType in the readers TableSchema

别来无恙 提交于 2019-12-01 14:12:03
问题 I am using an OleDbConnection to query an Excel 2007 Spreadsheet. I want force the OleDbDataReader to use only string as the column datatype. The system is looking at the first 8 rows of data and inferring the data type to be Double. The problem is that on row 9 I have a string in that column and the OleDbDataReader is returning a Null value since it could not be cast to a Double. I have used these connection strings: Provider=Microsoft.ACE.OLEDB.12.0;Data Source="ExcelFile.xlsx";Persist

Can we add Reference of 'Microsoft.ACE.Oledb.12.0.dll' to project

时光怂恿深爱的人放手 提交于 2019-11-30 09:48:49
I am getting error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on my testing servers. So My Question is : i) Can i add reference for "'Microsoft.ACE.Oledb.12.0.dll'" to project it self? ii) Is it safe? iii) How to do this? Every thing is working on my local machine since i have latest version of office install in my machine. As soon as i am deploying my code to testing servers i am getting above error. I might not be able to install Office on testing servers (Due to some reason). So is it possible to put all require dll in project itself and deploy that to