Help for a newbie.

Last post 06-08-2009 7:24 AM by suthish nair. 6 replies.

Sort Posts:

  • Help for a newbie.

    06-08-2009, 2:45 AM
    • Member
      point Member
    • spda1210
    • Member since 06-08-2009, 6:09 AM
    • Posts 1

    All,

    This are the first few lines of my first program to run on my home desktop running IIS 7 and SQL Server 2005.

    The name of the database is datest and the table name is Tho_tho.

    I get a compile error: "Compiler Error Message: BC30451: Name 'Tho_tho' is not declared" at the highlighted and underlined line.

    Can someone help me with this rather silly mistake I seem to be making?

    Thanks in advance.

    SP

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

    <script runat="server">
    sub Page_Load
    dim dbconn,sql,dbcomm,dbread

    dbconn=New OleDbConnection("Server=PE-PC\MSSMLBIZ;Database=datest;Integrated Security=true")
    dbconn.Open()
    sql="SELECT * FROM Tho_tho"
    dbcomm=New OleDbCommand(sql,dbconn)
    dbread=dbcomm.ExecuteReader()
    Tho_tho.DataSource=dbread
    Tho_tho.DataBind()
    dbread.Close()
    dbconn.Close()
    end sub
    </script>
    ------------------------

  • Re: Help for a newbie.

    06-08-2009, 3:20 AM
    • All-Star
      59,423 point All-Star
    • mudassarkhan
    • Member since 02-28-2008, 5:28 AM
    • Mumbai, India
    • Posts 10,516

    spda1210:
    'Tho_tho'

     

    What is 'Tho_tho'??? You have to add it in aspx

  • Re: Help for a newbie.

    06-08-2009, 3:54 AM
    • Star
      10,561 point Star
    • getchinna_sv
    • Member since 09-10-2008, 8:29 PM
    • Hyderabad
    • Posts 1,796

    can you please explain a bit clear

    Chinna_sv...
  • Re: Help for a newbie.

    06-08-2009, 4:10 AM
    Answer
    • Participant
      1,322 point Participant
    • ezhillmaran
    • Member since 02-15-2008, 11:09 AM
    • Chennai
    • Posts 277

     I hope your binding data with asp.net control called "Tho_tho". you need to declare the control in aspx page.

    thnks n regards,
    Maran.


  • Re: Help for a newbie.

    06-08-2009, 4:20 AM
    • Member
      113 point Member
    • LiteIce
    • Member since 05-01-2007, 10:05 AM
    • Posts 102

    In this line:

    Tho_tho.DataSource=dbread

    you are trying to bind data to a control that doesn't exist (Tho_tho). I think you might be getting a bit confused here with your table in the database? In your Toolbox, look for a control called GridView and drag it onto your page. Change it's ID to Tho_tho and try building/running the project again.

    See if this works for you?

  • Re: Help for a newbie.

    06-08-2009, 4:23 AM

     Tho_tho.DataSource=dbread
    Tho_tho.DataBind()

    what is Tho_tho?is it a gridview,datagrid ? ..whch control u want to use. u have to  declare Tho_tho  as a asp.net control then u can use this control  

  • Re: Help for a newbie.

    06-08-2009, 7:24 AM
    Answer

    spda1210:
    Tho_tho.DataSource=dbread Tho_tho.DataBind()

    I think your trying to bind to a dataset which not declared..


    Mark as Answer
    on the posts replys that helped you.
    My Blog -: MSChart

Page 1 of 1 (7 items)