473,513 Members | 3,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataTable questions

I am populating date and time into a date time, this is for a intra day price
series. Would you recommend that I use "string" data type for both date and time.

Also how do I query prices for a given date, I did

DataRow[] rows = dt.Select("priceDate = 6/1/2004","priceValue");

Could someone please help me with the syntax.

Is it true that there are no date and time datatypes in C# ?

regards
Nov 16 '05 #1
1 1069
Krish,

I would recommend that you use a DateTime to store the date and time
together. It doesn't make sense otherwise. You would have to create a
format to store it in that is neutral to location, etc, etc,.

If you want to query for a given date in a DataTable, then you could
have your query be:

priceDate >= #6/1/2004# and priceDate < #6/2/2004#

The general expression is:

priceDate >= (date) and priceDate < (date + 1)

This should be easy to do with an instance of DateTime that you want to
search against.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Krish" <sk*******@snet.net> wrote in message
news:87*************************@posting.google.co m...
I am populating date and time into a date time, this is for a intra day price series. Would you recommend that I use "string" data type for both date and time.
Also how do I query prices for a given date, I did

DataRow[] rows = dt.Select("priceDate = 6/1/2004","priceValue");

Could someone please help me with the syntax.

Is it true that there are no date and time datatypes in C# ?

regards

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2475
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to have a separate data adapter & a separate data set for each select query? If thats possible then how?
1
1796
by: jason | last post by:
Hello everyone, I have some general questions about the DataTable object, and how it works. Moderately new to C#, I have plenty of texts describing the language, but not so much to reference ADO.NET objects (only the MSDN help files). I have written a C# Class Library that is responsible for encapsulating database information. All the...
2
1589
by: Mark | last post by:
I am trying to use a Pagable Repeater with checkboxes in ASP.Net, I cannot seem to associate the checkbox with a particular database record so I lose the checked state from page-to-page. Below is a sample 1-page ASP.Net apllication built to run against the SQL pubs database. There are contents of 2 files 1. ASPX, 2. ASPX.VB If there is...
10
3143
by: Bob Day | last post by:
Using vs 2003, vb.net sql msde.. Consider the following code snippets. See **** for questions. All are shared and accessed by multiple threads simultaneiously. ' Instantiate per for this shared class Private Shared gcCDsd As New Class_Component_Designer
10
4927
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than the column order of the datatable). I also allow the user to click on a column header to sort the datagrid by that column. I need to identify...
10
6503
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I have one querie that grabs all of the id's I need for the other 4 queries, but I am not sure how to get them into a DataTable or DataSet, or if that...
1
3722
by: George | last post by:
Hi, I have a DataGridView, bounded to a DataTable which is populated/updated by a OleDbDataAdapter (with OleDbConnection) to an Access Database. (Sounds familiar to some of you ... I have posted a number of related questions already.) I want to have a worker thread starting to consume data from the DataTable. Imagine that the DataTable...
6
50395
by: George | last post by:
Hi, I have been encountering a refresh problem with DataGridView, which is bound to a DataTable. When I make updates (Add, Delete, update) to the DataGridView, everything flow nicely to DataTable. No problem here. However, when I add data (programatically) to the DataTable, the DataGridView does not refresh right away. If I minimize...
0
1762
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: //=================================================================== // The table
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.