Is it possible to 'alias' a Datafield Name so I can update with my business layer

A

AAJ

Hi all

this is a question out of curiosity rather then necessity, and I wonder if
anyone out there can help

I use a model in which a GridView binds to an ObjectDataSource which in turn
binds to my business layer using System.ComponentModel

if my gridview has the following property,

<asp:BoundField DataField="tbl_invoice_date" HeaderText="tbl_invoice_date"
SortExpression="tbl_invoice_date" />

when I update from the datagrid, my ObjectDataSource and hence my BLL method
both have to have a parameter called "tbl_invoice_date" i.e. the names have
to follow all the way through.

So my question is...

If my BLL and hence the update had a generic parameter called testdate i.e.

<asp:ObjectDataSource ID="ObjectDataSource1" ......

<UpdateParameters>
<asp:parameter Name="original_pk_" Type="Int32" />
<asp:parameter Name="testdate" Type="DateTime" />
</UpdateParameters>

how can I make my gridview interface with my generic ObjectDataSource is
there something I could use perhaps use some kind of Alias technique i.e.

<asp:BoundField DataField="tbl_invoice_date" Alias = "testdate"
HeaderText="tbl_invoice_date" SortExpression="tbl_invoice_date" />

if anyone knows it would be really useful

thanks

Andy
 

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

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top