473,378 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

retrieve date from mysql in c#

i want to retrieve date field and other field from my mysql database using c# and want to show in datagridview, all field retrieve easily but exception genrated in date retriving.
//my query
string query = "SELECT accountName,_date,typeName,balance FROM accounts acc, accounttypes act WHERE acc.type_id=act.type_id";

sample code:

Expand|Select|Wrap|Line Numbers
  1. while (reader.Read())
  2.             {
  3.                 DataGridViewRow row = new DataGridViewRow();
  4.                 row.Height = 25;
  5.                 dgvAccountSummary.Rows.Add(row);
  6.                 for (int i = 0; i < reader.FieldCount; i++)
  7.                 {
  8.                     DataGridViewCell cell =   dgvAccountSummary.Rows[k].Cells[i];
  9.                 }
  10.                 k++;
  11.             }
Jun 6 '11 #1
0 1162

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: michele | last post by:
Hi, I want to load a listbox with the date that are stored in a database (mdb), the problem is when I retrieve the date it has a format like "01/01/2006 0.00.00". In Access the date is stored as...
2
by: Micela | last post by:
Hi, Please help me out in this task. I have a filed in the database of datetime. and 3 dropdown lists in the page. Im using Asp.net with VB coding. The three dropdown lists are 1.for date...
12
by: blast | last post by:
hi , i have a problem, here is the issue.... i have table with date stored as int.....say for eg : date: 11/30/2006 time:09:15 am is stored in the table as 1164896114 now i need to compare...
4
by: Simon Gare | last post by:
Hi all, I am trying to retrieve a count of booking entries made 30 days ago, below is the end of the query I am having problems with. dbo.booking_form.TimeOfBooking = DATEADD(day, -30,...
4
by: Chris Tate-Davies | last post by:
Hello. I have a generic table used for many different generic functions. the fields are mainly varchar's but one of these varchars contains dates (in the format dd/mm/yyyy) for one reason or...
5
by: akirekab | last post by:
I am using the following to retrieve a file and put in listbox. It is working fine. I would like to build on it to include the datecreated of the file and be able to also sort with that date. ...
1
by: pjnambiar | last post by:
Hello friends can any one help me out by providing code to read the date modified of a file. this is required because I have developed a enquiry utility where in i have to update the database...
3
by: subho2009 | last post by:
Hello friends, I have face a problem, the problem is that when i fetch data from mysql database i get '&' in the place of '&amp;'. I am using php 5.1.2 and mysql version 5.0.11-beta. What is the...
1
by: lornab | last post by:
Hi, I need to extract some data for todays date, my query is something like this: SELECT client, apar_id, voucher_no, trans_date FROM asutrans
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.