Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2004, 02:57 AM
Registered User
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default using asp code with html code

dear all
i have the wrox book (beginning asp.net 1.1 with vb.net 2003).
in capter 2 page 59 the author try to use asp.net code with html but the code of asp.net not executed and no error dispaly its just neglected.
any one could help me
with my regards

jordan
 
Old July 21st, 2004, 03:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

This should be posted under a .net forum of this site. But you have posted that in a feedback forum.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 21st, 2004, 11:48 AM
Authorized User
 
Join Date: Jul 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jordan,

Do you use WebMatrix or do you have IIS installed with the .Net Framework? Which version of the .Net framework you using?

Download the book code and check your code against the downloaded sample, there are some erros in the books code, sometimes you learn more if you can figure out how to solve the problem and make it work on your own.




The.Student

What does my picture not work !
 
Old July 22nd, 2004, 01:14 AM
Registered User
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi devanti
I am using IIS and I download the code, but I think the web matrix is the reason of the problem. see below the complete code and if you could please tell me how to convert it to comfort IIS .

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>


<script runat="server" runat="server" debuge="true">

    ' Insert page code here
    Sub Page_Load(Sender As Object, 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:\asp.mdb;"
       strConnect += "Persist Security Info=False"

       strCommand = "SELECT number, name FROM asp_t1"

       objConnection = New OleDbConnection(strConnect)
       objCommand = New OleDbDataAdapter(strCommand, objConnection)
       objCommand.Fill(DataSet1, "asp_t1")
       DataGrid1.DataSource=DataSet1.Tables("asp_t1").Def aultView
       DataGrid1.DataBind()
    End Sub

</script>

<HTML>
    <HEAD>
        <title>Data Grid Control example</title>
    </HEAD>
    <body>
        <asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>
    </body>
</HTML>


jordan
 
Old July 22nd, 2004, 05:53 AM
Authorized User
 
Join Date: Jul 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jordan,

Well first things First you want to change the position of your debug="true" declaration and correct the typo
place this in the <%@ Page Language="VB" %> declaration. As far as I can see thats the only problem with your code.

As for IIS, you need to ensure that the .NET Framework client and virtual directories have been installed, then all you should need to do is open IE and type in localhost/your-filename.aspx, if IIS is configured correctly then this should run, do you have the Quickstart samples installed?

I have IIS installed and WebMatrix and I prefer to use the built in WebMatrix server for testing, Webmatrix uses the locahost:8080/your-filename.aspx URi. So when you run this code are any errors displayed or do you get a datagrid showing the numbers and names from the asp_t1?



The.Student

What does my picture not work !
 
Old July 25th, 2004, 01:00 AM
Registered User
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi united kingdom

  when I use this code no error display and no data also dispaly I just have empty explorer .
  thank you for help but its not work yet.

jordan
 
Old August 3rd, 2004, 05:30 PM
Authorized User
 
Join Date: Jul 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Again Chap, sorry for the delay in replying...

First of all take one of the runat="server" declarations out of the script tag, next make sure that you have saved your page in an IIS virtual directory e.g. http://localhost/virtualdirectory/filename.aspx ensure that your IIS is up and running test this by typing localhost into Internet Explorers address bar. The default localhost window should appear.

If the problem still persists try reinstalling the .Net Framework, then test.

Let me know how you get on...

The.Student

What does my picture not work !
 
Old August 17th, 2004, 10:28 AM
Registered User
 
Join Date: Aug 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by maennet
 Hi devanti
I am using IIS and I download the code, but I think the web matrix is the reason of the problem. see below the complete code and if you could please tell me how to convert it to comfort IIS .

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>


<script runat="server" runat="server" debuge="true">

    ' Insert page code here
    Sub Page_Load(Sender As Object, 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:\asp.mdb;"
     strConnect += "Persist Security Info=False"

try

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server" debug="true">

and for the connection string try

dim strconnect as string = "provider=Microsoft.jet.oledb.4.0;data source=" & server.mappath("asp.mdb")

make sure your database is in the same folder as you aspx page here otherwise you'll have to specify the directory structure etc.

If you have no luck check your .net framework is running properly... by trying out simpler .net pages

 
Old August 17th, 2004, 11:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Try taking debug="true" out of the script tag and put it in the page tag.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
ASP code in html file Cinderella Classic ASP Basics 5 September 10th, 2004 03:08 AM
store html code in a sql database through ASP.NET jmjyiannis VB.NET 2002/2003 Basics 0 July 9th, 2004 01:36 PM
HTML Code Problem Ben Horne HTML Code Clinic 5 October 9th, 2003 10:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.