ASP.NET Code
  Home arrow ASP.NET Code arrow ASP.NET Guestbook
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET CODE

ASP.NET Guestbook
By: R. Abhiram Vikrant
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 314
    2004-03-17

    Table of Contents:
  • ASP.NET Guestbook
  • Viewing the Results
  • Setting Up the Drop Down Box
  • Connecting to the Database
  • Feeding the Database
  • Viewing Guestbook: viewcomments.aspx
  • Changing the ASP:DATALIST tag
  • Explanation of the Tags

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ASP.NET Guestbook


    (Page 1 of 8 )

    We are going to see the steps involved in designing a guestbook using ASP.NET and SQLServer as the backend. Guestbooks are an important tool to know about your site’s visitors and their opinions. I would like to give you an idea of a basic guestbook web application in this article.

    Requisites:
    1) Windows 2000 or Windows XP or Windows 2003
    2) Microsoft SQL Server 7.0 or 2000
    3) Internet Information Server
    4) Knowledge about VB.NET.
    5) Basics in SQL

    Pages in this Project:
    1) postcomments.aspx
    2) viewcomments.aspx

    We need a database to save the posted comments. The database can be anything from a simple text file to a sophisticated database engine. In this article I’ve used SQL Server 2000 (MSDE).

    Warning: Do not use the below script on a production database server. Use it on a SQL server that does not contain any sensitive data.


    Sql Script:
    filename
    ='d:guestguestD.mdf')
    log on
    (name='guestLog',
    filename
    ='d:guestguestL.ldf')
    go
    use guestbook
    use guestbook
    exec sp_grantDBaccess 
    'YourDomainNameaspnet'  /*domain name might be your computer name   */
    exec sp_addsrvrolemember 
    'YourDomaiNameaspnet','dbcreator'
    exec sp_helpuser
    filename
    ='d:guestguestD.mdf')
    log on
    (name='guestLog',
    filename
    ='d:guestguestL.ldf')
    go
    use guestbook
    use guestbook
    exec sp_grantDBaccess 
    'YourDomainNameaspnet'  /*domain name might be your computer name   */
    exec sp_addsrvrolemember 
    'YourDomaiNameaspnet','dbcreator'
    exec sp_helpuser
    go
    create table feedback
    (id int primary key identity(1,1),name varchar(50)not null ,email varchar(200)not null,comments varchar(1000)not null,rating int not null)   --create table 
     
    select 
    from feedback           -- display the empty table
    go
    /* sample feedbacks */
    insert into feedback values
    ('Abhiram','rabhiramvikrant@sify.com','I like this site very much.It was not flashy , but informative',3)
    insert into feedback values
    ('Samu','samusundar@sify.com','I don''t think this site is worth a visit',1)
    insert into feedback values
    ('Kannan','kannan@sify.com','Exactly what are you trying to say?',0)
    insert into feedback values
    ('Anand','anand@sify.com','Na! this site is a crap',1)
    insert into feedback values
    ('Lancer','lancer@somedomain.com','cool site buddy',3)
    go
    select 
    from feedback       -- display the populated table
    go
    select count
    (*) from feedback   -- Number of records in the table
    go
    --Note:Bold letters represents comments
      

    More ASP.NET Code Articles
    More By R. Abhiram Vikrant


     

    ASP.NET CODE ARTICLES

    - How to Use the ListBox Control in ASP.NET 2.0
    - How to Load XML Documents in ASP.NET 2.0
    - DataGrid Code
    - ASP.NET Guestbook
    - User Controls and Client Side Scripting
    - ASP.NET Programming with Microsoft's AS...
    - ASP.NET Basics (part 3): Hard Choices
    - ASP.NET Basics (part 2): Not My Type
    - ASP.NET Basics (part 1): Nothing But .Net
    - Directory Tree Browser
    - How to get the confirmation of Yes/No from a...
    - Complete example using custom errors and wri...
    - Paging Certain # records per page .NET style
    - General Methods of formatting and Subtractin...
    - .NET LinkButton web control





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT