Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Have a dropdown box display Field names
Message
From
17/03/2004 23:48:39
 
 
To
17/03/2004 20:44:34
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00885766
Message ID:
00887396
Views:
17
>Here is a more complete code snippet of what I am doing... I doesn't have to be done this way. I'll do it any way that works. What I am trying to do is display a dropdown of fields to build a simplistic query builder on a

My first time using VB... but anyway. I put this into the pageload of my web form and it gave me a list of fields in the drop down.
Dim conn As Data.SqlClient.SqlConnection = New Data.SqlClient.SqlConnection("server=(local);database=pubs;trusted_connection=SSPI")
Dim ds As DataSet = New DataSet
Dim da As Data.SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("SELECT * FROM authors", conn)

conn.Open()
da.Fill(ds)
conn.Close()

DropDownList1.DataSource = ds.Tables(0).Columns
DropDownList1.DataBind()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform