dataset

Errors with large data sources

I'm doing some benchmarking on large data sources and binding/exporting data for reporting. I started with using a data set, filling it with 100000 rows and then attempting to open a crystal report with the retrieved data. I noticed that the data set filled just fine (took about 779 milliseconds) however, when attempting to export the ...

Using LINQ to fetch result from nested SQL queries

This is my first question and first day in Linq so bit difficult day for me to understand. I want to fetch some records from database i.e. select * from tblDepartment where department_id in ( select department_id from tblMap where Guest_Id = @GuestId ) I have taken two DataTable. i.e. tblDepartment, tblMap Now I want to fe...

Howt o get the t-sql statements being used to Update a DataSet

I've a c# DataSet object with one table in it, and put some data in it and i've made some changes to that dataset (by code). Is there a way to get the actual t-sql queries this dataset will perform on the sql server when I update the dataset to the database with code that looks something like this: var dataAdapter = new SqlDataAdapter(...

How to use different providers for Linq to entities?

I'm trying to familiarize myself a bit more with database programming, and I'm looking at different ways of creating a data access layer for applications. I've tried out a few ways but there is such a jungle of different database technologies that I don't know what to learn. For instance I've tried using datasets with tableadapters. Usin...

xml attribure in dataset

I want to bind Repeater control to Dataset which is filled with XML data, but i don't know how to show attributes inside repeater. Xml File: <root> <items> <item id="9" name="111111111111" description="111111245" views="1" galleryID="0" /> </items> </root> Repeater code: <asp:Repeater ID="rptrGalleries" runat="server"> ...

Am getting un-expected NULL values in a Datagridview's calculated column

I have a Bindingsource that am setting as a datasource to a DataGridView control. In its dataset query i have a calculated column(Column1). When i go to the Bindingsource's tasks and click Preview Data i can, for my Column1 other rows have data values returned and for other rows NULL is returned which is ok and expected. The problem is ...

How to create Query syntax for multiple DataTable for implementing IN operator of Sql Server

I have fetched 3-4 tables by executing my stored procedure. Now they resides on my dataset. I have to maintain this dataset for multiple forms and I am not doing any DML operation on this dataset. Now this dataset contains 4 tables out of which i have to fetch some records to display data. Data stored in tables are in form of one to m...

Preserving DataRowState when serializing DataSet using DataContractSerializer

For various reasons I am having to send a typed dataset to a WCF service endpoint. This works fine except that upon Deserializing, the RowState of each row in each DataTable is set to 'Added', regardless of what they were on the client. If I write the serialized stream out to a file, I see that the RowState is not part of the Serialized ...

Many to Many DataSet Insert to Database using Stored Procedures

I'm trying to do a many-to-many bulk insert to the database using a list of three different types of models. The only tools I can use are stored procedures and datasets. (But I can't use DataSet fills or DataAdapters, just plain ol' Stored Procedures). Is there an easy way to pass multiple values, let alone, pass three different lists an...

dataSet.writeXml does not write an empty tag if the field was empty C#

Hi there, I want to create a XML of my DataSet using the .writeXml-function. If an entry in my DataSet was null, i would like to have an empty tag instead of a missing tag: example how it should look like if John had no age: <MyDataSet> <ID>8613458</ID> <AW_ID>37534778</AW_ID> <NAME>Peter</NAME> <AGE>22</AGE> </MyD...

dataset to List<T>using linq

I have a DataSet and I want to convert the DataSet into List<T> T - type object How convert my DataSet? It has 10 columns, with all 10 properties my object has and it's returning over 15000 rows. I want to return that dataset into List<obj> and loop it how do I do that? ...

Slow T-SQL query, convert to LINQ to Object

I have a T-SQL query which populates a DataSet from an MSSQL database. string qry = "SELECT * FROM EvnLog AS E WHERE TimeDate = (SELECT MAX(TimeDate) From EvnLog WHERE Code = E.Code) AND (Event = 8) AND (TimeDate BETWEEN '" + Start + "' AND '" + Finish + "')" The database is...

Read XML file from ADO (VB6) Into .Net DataSet

I am trying to assist users in migrating from a VB6 application to a C# application. The VB6 app allows the export of data from an ADO (2.8) recordset via XML, but the C# application fails to read the XML producing the following error: System.Data.DuplicateNameException: A column named 'name' already belongs to this DataTable VB6 Code ...

C#/DataSet: Create and bind a custom column/property in a DataSet`s DataTable in the XXXDataSet.cs

Hello, I have a DataSet with a DataTable having the columns Number and Description. I do not want to bind both properties to a BindingSource bound again to 2 controls. What I want is a 3rd column in the DataTable called NumberDescription which is a composition of Number and Description. This property is bound only to 1 control/Bindi...

Crystal Reports Server 2008 V1, SetDataSource to DataSet fails.

I'm using CR Server 2008 V1, and I have reports which are bound to MS SQL Stored Procedures. In some cases I don't want to execute SP and I want to bind report to DataSet instead. I tried this: ConnectionInfo ci = rcd.DatabaseController.GetConnectionInfos(null)[0].Clone(true); ci.Attributes.Add("Database DLL", "crdb_adoplus.dll"); ci.At...

How can I write Join statements on dataset..

How can I write Join statements on dataset.. I have data in xml format..I can load that data into a dataset.. but how do i fetch data from two datatables using a join query ...

What data structure would be the least painful DataTable replacement?

I'm storing a lot of sorted ~10 row 2 column/key value pairs in ASP.NET cache-- they're the data for dropdownlists. Right now they are all DataTables, which isn't very space efficient (the rule of thumb is 10x increase in size when data is strored in a dataset). Old Code DataTable table = dataAccess.GetDataTable(); dropDownList.Data...

when i merge a data table with a typed dataset, one single field on a single row is DBNull sometimes

Hi everybody, I have a strange problem sometimes when I try to merge a data table with a typed dataset my data table is filled in with a stored procedure and when I checked the content of this table it is ok, everything is in there straight after I merge it with my core typed dataset like this : MyTypedDataSet.TheTable.Clear(); MyTyp...

DataAdapter SelectCommand that excludes current DataTable rows

Is there a clean method of creating a DataAdapter SelectCommand to select rows from the database that are not already present in the DataTable? I am calling DataAdapter.Fill(DataTable) and only want to have new rows inserted into the DataTable. ...

How effectively manage a database: using direct sql commands or DataSets?

Sometimes I need to develop a simple database application using MS Access Databases. I`ve learned that I can manipulate data in my tables using direct SQL Commands or gather everything in a DataSet and update any changes that it tracks (insert, delete...). But the question is: should my app make changes is my database tables using dire...