dataset

How to remove column in DataSet and distinct rows to find only group names?

I have DataSet which has 3 columns. Name - insurance comp. name - treatmentDate Ali Boz SGK 12.04.09 Ali Boz SGK 14.04.09 Ali Boz SGK 16.04.09 Ali Boz SGK 18.04.09 Veli Aş AKBANK ...

Large dataset and winforms

I have a dataset which is about 3 million records, and I would like to load them in to a Data Grid within an application (WinForm). What is the best approach / method of displaying the data. I need to be able to run a filter to the data to reduce down the data set, ideas would be welcomed ...

Updating and persisting dataset problem

I think I'm missing sth. trivial here : I want to update a dataset and push it back to the database where it came from, but I am keep getting a : Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. Here's some code producing this error : public static void UpdateNorthWindWithDataset() { stri...

What is the best way to update a MsAccess table in .NET

When several fields in a MSAccess table need to be updated (For instance Salary=Salary*Factor, SomeNumber=GetMyBusinessRuleOn(SomeNumber) etc...),and the update should affect every record in a table, which technique would you use? I have just started to implement this with DataSets, but got stuck (http://stackoverflow.com/questions/8587...

Changing the DateTimeMode of a few columns in a dataset after it has been populated with data

Hi, I need to change the DateTimeMode of some columns in an already populated dataset. (I don't want to change it before it gets populated as it would mean making changes in several methods throughtout the application.) Here's the stmt I am using (for a single column): copy.Tables[0].Columns["DateColName"].DateTimeMode = DataSetDateTim...

Converting DateTime data to String in dataset

Hi, I have a dataset which stores dates in a DataColumn (datatype of this column is DateTime). I need to change the format from DateTime to string that will give me the date as per my current culture. In case of a single DateTime variable, I can use the overloaded ToString() to achieve this in the following manner: DateTime.Now.ToStrin...

How can we transparently serialize Dataset ExtendedProperties in WCF?

We are migrating from Remoting to WCF a very big application that makes intensive use of DataSets. We use the ExtendedProperties of the DataSets' tables to store a graph of objects containing special information we need at client side. In our Remoting implementation we did add to the channel stack a client and a server channels to check...

C# Best way to delete a row from typed dataset bounded by binding source

Hello, C# 2008 SP1. I am deleting a row from a row that is currently selected on a datagridview. I am using a Typed dataset and my datagridview is bounded to a binding source. However, I think my technique is not the best, even though it works. Many thanks for any advice, DataRow[] drDelete; // Get the value of the PK ...

Is it possible to update/insert data into dataset with SqlCommand?

I use this code to update data in database table. Can reuse same code to update a dataset? Thanks. using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString)) { string sql = "UPDATE tbh_Categories SET Title = @Title, Description = @D...

Can you include linq-to-sql changes and ADO.NET dataset table adapter updates in a single transaction?

Here are the relevant technologies that I'm working with: Devart's dot Connect for Oracle (to facilitate Linq-to-Sql for Oracle). Strongly Typed ADO.NET Datasets. An Oracle database. Here's the challenge: My legacy code submits database updates with ADO.NET datasets and table adapters. I'd like to begin converting that code over to...

Dataset.Copy() not copying value of new record.

I have a dataset with multiple tables. One table in particular has one record in it. I am adding another record to this datatable and am using the Dataset.Copy() method to copy the entire dataset object to another instance. Dataset2 = DirectCast(Dataset1.Copy(), dsApplication) However, the new copy of the dataset returned from th...

Visual Studio 2008 SP1 Not allowing to add website datasources

Hi all. I have a project with two reports (master.rdlc & detail.rdlc) wich both uses datasets to fill data. So far so good. They work ok, or used to work ok. For some reason, they lost the references to the datasets and the datasets are not showing in the Website Data Sources window so I'm unable to work with them. Also in the window W...

Import XML into Dataset C#

Hi, I am trying to get a xml file into a dataset and am using the following code: DataSet ds = new DataSet("TestDataSet"); ds.ReadXml(FileName); and this xml file: <Catalog> <Rec> <ITEM dt:dt="string"/> <QTY dt:dt="string">1</QTY> <SUB dt:dt="string">1</SUB> <CATALOG dt:dt="string">ABC123</CATALOG> </Rec> <Rec> <...

Updating a SQL database table with a webservice

Hi I have an issue and I have looked long and hard over the Internet for an answer but cant find anything. I have a little app that sucks in a web service. It then passes this web services results another applications via its own web service and stores the request in a table. What I am trying to do is quickly import the results to ...

Fast algorithm for finding next smallest and largest number in a set

I have a set of positive numbers. Given a number not in the set, I want to find the next smallest and next largest numbers that are in the set. The only way I can think to do it now is to find the next smallest by decreasing by 1 until I find a number in the set, and then do the same for finding the next largest. Motivation: I have a bu...

how can I read an xml attribute using readXML? how does dataset.readxml translate into tables?

I just want to know how does the table resulting from readXML look like, say if the xml file looks like this: <item attr="some attribute"> <descirption>anything</description> </item> I can reference tables directly by the Tables collection like this: ds.ReadXml(xml); ... ds.Tables[i] then I can access rows and columns using the row...

Should I Dispose() DataSet and DataTable?

DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods. However, from what I've read so far, DataSet and DataTable don't actually have any unmanaged resources, so Dispose() doesn't actually do much. Plus, I can't just use using(DataSet myDataSet...) because DataSet ha...

MySQL - show field value only in first instance of each grouped value?

I don't think this is possible, but I would like to be proved otherwise. I have written a simple report viewing class to output the results of various database queries. For the purpose of improving the display, when I have a report with grouped data, I would like to display the field value only on the first row of each unique value - an...

How to store data to Excel from DataSet without going cell-by-cell?

Duplicate of: What’s the simplest way to import a System.Data.DataSet into Excel? Using c# under VS2008, we can create an excel app, workbook, and then worksheet fine by doing this: Application excelApp = new Application(); Workbook excelWb = excelApp.Workbooks.Add(template); Worksheet excelWs = (Worksheet)this....

How to update Dataset Parent & Child tables with Autogenerated Identity Key?

I am using ADO.NET Datasets in my VB Applocations. I have a typed dataset with one Parent table and many child tables. I want to generate Identity Key when I insert data into Parent Table and then update the data in all child tables with the Same key (As Foregin key). At last, I want to update the dataset in Database(SQL Server08). Wel...