0
データベースとバインドするドロップダウンリストを作成しようとしました。私は本当に見つからないいくつかのエラーを見つけました。助けてください、以下は私のコードです。データベースを使ってドロップダウンリストを作成するには?
strSQL = "SELECT distinct table1.DeptName FROM Table1 " & _
"FULL JOIN Table2 on table1.DeptName = Table2.deptname" & _
"FULL JOIN Table3 on Table1.deptname = table3.DeptName " & _
"Where table1.deptname is not null order by table1.deptname "
Common.OpenConn()
Common.execReader(strSQL, params, dt, Common.txn)
If dt.Rows.Count > 0 Then
DropDownListDept.DataSource = dt
DropDownListDept.DataTextField = "DeptName"
DropDownListDept.DataValueField = "DeptName"
DropDownListDept.DataBind()
DropDownListDept.Items.Insert(0, New ListItem("Select Department Name", "0"))
End If
エラーが
無効な列名を見つけた 'DeptNameFULL'。
ありがとうございました。それは働いている。 – user3759016