dataset

C# DataSet Index

巧了我就是萌 提交于 2019-12-11 07:46:31
问题 I need to find records in a dataset that have certain values from more than 1 column. I cannot use the Find or Contains method since they require a primary key and my search values can be non-unique. Do DataSets have indexes (Much like a SQL table) that I can use to speed up my search? Right now I'm looping through the dataSet doing compares for each column but this method is very very slow (my data set has 600k rows). Thanks 回答1: You can use the DataTable Select method which lets you search

XML to dataset - problem finding what datarow contains a datatable

白昼怎懂夜的黑 提交于 2019-12-11 07:45:37
问题 Sorry if the description is poor, but I don't know how else to put this... But here is an example of the XML structure <?xml version=”1.0” encoding=”UTF-8”> <Response xmlns="http://www.blah.com"> <searchResult> <info> <firstName>John</firstName> <lastName>Doe</lastName> <totalCharges>100.00</totalCharges> <nonPaymentCode>99999</nonPaymentCode> </info> <info> <firstName>Susan</firstName> <lastName>Doe</lastName> <totalCharges>1000.00</totalCharges> <errorCodes> <errorCode>12345</errorCode> <

From date-time to usable value Python

微笑、不失礼 提交于 2019-12-11 07:44:46
问题 I need to make a histogram of events over a period of time. My dataset gives me the time of each event in the format ex. 2013-09-03 17:34:04, how do I convert this into something I'm able to plot in a histogram i Python? I know how to do it the other way around with the datetime and time commands. By the way my dataset contains above 1.500.000 datapoint, so please only solutions that can be automated by loops or something like that ;) 回答1: Use time.strptime() to convert the local time string

return multiple result sets from ms access to ado.net

别来无恙 提交于 2019-12-11 07:29:49
问题 hey guys i want to fetch 3 tables in 1 single ado.net call from my ms access database, however i get an error when i am trying to do that when i change my sql query to just fetch 1 table, my code works fine can anyone let me know how to achieve this with ms access? because i have been doing this with sql server since ages without any problems. perhaps access does not support multiple result sets? i have not worked much with access. please help. below is my code for reference: System.Data

C# Typed DataSets: OleDBDataAdapter use the column names from the Typed DataSet and not ExcelSheet

风格不统一 提交于 2019-12-11 07:26:20
问题 I'm using VS 2010 with C# for a Windows Form application. I need to load my data from the Excel sheet onto a DataSet. I created the DataSet using the DataSet designer and I manually added the tables and columns (FirstTable, Column1, Column2) . Since I access the columns a lot, the code would be a lot cleaner to have a typed dataset instead of using an untyped one. When I used the OleDBDataAdapter and populated the DataTable using Fill on FirstTable , Column1 and Column2 were empty and there

How to extract link url from Excel cell

荒凉一梦 提交于 2019-12-11 07:16:48
问题 I have a c# webjob that downloads and then reads an Excel file. One of the columns contains links that I'd like to save in my database. I'm currently using ExcelDataReader to convert the Excel file to a DataSet and then looping through the rows to grab the data. After conversion the column in question at this point is only a string containing the link text. From some other reading it sounds like in Excel, hyperlinks are stored elsewhere and that information isn't preserved when converting the

Updating Cells in a DataTable

て烟熏妆下的殇ゞ 提交于 2019-12-11 07:07:55
问题 I'm writing a small app to do a little processing on some cells in a CSV file I have. I've figured out how to read and write CSV files with a library I found online, but I'm having trouble: the library parses CSV files into a DataTable, but, when I try to change a cell of the table, it isn't saving the change in the table! Below is the code in question. I've separated the process into multiple variables and renamed some of the things to make it easier to debug for this question. Code Inside

MS-Access: TableAdapter UpdateCommand for table without primary key

橙三吉。 提交于 2019-12-11 07:07:00
问题 What's the syntax for an Update query for a table without a primary key? Disclaimer: Frustratingly, adding a primary key is not an option. My program is a small program in a much larger system with poor data management. My development time does not include rewriting the other software. Note: The database is Microsoft Access. Note: Similar to: Excel: TableAdapter UpdateCommand for table without primary key UPDATE: Am I correct in saying, "If the table in the database has no explicit primary

Numpy, Pandas: what is the fastest way to calculate dataset row value basing on previous N values?

岁酱吖の 提交于 2019-12-11 06:34:41
问题 I have a dataset and I want to enrich it. I need to calculate some new dataset column which is some function of previous N rows of another column. As an example, given I want to calculate binary column which shows if current day temperature is higher than average in previous N days. At the moment I just iterate through all the pandas dataset values using df.iterrows() and do appropriate calculations. This takes some time. Is there any better option? 回答1: use rolling/moving window functions.

Add buttons to datagridview in windows form

折月煮酒 提交于 2019-12-11 06:26:26
问题 I want to add two buttons onto datagridview. Now they are on the right side. But I want to locate them on the left. The other thing is I want to add an update event for "Edit" button. Is it private void Edit_Click(object sender, EventArgs e) { } Form code: private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'qDataSet.Metric' table. // You can move, or remove it, as needed. this.metricTableAdapter.Fill(this.qDataSet.Metric);