salut,
voilà y a tout dans le titre
mon code me met comme erreur sur la ligne "reader.ExecuteReader".....quelqu'un pourra m'aider?????
NB: meme si je fais :
reader = cmd.ExecuteReader()
ça ne marche pas..
voiçi mon code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| Sub Page_Load()
Dim conn As New SqlConnection
Dim reader As SqlDataReader
Dim serverName As String = "basemaster"
conn.ConnectionString = "packet size=4096;user id=wpmreports;pwd=welcome;data source=""" & serverName & """;persist security info=False;initial catalog=WPMDB"
conn.Open()
Dim cmd As SqlCommand
cmd = Nothing
cmd = New SqlCommand("SELECT technical_body.TB_KEY1 FROM(technical_body) GROUP BY technical_body.TB_KEY1 ORDER BY technical_body.TB_KEY1;", conn)
reader = cmd.ExecuteReader
Do Until Not reader.Read()
ListBox1.Items.Add(New ListItem(reader("champ"), reader("champ_id")))
Loop
reader.Close()
conn.Close()
ListBox1.text = Request("id")
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<font size="2">
<p align="center">
<asp:DropDownList id="ListBox1"
runat="server"/>
</p>
</font>
</form>
</body>
</html> |
Partager