Help with Data in VS2008 Web Developer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ty

    Help with Data in VS2008 Web Developer

    I'm using Web Developer in VS 2008.

    I have a MS Access DB that I want access the data to place into labels
    and fill dropdown list boxes.

    The problem is that I am use to VB 6 and ADO where I could just code
    it without much fuss.

    Now the issues I have are....

    1. Where do I place the code? In the aspx page as VBscript or in the
    apsx.vb page as code?

    I looked on the web and I find that the recordset object has been
    replaced with the dataset. There is also a dataadapter needed to fill
    the dataset. None of it makes much sense to me. I added a dataset to
    my site by add new item...dataset and used the wizard to connect to
    the database and the query builder to fill data from the table but how
    do i use this in the aspx pages? and Do I have to add a new one for
    each table I need to access for different pages?



    Most of the examples I have seen use a SQL database and I cannot see
    how to change it to my use.

    Any help or a simple example of creating a connection, command and
    getting the data into variables would be greatly appreciated.



    I have been able to use a gridview with accessdatasourc e without issue
    but the data I need to input now is into controls that do not have a
    data bound property such as a label and textbox.



    Thanks,

    Ty

  • aaron.kempf@gmail.com

    #2
    Re: Help with Data in VS2008 Web Developer

    MDB is obsolete.

    Seriously WTF Is wrong with your decision-making abilities?

    If you want to change a SQL Server database; you should probably find
    'SQL Server Management Studio Express'.

    THanks

    -Aaron

    On Mar 24, 8:23 am, Ty <tbar...@lewist ownhospital.org wrote:
     I'm using Web Developer in VS 2008.
    >
    I have a MS Access DB that I want access the data to place into labels
    and fill dropdown list boxes.
    >
    The problem is that I am use to VB 6 and ADO where I could just code
    it without much fuss.
    >
    Now the issues I have are....
    >
    1. Where do I place the code? In the aspx page as VBscript or in the
    apsx.vb page as code?
    >
    I looked on the web and I find that the recordset object has been
    replaced with the dataset. There is also a dataadapter needed to fill
    the dataset. None of it makes much sense to me. I added a dataset to
    my site by add new item...dataset and used the wizard to connect to
    the database and the query builder to fill data from the table but how
    do i use this in the aspx pages? and Do I have to add a new one for
    each table I need to access for different pages?
    >
    Most of the examples I have seen use a SQL database and I cannot see
    how to change it to my use.
    >
    Any help or a simple example of creating a connection, command and
    getting the data into variables would be greatly appreciated.
    >
    I have been able to use a gridview with accessdatasourc e without issue
    but the data I need to input now is into controls that do not have a
    data bound property such as a label and textbox.
    >
    Thanks,
    >
    Ty

    Comment

    • rowe_newsgroups

      #3
      Re: Help with Data in VS2008 Web Developer

      On Mar 24, 11:23 am, Ty <tbar...@lewist ownhospital.org wrote:
      I'm using Web Developer in VS 2008.
      >
      I have a MS Access DB that I want access the data to place into labels
      and fill dropdown list boxes.
      >
      The problem is that I am use to VB 6 and ADO where I could just code
      it without much fuss.
      >
      Now the issues I have are....
      >
      1. Where do I place the code? In the aspx page as VBscript or in the
      apsx.vb page as code?
      >
      I looked on the web and I find that the recordset object has been
      replaced with the dataset. There is also a dataadapter needed to fill
      the dataset. None of it makes much sense to me. I added a dataset to
      my site by add new item...dataset and used the wizard to connect to
      the database and the query builder to fill data from the table but how
      do i use this in the aspx pages? and Do I have to add a new one for
      each table I need to access for different pages?
      >
      Most of the examples I have seen use a SQL database and I cannot see
      how to change it to my use.
      >
      Any help or a simple example of creating a connection, command and
      getting the data into variables would be greatly appreciated.
      >
      I have been able to use a gridview with accessdatasourc e without issue
      but the data I need to input now is into controls that do not have a
      data bound property such as a label and textbox.
      >
      Thanks,
      >
      Ty
      First, go here and get your connection string for Access:

      All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.


      Then, you can try this code (typed in message so watch out for errors)
      and loop through the data returned from a query.

      /////////////
      '// Add to the top of the code file:
      '// Imports System.Data.Ole Db

      Using conn As New OleDbConnection ("your connection string from
      www.connections trings.com")
      Using com As OleDbCommand = conn.CreateComm and()
      conn.Open() '// If you fail here your conn string is probably
      wrong

      com.CommandType = CommandType.Tex t
      com.CommandText = "SELECT Name FROM tbl_Names"

      Using dr As OleDbDataReader = com.ExecuteRead er()
      While dr.Read()
      Dim name As String = dr("Name").ToSt ring()

      Me.listBox1.Ite ms.Add(name)
      End While
      End Using
      End Using
      End Using
      ///////////////

      Let me know how well it goes, I typed that really quick.

      Thanks,

      Seth Rowe [MVP]

      Comment

      • Ty

        #4
        Re: Help with Data in VS2008 Web Developer

        On Mar 24, 12:03 pm, "aaron.ke...@gm ail.com" <aaron.ke...@gm ail.com>
        wrote:
        MDB is obsolete.
        >
        Seriously WTF Is wrong with your decision-making abilities?
        >
        If you want to change a SQL Server database; you should probably find
        'SQL Server Management Studio Express'.
        >
        THanks
        >
        -Aaron
        >
        There really is no reason to be rude!

        I'm using Access for testing and learning because thats what the DB
        was written in. I will later have to convert it to SQL Server but at
        this time it is not my decision to make.

        You comments are neither helpful or necessary. Unless you have
        something helpful to the questions I asked please refrain from posting
        your dribble.

        Ty

        Comment

        • Ty

          #5
          Re: Help with Data in VS2008 Web Developer

          First, go here and get your connection string for Access:
          >
          All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.

          >
          Then, you can try this code (typed in message so watch out for errors)
          and loop through the data returned from a query.
          >
          /////////////
          '// Add to the top of the code file:
          '// Imports System.Data.Ole Db
          >
          Using conn As New OleDbConnection ("your connection string fromwww.connect ionstrings.com" )
              Using com As OleDbCommand = conn.CreateComm and()
                  conn.Open() '// If you fail here your conn string is probably
          wrong
          >
                  com.CommandType = CommandType.Tex t
                  com.CommandText = "SELECT Name FROM tbl_Names"
          >
                  Using dr As OleDbDataReader = com.ExecuteRead er()
                      While dr.Read()
                          Dim name As String = dr("Name").ToSt ring()
          >
                          Me.listBox1.Ite ms.Add(name)
                      End While
                  End Using
              End Using
          End Using
          ///////////////
          >
          Let me know how well it goes, I typed that really quick.
          >
          Thanks,
          >
          Seth Rowe [MVP]- Hide quoted text -
          >
          - Show quoted text -
          Thanks Seth thats exactly what I needed to get started and build upon.

          Ty

          Comment

          • aaron.kempf@gmail.com

            #6
            Re: Help with Data in VS2008 Web Developer

            Access isn't easier for testing with!!!

            Do you rewrite your underwear twice a day?

            I don't mean to be rude-- I just think that there is a better way than
            always rewriting Access databases.. because they're not reliable--
            they don't scale. and they're just 'not good enough' for real world
            usage.

            -Aaron



            On Mar 25, 3:13 am, Ty <tbar...@lewist ownhospital.org wrote:
            On Mar 24, 12:03 pm, "aaron.ke...@gm ail.com" <aaron.ke...@gm ail.com>
            wrote:
            >
            MDB is obsolete.
            >
            Seriously WTF Is wrong with your decision-making abilities?
            >
            If you want to change a SQL Server database; you should probably find
            'SQL Server Management Studio Express'.
            >
            THanks
            >
            -Aaron
            >
            There really is no reason to be rude!
            >
            I'm using Access for testing and learning because thats what the DB
            was written in. I will later have to convert it to SQL Server but at
            this time it is not my decision to make.
            >
            You comments are neither helpful or necessary. Unless you have
            something helpful to the questions I asked please refrain from posting
            your dribble.
            >
            Ty

            Comment

            Working...