Click here to Skip to main content
14,921,476 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hai..,

In datagrid i display in drop down list. that dropdownlist values from database using select query i bind that values as interger as well as that database column as integer.now i display 0th row i display '--SELECT--' how can i write code. i wrote code like this '
SQL
OracleDataAdapter1.SelectCommand = SelectCommand
            SelectCommand.Connection = Me.getOracleConnection
            SelectCommand.CommandText = "select shift_num from S_TR_SHIFT"
            OracleDataAdapter1.Fill(dsprocess1)
            dsprocess1.Tables(0).Rows.InsertAt(dsprocess1.Tables(0).NewRow, 0)
            dsprocess1.Tables(0).Rows(0).Item("SHIFT_NUM") = "--SELECT--"
'
display casting error pl give me a solution


Thanks & Regards.,
IdhayaRani.C
Posted

1 solution

Try
SelectCommand.CommandText = "select '--SELECT--' UNION select shift_num from S_TR_SHIFT"
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900