Format DropDownList.TextValue

后端 未结 7 1569
失恋的感觉
失恋的感觉 2020-12-15 10:54

My stored procedure is like this

SELECT Id, StudentName
FROM xyz

I have a drop down list in asp.net, which I am loading as :



        
7条回答
  •  暖寄归人
    2020-12-15 11:36

    If the DataSource is a DataTable, you can add an "expression" (calculated column) to the table. The expression for the new column would look like this:

    newcolumn.Expression = "Id + ' - ' + StudentName";
    

提交回复
热议问题