|
-
Sep 9th, 2005, 10:05 AM
#1
Thread Starter
Member
multiple columns in DDList
How do I bind multiple columns to a drop down list.
I run a stored procedure to find a patient name.
I want to show the first and last name in the drop down list.
Here's a snipet:
If Not Page.IsPostBack Then
objSQLCmd = New SqlCommand
With objSQLCmd
.CommandText = "sp_GetPatientByName"
.CommandType = CommandType.StoredProcedure
.Connection = objConnection
.Parameters.Add("@LName", SqlDbType.Char).Value = strLName
.Parameters.Add("@FName", SqlDbType.Char).Value = strFName
End With
objDataAdapter = New SqlDataAdapter(objSQLCmd)
objDataSet = New DataSet
objDataAdapter.Fill(objDataSet)
ddlTest.DataSource = objDataSet
ddlTest.DataTextField = ("Last_Name")
'ddlTest.DataTextField = ("Last_Name" & ", " & "First_Name")
ddlTest.DataBind()
ddlTest.Items.Insert(0, "Select a Patient")
End If
Thanks in Advance!
Last edited by rothjm; Sep 9th, 2005 at 02:50 PM.
Reason: RESOLVED
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|