dataset

How to see progress of query execution during handle?

£可爱£侵袭症+ 提交于 2019-12-17 19:54:48
问题 I used the following code in delphi for handle : procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus); begin Progressbar1.Visible:=true; Progressbar1.Max:=MaxProgress; Progressbar1.Ppsitian:=Progress; Progressbar1.Visible:=false; end; but.... I can't see any effect (this code doesn't execute) I want to show progress of query execution during when the user clicked a button for ٍُSEARCH in database from begining to

How can I change the table adapter's command timeout

拥有回忆 提交于 2019-12-17 19:18:27
问题 I'm using Visual Studio 2008 with C#. I have a .xsd file and it has a table adapter. I want to change the table adapter's command timeout. Thanks for your help. 回答1: I have investigated this issue a bit today and come up with the following solution based on a few sources. The idea is to create a base class for the table adapter too inherit which increases the timeout for all commands in the table adapter without having to rewrite too much existing code. It has to use reflection since the

Convert generic list to dataset in C#

大城市里の小女人 提交于 2019-12-17 17:32:27
问题 I have a Generic list of Objects. Each object has 9 string properties. I want to turn that list into a dataset that i can pass to a datagridview......Whats the best way to go about doing this? 回答1: Have you tried binding the list to the datagridview directly? If not, try that first because it will save you lots of pain. If you have tried it already, please tell us what went wrong so we can better advise you. Data binding gives you different behaviour depending on what interfaces your data

Custom DateTime formats when using DataSet.WriteXml in .NET

蹲街弑〆低调 提交于 2019-12-17 16:36:21
问题 I've got an issue where I am writing a DataSet to XML that has a column of type DateTime and I want to control the output format. DataSet data = LoadDataSet(); data.Tables[0].Rows[0]["MyDate"] = DateTime.Now; data.WriteXml(myFile); By default the format of the DateTime in the XML seems to be as follows: 2011-08-02T17:39:00-07:00 I'd like use a custom date format, or at the very least strip the timezone info. Is there any way to control the format of the DateTime columns in my dataset XML? My

Error: Deleted row information cannot be accessed through the row

你离开我真会死。 提交于 2019-12-17 16:31:42
问题 To whom this may concern, I have searched a considerable amount of time, to work a way out of this error "Deleted row information cannot be accessed through the row" I understand that once a row has been deleted from a datatable that it cannot be accessed in a typical fashion and this is why I am getting this error. The big issue is that I am not sure what to do to get my desired result, which I will outline below. Basically when a row in "dg1" is deleted the row beneath it takes the place of

Return multiple recordsets from stored proc in C#

天大地大妈咪最大 提交于 2019-12-17 16:09:15
问题 I am having to convert an ASP classic system to C# I have a stored procedure that can return up to 7 recordsets (depending on the parameters passed in). I need to know how I can simply return all the recordsets as individual DataTables so that I can loop through whatever is there, skipping to the next DataTable when I get to the end of it without having to run multiple SQL statements and use multiple adapter.Fill statements to add each table into a DataSet. In classic it was a simple Do While

Populating a dataset from a CSV file

谁说我不能喝 提交于 2019-12-17 16:08:27
问题 I would like to read the contents of a CSV file and create a dataset. I am trying like this: var lines = File.ReadAllLines("test.csv").Select(a => a.Split(';')); DataSet ds = new DataSet(); ds.load(lines); but apparently this is not correct. 回答1: You need to run a SELECT statement against the CSV file to fill the dataset: Edit: here's some sample code from http://carllbrown.blogspot.co.uk/2007/09/populate-dataset-from-csv-delimited_18.html string FileName = ... OleDbConnection conn = new

Is there a Python module to open SPSS files?

主宰稳场 提交于 2019-12-17 15:39:40
问题 Is there a module for Python to open IBM SPSS (i.e. .sav) files? It would be great if there's something up-to-date which doesn't require any additional dll files/libraries. 回答1: I have released a python package "pyreadstat" that reads SPSS (sav, zsav and por), Stata and SAS files. It is a wrapper around the C library ReadStat so it is very fast. Readstat is the library used in the back of the R library Haven, which is widely used and very robust. The package is autocontained. It does not

Populate Dataset With Table Names From Stored Procedure

被刻印的时光 ゝ 提交于 2019-12-17 14:51:15
问题 I have a stored procedure that returns multiple tables. It populates my dataset correctly but it names my tables [ Table , Table1 , Table2 ,...]. Is there something I can add in the database layer (to my stored procedure) that will name the tables properly? 回答1: Your SP is not actually returning multiple tables, its returning a selection of columns and rows from your tables, therefore there is no 'table name', and hence why they are named table1, table2 etc. If its important, you could return

How do I transform a List<T> into a DataSet?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 10:24:13
问题 Given a list of objects, I am needing to transform it into a dataset where each item in the list is represented by a row and each property is a column in the row. This DataSet will then be passed to an Aspose.Cells function in order to create an Excel document as a report. Say I have the following: public class Record { public int ID { get; set; } public bool Status { get; set; } public string Message { get; set; } } Given a List records, how do I transform it into a DataSet as follows: ID