开发者

How to delete record from DB having composite key

I have asp.net app where I am using gridview for data showing, editing and deleting. Now I want to delete or edi开发者_如何学JAVAt record from table and I need to pass 3 cols in DataBinder.Eval(Container.DataItem,"colName"). how i can do this?

EDITED

Basically when i need to update or delete record from asp.net app, I have to pass values of 3 columns (which are composite keys) to my UDF. Now How I can pass 3 different values to DataBinder.Eval() and reading them in GridView Rowcommand event.

thanks


Although I do not understand the context; if you really need to pass "three in one", you could concatenate them in a string and split up later again like

string.Format("{0}-{1}-{2}", key1, key2, key3)

and later, split it up again with

string.Split('-')

to have the separated values again.


Maybe if you have such tasks, it is better to just add primary key to your database table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜