hi all.

well, I have finally sorted out my workstation and have vs.net installed
and working.

I have the Wrox Press book "Professional ASP.NET" (released around Beta
2) and am just starting to have a go at connecting to datasources, etc.

I'm a bit baffled :)

When I created a new page I got the following at the top:

----- 8< -----
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="WebApplication3.WebForm1"%>
----- >8 -----

I used the same page and wrote some of the example code in, as follows:

----- 8< -----
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.SqlClient" %>

<html>

<head>
        <script language="vb" runat="server">

                sub Page_Load(source as object, e as eventargs)
                
                        dim myConnection as SQLConnection
                        dim myCommand as SQLCommand
                        dim myReader as SQLDataReader
                        dim SQL as string
                        dim ConnStr as string
                        
                        SQL = "SELECT * FROM Shippers"
                        ConnStr =
"server=capsicum;uid=sa;pwd=;database=Northwind;"
                        
                        myConnection = New SQLConnection(ConnStr)
                        myConnection.Open()
                        
                        myCommand = New SQLCommand(SQL, myConnection)
                        myReader = myCommand.ExecuteReader()
                        
                        Shippers.DataSource = myReader
                        Shippers.Databind()
                        
                        MyLabel.Text = myConnection.ConnectionString
                
                end sub

        </script>
</head>
                
<form runat="server">

        <asp:DropDownList id="Shippers" name="Shippers"
DataTextField="CompanyName" DataValueField="ShipperID" runat="server" />
        <asp:Label id="MyLabel" runat="server" />

</form>
</html>
----- >8 -----

What I want to know is why the page wont run with the <%@ Page
Language="vb" ... %> code in there, but runs fine if I take it out.

Any ideas?

Also, I am an experienced Classic ASP developer (5+ years) but I'm
slightly thrown by the .NET stuff.  Would anyone have any advice for me,
things to watch out for, etc, or any good tutorial sites?

Much appreciated.

 .ben

--
ben joyce // [EMAIL PROTECTED] // +44 (0)7958 933718 //
http://www.babelfish.co.uk


---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to