S
Sam
I want to create dropdownlist where DataTextField and DataValueField are
extract from table gldate.
Example
Dropdownlist -> Jan-2005
-> Feb-2005
...
...
-> Dec-2005
Table gldate
============
DataTextField DataValueField
--------------------------------
Jan-2005 200501
Feb-2005 200502
.... ...
.... ...
Dec-2005 200512
Error
=====
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30188: Declaration expected.
Source Error:
Line 5: Dim cnSQL as New System.Data.SqlClient.SqlConnection()
Line 6:
Line 7: cnSQL.ConnectionString = "Password=88;Persist Security Info=True;
User ID=88;Initial Catalog=JDE_ERP_ARCHIVAL;Data Source=SQLSVR"
Line 8:
Line 9: cnSQL.Open()
Source File: C:\Documents and Settings\samuellai\My
Documents\Header\NewFile.aspx Line: 7
Search.aspx
===========
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Dim cnSQL as New System.Data.SqlClient.SqlConnection()
cnSQL.ConnectionString = "Password=88;Persist Security Info=True; User
ID=88;Initial Catalog=JDE_ERP_ARCHIVAL;Data Source=SQLSVR"
cnSQL.Open()
Dim GLDate as New SQLCommand ("select * from gldate",cnSQL)
Dim dr as SQLDataReader = GLDate.ExecuteReader
Do While dr.Read
End DO
dr.Close
GLDate = Nothing
dr = Nothing
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<aspropDownList id="DropDownList1" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" DataSource="<%#
SqlDataSourceControl2 %>" DataTextField="gl_date"
DataValueField="gl_date"></aspropDownList>
</form>
</body>
</html>
Please advise.
Many thanks.
extract from table gldate.
Example
Dropdownlist -> Jan-2005
-> Feb-2005
...
...
-> Dec-2005
Table gldate
============
DataTextField DataValueField
--------------------------------
Jan-2005 200501
Feb-2005 200502
.... ...
.... ...
Dec-2005 200512
Error
=====
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30188: Declaration expected.
Source Error:
Line 5: Dim cnSQL as New System.Data.SqlClient.SqlConnection()
Line 6:
Line 7: cnSQL.ConnectionString = "Password=88;Persist Security Info=True;
User ID=88;Initial Catalog=JDE_ERP_ARCHIVAL;Data Source=SQLSVR"
Line 8:
Line 9: cnSQL.Open()
Source File: C:\Documents and Settings\samuellai\My
Documents\Header\NewFile.aspx Line: 7
Search.aspx
===========
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Dim cnSQL as New System.Data.SqlClient.SqlConnection()
cnSQL.ConnectionString = "Password=88;Persist Security Info=True; User
ID=88;Initial Catalog=JDE_ERP_ARCHIVAL;Data Source=SQLSVR"
cnSQL.Open()
Dim GLDate as New SQLCommand ("select * from gldate",cnSQL)
Dim dr as SQLDataReader = GLDate.ExecuteReader
Do While dr.Read
End DO
dr.Close
GLDate = Nothing
dr = Nothing
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<aspropDownList id="DropDownList1" runat="server"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" DataSource="<%#
SqlDataSourceControl2 %>" DataTextField="gl_date"
DataValueField="gl_date"></aspropDownList>
</form>
</body>
</html>
Please advise.
Many thanks.