dataset

data error when reading csv file in C# winforms

拟墨画扇 提交于 2019-12-20 01:11:15
问题 I have a C# winforms that is reading a column from a csv file. It reads 3 of the 4 columns correct. The 4th column in the csv file is S4 , but the dataset is displaying 4 . The code is: string conn = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0; Data" + "Source={0}; Extended Properties=""text;HDR=YES;FMT=DELIMITED""", strDirectoryPath); OleDbConnection oleDBConn = new OleDbConnection(conn); oleDBConn.Open(); OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM [" + strFileName + "]",

How to update a dataset

≡放荡痞女 提交于 2019-12-19 11:40:14
问题 In my project, there are two textBoxes, txtName and txtPopulation and a Button, btnClick . whenever the user clicks btnClick , the value in the "Population" column of the dataset dsDetails should get updated by the value in txtPopulation , where the "Name" Column is equal to txtName . I know this can be done using rowfilter or select but I have no idea what to implement in it. Please no linq Currently, I am doing something like this..( working ) for (int intCount = 0; intCount < dsDetails

Populate DataGridView from a Stored Procedure

99封情书 提交于 2019-12-19 11:28:08
问题 Using SQL Server 2008 I created a Stored Procedure called MyStoreProc and it runs fine from the Management Tools. In VB.Net 2008 I created a new dataset and a new TableAdaptor. In this table adapter I created a new Query called FillByGrid and selected the Stored Procedure. Previewed data and it previewed correctly. On a form I created DataGridView and selected the Table Adapter from the dataset. I ran the app and no data is shown. Visual Studio autocreated the code below and I changed it to

How to get DataSet.ReadXml to parse a DateTime attribute as a typed DateTime

拟墨画扇 提交于 2019-12-19 10:44:47
问题 I have an XML string which contains Dates formatted "dd/MM/yyyy hh:mm:ss". I'm loading this XML into a dataset using DataSet.ReadXml() . How can I ensure that this Date is stored in the DataSet as a typed DateTime so that I can Sort, Format and RowFilter on it accordingly. My test harness is as below: ASPX Page: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XmlDateTypeList.aspx.cs" Inherits="Test.XmlDateTypeList" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

separate dataset instances using datamodules in delphi

杀马特。学长 韩版系。学妹 提交于 2019-12-19 10:05:36
问题 I am using Delphi6 and have a data module with an ADO DataSet which is used by two forms, formA and FormB. Each form has a Dataset.Open() in OnCreate and Dataset.Close() in OnClose . If both forms are open simultaneously and formB is closed the dataset is closed in formA. How can I prevent this, essentially I need separate instances of the dataset for each form but at the same time use the datamodule. 回答1: The simplest way to achieve what you want is to create an instance of the data module

Retrieving a database record set into an array in php

寵の児 提交于 2019-12-19 08:13:35
问题 I want to retrieve a set of records from a MySQL table as an array. So far I was able to retrieve each row as an associative array. But I want all the rows in one array because I have to access that complete object in jQuery to display them. This is what I have done so far.This is my .php script to retrieve data //select query $result = mysql_query("SELECT * FROM student",$con) or die (mysql_error()); $numRows = mysql_num_rows($result); //to iterate the for loop //passing as an associative

Delphi ADO Query

橙三吉。 提交于 2019-12-19 06:07:28
问题 Is there any faster way to iterate through an ADO Dataset than while (not ADOQuery1.Eof) do begin /* Do something */ ADOQuery1.Next; end; I need to scan a dataset of around 9000 items and only extract records matching a pre-defined set of branch numbers. 回答1: It is much faster to use ADORecordset for such tasks: while not ADOQuery1.Recordset.EOF do begin ADOQuery1.Recordset.MoveNext; // get value SomeVar := ADOQuery1.Recordset.Fields['FieldName'].Value; end; 回答2: Be sure that you use

Strongly typed datasets vs. weakly typed datasets

风流意气都作罢 提交于 2019-12-19 05:59:28
问题 What is meant by strongly typed datasets in .Net? Can anybody explain with a clear and brief example? And also, what is the difference between strongly typed and weakly typed datasets? 回答1: Strongly Typed Datasets are generated on the basis of a Db Schema. They consists of classes derived form DataSet, DataTable and DataRow. Db Columns become correctly typed properties of the TableRow derived class. An Untyped Dataset simply means the direct use of Dataset, not of a descendant. All column

How to Plot a Pre-Binned Histogram In R

本秂侑毒 提交于 2019-12-19 05:54:34
问题 I have a pre-binned frequency table for a rather large dataset. That is, a single column vector of bins and a single column vector of counts associated with those bins. I'd like R to plot a histogram of this data by doing further binning and summing the existing counts. For example, if in the pre-binned data I have something like [(0.01, 5000), (0.02, 231), (0.03, 948)], where the first number is the bin and the second is the count, and I choose 0.04 as the new bin width, I'd expect to get [

How to Plot a Pre-Binned Histogram In R

走远了吗. 提交于 2019-12-19 05:54:05
问题 I have a pre-binned frequency table for a rather large dataset. That is, a single column vector of bins and a single column vector of counts associated with those bins. I'd like R to plot a histogram of this data by doing further binning and summing the existing counts. For example, if in the pre-binned data I have something like [(0.01, 5000), (0.02, 231), (0.03, 948)], where the first number is the bin and the second is the count, and I choose 0.04 as the new bin width, I'd expect to get [