How to manupulate raw data then display the data on the datagrid

  • Thread starter Thread starter peter
  • Start date Start date
P

peter

In our database table, there are some fileds are not suitable to display on
the grid
directly. For instance, 12:30 saved as 720 in the table.
and we want to show customer name in one column rather than show firstname,
surname, title in three columns.
So I think I need query this table and then runtime manipulate these fields
and assign these to a dataset which link to a data grid. But I don't know
how to do this, or maybe there are some better ways to achieve the same
result.

I will appreciate very much if anyone can help me with this question.
 
Hello Peter,
In our database table, there are some fileds are not suitable to
display on
the grid
directly. For instance, 12:30 saved as 720 in the table.
and we want to show customer name in one column rather than show
firstname,
surname, title in three columns.
So I think I need query this table and then runtime manipulate these
fields
and assign these to a dataset which link to a data grid. But I don't
know
how to do this, or maybe there are some better ways to achieve the
same
result.
I will appreciate very much if anyone can help me with this question.

Probably the easiest way to do this on the .NET side of things is to use
an Expression Column.

http://msdn2.microsoft.com/en-us/library/3df0c8ey(VS.71).aspx

Alternatively, you could sole it by writing a custom SQL statement or stored
procedure that does as much as possible on the SQL Server side. for example:

select firstname + ' ' + lastname as name from customers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top