Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Have a dropdown box display Field names
Message
De
17/03/2004 23:48:39
 
 
À
17/03/2004 20:44:34
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00885766
Message ID:
00887396
Vues:
18
>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()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform