S
SL
Could someone direct to a simple explanation of how to use MS Visual Studio
2003 to design .aspx code?
This code works if pasted into notepad and run as an .aspx file:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="vb" runat="server">
Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Dim objConnection As OleDBConnection
Dim objCommand As OleDBDataAdapter
Dim strConnect As String
Dim strCommand As String
Dim DataSet1 As New DataSet
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; "
strConnect += "Data Source =C:\Sample ASPNet\Ch02\grocertogo.mdb; "
strConnect += "Persist Security Info=False"
strCommand = "Select ProductName, UnitPrice FROM products"
objConnection = New OleDbConnection(strConnect)
objCommand = New OleDbDataAdapter(strCommand, ObjConnection)
objCommand.Fill(DataSet1, "products")
DataGrid1.DataSource = DataSet1.Tables("Products").DefaultView
DataGrid1.DataBind()
End Sub
</script>
<html>
<head>
<title>Data Grid Control Example</title>
</head>
<body>
<asp
ataGrid id="DataGrid1" runat="server" />
</body>
</html>
However, if I open VS, ASP.net web application, go to the sourcecode view,
paste it in, I get a bunch of errors. It doesn't even recogize " <script
language="vb" runat="server"> "
I know there has to be a way.
Thanks
Scott
2003 to design .aspx code?
This code works if pasted into notepad and run as an .aspx file:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="vb" runat="server">
Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Dim objConnection As OleDBConnection
Dim objCommand As OleDBDataAdapter
Dim strConnect As String
Dim strCommand As String
Dim DataSet1 As New DataSet
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; "
strConnect += "Data Source =C:\Sample ASPNet\Ch02\grocertogo.mdb; "
strConnect += "Persist Security Info=False"
strCommand = "Select ProductName, UnitPrice FROM products"
objConnection = New OleDbConnection(strConnect)
objCommand = New OleDbDataAdapter(strCommand, ObjConnection)
objCommand.Fill(DataSet1, "products")
DataGrid1.DataSource = DataSet1.Tables("Products").DefaultView
DataGrid1.DataBind()
End Sub
</script>
<html>
<head>
<title>Data Grid Control Example</title>
</head>
<body>
<asp

</body>
</html>
However, if I open VS, ASP.net web application, go to the sourcecode view,
paste it in, I get a bunch of errors. It doesn't even recogize " <script
language="vb" runat="server"> "
I know there has to be a way.
Thanks
Scott