Re: Datagrid



Thanx for your reply Frank.

The fields in the database are not supposed to except null values. my
mistake, i should have said the first time itself that I am only inserting in
the time part as these fields are only suppose to hold time data, i.e.
start_time and end_time for an activity..and only the time data is entered
from a VB.NET form...I even tried to check the value in the Dataset with the
following code...

Me.DataGrid1.SetDataBinding(fr.DsProj1, "tblBilling")
MsgBox(fr.DsProj1.Tables(0).Rows(0).Item(3))

"DsProj1" --> is my dataset.
"tblBilling"--> is the table name.

It displays the time value correctly from the dataset that i have used to
bind the Datagrid with. however I the datagrid itself it shows the date data
and not the time data. Is there any special formatting that i need to do with
the datagrid to display the time data in the field??

thnx for the help!!


"Frank Hickman [MVP]" wrote:

> "Gaurav" <Gaurav@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:E0C54602-D7C0-4495-B594-9FDA3302A906@xxxxxxxxxxxxxxxx
> >I am displaying data from the SQL database in a datagrid. everything seems
> >to
> > be working fine except to columns. I have 2 cols start_time and end_time
> > in
> > the database. when these 2 cols are displayed in the datagrid it shows the
> > values as 30/12/1899 for all the rows in these 2 cols....any help
> > appreciated...
> >
> > thanx
>
> This is the default value for a date which is zero (NULL). If the column
> supports NULLs, you should test for this value prior to inserting it into
> the database and if it matches, set the column to NULL instead of inserting
> the date. If your using MFC or some other datetime class, there should be
> an IsValid function that you can use.
>
> --
> ============
> Frank Hickman
> Microsoft MVP
> NobleSoft, Inc.
> ============
> Replace the _nosp@m_ with @ to reply.
>
>
>
.



Relevant Pages

  • Re: Adding rows to DataGrid across multiple PostBacks
    ... (not adding to the database or whatever you want to perform ... is only after adding information for every Id Number to the datagrid.) ... datasource which can contain a collection of datatables. ... The user can then put in a new IDNumber, ...
    (microsoft.public.dotnet.framework.aspnet)
  • DataGrid and Selected Rows
    ... In the form I instantiate a DataTable object. ... I have a DataGrid on the form which is bound to the *second* ... How can I iterate through the rows of the grid and see which ones are ... Keep in mind that the DataGrid is not bound to the Access database, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: show collapsible datagrid headers
    ... I get a bunch of fields showing my expenses,for example, from the database. ... it should expand to show me columns for CarInsurance and HomeInsurance.Then i ... So i might have to create DIV tags and associate them with the datagrid ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: moving record in datagrid
    ... the results from your database ... can be determined by sort order. ... Obviously the "rows" in a datagrid have to be ordered by one of the fields. ... priority" field where the user assigns the priority of the record in the ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Large DataTables and DataGridView component under CF 2.0
    ... - there are not IBindingSource, ... that in this case programer should define View in database. ... > There is no DataGridView in NETCF, ... >> - if number of records in local buffer exceed some count, ...
    (microsoft.public.dotnet.framework.compactframework)