oledbdataadapter

How to sort 30Million csv records in Powershell

流过昼夜 提交于 2021-02-11 12:50:54
问题 I am using oledbconnection to sort the first column of csv file. Oledb connection is executed up to 9 million records within 6 min duration successfully. But when am executing 10 million records, getting following alert message. Exception calling "ExecuteReader" with "0" argument(s): "The query cannot be completed. Either the size of the query result is larger than the maximum size of a database (2 GB), or there is not enough temporary storage space on the disk to store the query result." is

How to sort 30Million csv records in Powershell

此生再无相见时 提交于 2021-02-11 12:50:03
问题 I am using oledbconnection to sort the first column of csv file. Oledb connection is executed up to 9 million records within 6 min duration successfully. But when am executing 10 million records, getting following alert message. Exception calling "ExecuteReader" with "0" argument(s): "The query cannot be completed. Either the size of the query result is larger than the maximum size of a database (2 GB), or there is not enough temporary storage space on the disk to store the query result." is

Remove the string after '-' and group remaining string and pivot column

两盒软妹~` 提交于 2020-01-25 07:59:05
问题 Here is my actual data in Excel, which I am successfully able to read in DataGridView in C# Windows Application. Test | Energy | --------------------- C018-3L-1 | 113 | C018-3L-2 | 79 | C018-3L-3 | 89 | C018-3L-4 | 90 | C018-3L-5 | 95 | C021-3T-1 | 115 | C021-3T-2 | 100 | But now I want this data in DataGridView in below Format from excel file: Test |Energy-1|Energy-2|Energy-3 | ------------------------------------ C018-3L |113 |79 |89 | C018-3L |90 |95 |NULL | C021-3T |115 |100 |NULL | Here

OleDbDataAdapter not filling all of the rows

☆樱花仙子☆ 提交于 2020-01-14 13:33:19
问题 Hey I am using the DataAdapter to read an excel file and fill a Data Table with that data. Here is my query and connection string. private string Query = "SELECT * FROM Sheet1"; private string ConnectString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=\"" + Location + "\";" + "Extended Properties=\"Excel 12.0 Xml;HDR=YES\""; OleDbDataAdapter DBAddapter = new OleDbDataAdapter(Query, ConnectString); DataTable DBTable = new DataTable(); DBAddapter.Fill(DBTable); The problem is my excel

Select statement ignoring parameters?

▼魔方 西西 提交于 2019-12-25 06:29:55
问题 When I use this code it returns every row in the table and i have no idea why. string SelectOleDb = "SELECT Top 1 * From `Employee Info` Where [Employee Name]=@EmployeeName" Order By ID DESC"; OleDbConnection OleDbCon = new OleDbConnection(EmployeeInfo.Properties.Settings.Default.cstrEmployeeInfoDatabase); OleDbDataAdapter OleDbAdpt = new OleDbDataAdapter(); OleDbCommand OleDbCom = new OleDbCommand(SelectOleDb, OleDbCon); OleDbCom.Parameters.AddWithValue("@EmployeeName", employee_NameComboBox

How to optimize this simple but complex looking implementation in VB.Net?

眉间皱痕 提交于 2019-12-24 11:37:40
问题 Aim to achieve : Want to dump a fetched table to a excel sheet. My implementation : Imports System.Data.OleDb Private Sub getRawDataNextMonth() Dim sheetName As String = "RawData" Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\rawData.xlsx;Extended Properties=""Excel 12.0 XML;""") Dim adapter As New Data.OleDb.OleDbDataAdapter("SELECT * FROM [Sheet1$]", con) Dim dataSet As New Data.DataSet adapter.Fill(dataSet) Dim dataTable As Data.DataTable = dataSet.Tables

How to import large excel file to datatable?

老子叫甜甜 提交于 2019-12-23 17:22:14
问题 I have an Excel file with 500 columns. I am using OLEDB to import it into a DataTable. But the DataTable contains only the first 255 columns. I can't figure out why the rest of the columns aren't imported. My code is public DataTable ToDataTable() { DataSet dsEmpMaster = new DataSet(); DataTable dtEmpMaster = null; string strConnectionString; string strSql; string FileNameWithPath = String.Format("{0}\\{1}", System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess()

DataAdapter.Fill(Dataset)

社会主义新天地 提交于 2019-12-18 12:27:54
问题 i try to get some Data from a Access Database via OleDB in a DataSet . But the DataSet is empty after the Fill() method. The same statement works and return 1 row when i trigger them manually in D*. OleDbConnection connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Inventar.accdb"); DataSet1 DS = new DataSet1(); connection.Open(); OleDbDataAdapter DBAdapter = new OleDbDataAdapter( @"SELECT tbl_Computer.*, tbl_Besitzer.* FROM tbl_Computer INNER JOIN tbl_Besitzer ON

Using OleDbDataAdapter to update a DataTable C#

我只是一个虾纸丫 提交于 2019-12-17 19:56:18
问题 I have been trying to use OleDbDataAdapter to update a DataTable but got confused about the commands. Since I sometimes get info from diffrent tables I can't use a CommandBuilder. So I have tried to create the commands on my on but found it hard with the parameters. DataTable.GetChanges returns rows that needs to use an INSERT or an UPDATE command - I guess I can't distinct between them. I need you to complete the following: DataTable dt = new DataTable(); OleDbDataAdapter da = new

Fill DataSet from OleDbDataAdapter

冷暖自知 提交于 2019-12-12 16:41:01
问题 I'm using OleDbDataAdapter to read the content of an Excel sheet in a dataset. The Excel sheet consists of 20391 rows, the dataset reads the total number of rows when running it on my local machine, but when running the code on an IIS7.5 server it reads only the FIRST 12463!! My connection string: switch (strFileType.Trim()) { case ".xls": connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strNewPath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\""; break; case ".xlsx":