dataset

DataSets Tutorials

Hi there, I'm currently in the planning phase of a project and I came across an interesting question (for me) - how the f* do DataSets work anyway? I mean, since now I always used simple SQL-Statements written hard in the code, but that doesn't seem so sophisticated to me. So basically I want to start using DataSets but there are no tu...

Problems with huge CPU overhead

I'm writing an application in vb.net 2005. The app reads a spreadsheet into a DataSet with ADO.NET and uses a column of that table to populate a ListBox. When a ListBox Item is selected, the user will be presented with detailed information on the selected record. One part of this information isn't in the DataSet. I have to compare a col...

.NET Dataset design

I have some concern about designing Datasets. I was told that it would be good to have a dataset for each table for maintenance purpose. Because frequent change in database tables is expected, having one dataset including every tables would be pain to make the corresponding change in the application. Q. is it good approach to have a ...

Dataset ReadXML method Stream vs. String

I have code that calls the ReadXml method of the DataSet class and passes in a file name ReadXml(strFileName). Occasionally this throws a System.IO.IOException because the file is being used by another process. If I change the code to use the ReadXml(stream) method and pass in a FileStream like this: using(FileStream fs = new FileStre...

How to return as little rows as possible from related table

Hello, I am new to ADO.net and have this problem: Let's assume I have these two tables in a SQL Server 2005 database, with these columns: [Orders] OrderID OrderDate ShopID TotalAmount TotalTaxAmount etc... [OrdersDetails] OrderID ShopID ItemID Quantity Amount TaxAmount etc I have started a WinForms application to get myself st...

For loop skipping rows in DataSet

Hi! My Application uses For...Next loops to read a spreadsheet into a DataSet and then display information from it based on the results of search conditions (search term and a date range). I'm having a problem with the data where, if I run a search that should return the first 400 rows in the spreadsheet, I'm only getting around 200 re...

Inserting not commited to database

I'm having some trouble getting my DataSet to work. I have a MDB-Database in the background and created a DataSet out of it. Now I created a new method that lets me create a new user in the table. But when I call it, nothing happens. No exceptions, no errors and I even get "1" returned as number of affected rows. But when I look in the...

programmatically manage db connection while using datasets

I was just thinking if there was a way to programmatically open and close connections to the database via the dataset classes we've added into the project. I am trying to avoid one specific problem. Assume there is an EmployeeTableAdapter. It has two methods IsValid(string EmployeeID) and HasDepartmentAccess(string EmployeeID, string De...

Copy from dataset to access table in C#?

Hello All, I have a dataset (from an XML file), I want to read the schema and values from this dataset and copy it into an access table. I want to create the access database on fly (can use ADOX), create an access table (from ADOX) create the schema in this table and copy the values from dataset into this table. I am getting an error...

Twitter (Social networking) Dataset

I am looking for twitter or other social networking sites dataset for my project. I currently have the CAW 2.0 twitter dataset but it only contains tweets of users. I want a data that shows the number of friends, follower and such. It does not have to be twitter but I would prefer twitter or facebook. I already tried infochimps but app...

Populate Typed Dataset wit UNION ALL SQL query

I have a strange situation here and I hope someone can help me. I don't have the same problem when using an untyped dataset. OK. I have a typed dataset MyDS with a typed datatable MyTable (TableID, Title, Message). The table gets filled with results from two tables, using a UNION ALL Select TableAID, TableATitle, Message FROM T...

How to create a dataset from an xsd schema in Visual studio 2010

I searched for this here and on msdn but didn't find a satisfactory answer either because things changed from 2005/2008 to 2010 or I don't know how to use VS IDE. So, here is what I am trying to I have an xsd file and I want to perform searching operations on that. For that I figured that I would need corresponding classes and dataset i...

Error handling with SqlBulkCopy - could it be any harder?

Running very low on ideas here. I've got a case where I'm using SqlBulkCopy to pump data into a DB, and about halfway through I run into different exceptions (primary key violations, index violations, etc). I've confirmed that the violations are in fact true and need to be corrected in the data. What's infuriating, though, is that if I ...

Guidance on designing a solution - XML files vs database

I am thinking of storing bunch of data in XML files. Each file will has information about a distinct element lets say contacts. Now I am trying to do retrieve a contact based on some information eg: Find all the contacts who live in CA. How do I search for this information? Can I use something like LINQ. I am seeing XElement but does it ...

SelectGroupByInto is not grouping!

Hi people. I'm trying to use this implementation of a DataSetHelper to group a DataSet by a column. What I'm doing is: DataSet ds_tmp = new DataSet(); DataTable dt_tmp; ds_tmp.Tables.Add(data_table_UserTime); dsHelper = new DataSetHelper(ref ds_tmp); dt_tmp = dsHelper.SelectGroupByInto("UniqueUsers", ds_tmp.Tables[0], "User, sum(Time) ...

Remove headers from Powershell Datasets

I need to remove the headers and spacing from a SQL dataset in Powershell so i can compare the result. Using $res = $DataSet.Tables[0].rows | ft -HideTableHeaders removes the headers but leaves the spacing. What is the best way of just showing the result prptySwitch ----------- False $SqlCmd = New-Object System.Data.SqlClient.SqlCo...

c# bindingsource and linq

Hi all, I have a bindingsource which has been filled out by tableadapter.fill(DS, param1); lets say that this bindingsource has : char num A 1 B 2 C 3 how do I get num value with given char 'A' using linq? I could literate using foreach (DataRowView data in this.p_EM_Select_Event_TypeBindingSource) but I would li...

Fast way of going from Excel to a DataSet or DataGridView

I have data that I'm taking from an Excel sheet with the ultimate goal of displaying in a DataGridView. Currently I am just going over the UsedRange of excel data and plugging it into a datagridview. This works fine, but can get bogged down when there 100+ rows of data. I have also toyed with going from excel into a dataset (using the ...

C# DataSet Question - What does the value in quotes mean?

DataSet dataset = new DataSet("PinkElephant"); Can anyone give me insight into what PinkElephant means in this context. I understand that I'm declaring a new DataSet Object, but what is PinkElephant? Is it simply the name of the DataSet? Thanks ...

Calculate number of rows from dataset

In my code behind I have put an query result in dataset which returns a table like as bellow: Sl_NO COMPLEATED_ON SCORE IS_PRESENT MAX_VALUE 1 29/07/2010 4 0 12 2 29/07/2010 5 0 13 3 29/07/2010 6 1 ...