Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Database connection

Database connection

Scheduled Pinned Locked Moved ASP.NET
database
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mkanchha
    wrote on last edited by
    #1

    Hi to all, I want to connect database(sqlserver2000) in .aspx file Not in Code behind File. Mohan balal

    N M 2 Replies Last reply
    0
    • M Mkanchha

      Hi to all, I want to connect database(sqlserver2000) in .aspx file Not in Code behind File. Mohan balal

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Mkanchha wrote:

      I want to connect database(sqlserver2000) in .aspx file Not in Code behind File.

      I assume you are using ASP.NET 2.0. When creating new ASPX page, visual studio will ask where you want to place the code. Single file or separate file. Choose single file , In this you can write all your code in ASPX file. Use the connection as usual here.:cool:


      printf("Navaneeth!!") www.w3hearts.com

      M 1 Reply Last reply
      0
      • N N a v a n e e t h

        Mkanchha wrote:

        I want to connect database(sqlserver2000) in .aspx file Not in Code behind File.

        I assume you are using ASP.NET 2.0. When creating new ASPX page, visual studio will ask where you want to place the code. Single file or separate file. Choose single file , In this you can write all your code in ASPX file. Use the connection as usual here.:cool:


        printf("Navaneeth!!") www.w3hearts.com

        M Offline
        M Offline
        Mkanchha
        wrote on last edited by
        #3

        I am using asp.net 1.1, I want database connection code in .ASPx file. If you have some code or example Please Post it Mohan Balal

        _ E 2 Replies Last reply
        0
        • M Mkanchha

          I am using asp.net 1.1, I want database connection code in .ASPx file. If you have some code or example Please Post it Mohan Balal

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          There also you can put your code inside the script tag and making it runat=server

          Best Regards, Apurva Kaushal

          1 Reply Last reply
          0
          • M Mkanchha

            Hi to all, I want to connect database(sqlserver2000) in .aspx file Not in Code behind File. Mohan balal

            M Offline
            M Offline
            Mazdak
            wrote on last edited by
            #5

            You can put it in your Web.config file in connectionStrings section , if .net 1.1 does not contain it, you can put it in appSetting part. You can see in MSDN how to read these settings from web.config.

            Mazy
            "This chancy chancy chancy world."

            1 Reply Last reply
            0
            • M Mkanchha

              I am using asp.net 1.1, I want database connection code in .ASPx file. If you have some code or example Please Post it Mohan Balal

              E Offline
              E Offline
              enjoycrack
              wrote on last edited by
              #6

              Yup you can do so...just like asp... << >>

              8x Solutions Ltd

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups