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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.Net 1.1, VB.Net 2003 and SQL Server 2005

ASP.Net 1.1, VB.Net 2003 and SQL Server 2005

Scheduled Pinned Locked Moved ASP.NET
databasecsharpphpasp-net
4 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    Ragonastick
    wrote on last edited by
    #1

    Hi I am new to programming with ASP.Net and I am looking for some information. I currently have a database locally on my machine, and I am trying to connect and read one of the tables through the VB. I have gone to many website, and tried a couple of things but I get up to a point and its still crashing when I go to open it. One thing you will notice is that I do not have a password on my database because there is not one on my machine. This is the code I have in my page load

    Dim oConn As New System.Data.SqlClient.SqlConnection
    Dim oCom As System.Data.SqlClient.SqlCommand
    Dim oDr As System.Data.SqlClient.SqlDataReader
    Dim sSQL As String

        sSQL = "SELECT \* FROM AdminTypes"
        oConn = New System.Data.SqlClient.SqlConnection("server=MCF1500\\SQLEXPRESS;uid=JWilson;pwd=;database=MCF\_Staff;Trusted\_Connection=yes")
        oConn.Open()   'Crashes HERE
    
        oCom = New System.Data.SqlClient.SqlCommand(sSQL, oConn)
    
        oDr = oCom.ExecuteReader()
    
        Do While oDr.Read()
            ' Show database data
        Loop
        oConn.Close()
    

    And I have this code in my WEB.config File

    I was wondering if anyone could help me out with his. If so it would be much appreciated. If not then I am switching over to PHP for this project because I understand it better.

    R R 2 Replies Last reply
    0
    • R Ragonastick

      Hi I am new to programming with ASP.Net and I am looking for some information. I currently have a database locally on my machine, and I am trying to connect and read one of the tables through the VB. I have gone to many website, and tried a couple of things but I get up to a point and its still crashing when I go to open it. One thing you will notice is that I do not have a password on my database because there is not one on my machine. This is the code I have in my page load

      Dim oConn As New System.Data.SqlClient.SqlConnection
      Dim oCom As System.Data.SqlClient.SqlCommand
      Dim oDr As System.Data.SqlClient.SqlDataReader
      Dim sSQL As String

          sSQL = "SELECT \* FROM AdminTypes"
          oConn = New System.Data.SqlClient.SqlConnection("server=MCF1500\\SQLEXPRESS;uid=JWilson;pwd=;database=MCF\_Staff;Trusted\_Connection=yes")
          oConn.Open()   'Crashes HERE
      
          oCom = New System.Data.SqlClient.SqlCommand(sSQL, oConn)
      
          oDr = oCom.ExecuteReader()
      
          Do While oDr.Read()
              ' Show database data
          Loop
          oConn.Close()
      

      And I have this code in my WEB.config File

      I was wondering if anyone could help me out with his. If so it would be much appreciated. If not then I am switching over to PHP for this project because I understand it better.

      R Offline
      R Offline
      Ragonastick
      wrote on last edited by
      #2

      Odd the webconfig code did not show lets post that again

      <configuration>
      <appSettings>
      <add key ="DBConString" value="Uid=JWilson;pwd=;server=MCF1500\SQLEXPRESS;database=MCF_Staff" />
      </appSettings>
      <system.web>

      1 Reply Last reply
      0
      • R Ragonastick

        Hi I am new to programming with ASP.Net and I am looking for some information. I currently have a database locally on my machine, and I am trying to connect and read one of the tables through the VB. I have gone to many website, and tried a couple of things but I get up to a point and its still crashing when I go to open it. One thing you will notice is that I do not have a password on my database because there is not one on my machine. This is the code I have in my page load

        Dim oConn As New System.Data.SqlClient.SqlConnection
        Dim oCom As System.Data.SqlClient.SqlCommand
        Dim oDr As System.Data.SqlClient.SqlDataReader
        Dim sSQL As String

            sSQL = "SELECT \* FROM AdminTypes"
            oConn = New System.Data.SqlClient.SqlConnection("server=MCF1500\\SQLEXPRESS;uid=JWilson;pwd=;database=MCF\_Staff;Trusted\_Connection=yes")
            oConn.Open()   'Crashes HERE
        
            oCom = New System.Data.SqlClient.SqlCommand(sSQL, oConn)
        
            oDr = oCom.ExecuteReader()
        
            Do While oDr.Read()
                ' Show database data
            Loop
            oConn.Close()
        

        And I have this code in my WEB.config File

        I was wondering if anyone could help me out with his. If so it would be much appreciated. If not then I am switching over to PHP for this project because I understand it better.

        R Offline
        R Offline
        Rutvik Dave
        wrote on last edited by
        #3

        Ragonastick wrote:

        One thing you will notice is that I do not have a password on my database because there is not one on my machine.

        If you are talking about SQL Server Management Studio is not asking you a password, then you are login using windows authentication. and you are using sql authentication in your application, so you cannot login. if this is the case then, open sql server management studio using your windows authentication, now go to security -> Login abd create one login with username & password, and then use that username & password in your application to login. you cannot login to sql server without specifying a password in your connection string.

        R 1 Reply Last reply
        0
        • R Rutvik Dave

          Ragonastick wrote:

          One thing you will notice is that I do not have a password on my database because there is not one on my machine.

          If you are talking about SQL Server Management Studio is not asking you a password, then you are login using windows authentication. and you are using sql authentication in your application, so you cannot login. if this is the case then, open sql server management studio using your windows authentication, now go to security -> Login abd create one login with username & password, and then use that username & password in your application to login. you cannot login to sql server without specifying a password in your connection string.

          R Offline
          R Offline
          Ragonastick
          wrote on last edited by
          #4

          Thanks man I think you are correct. I am looking around but I think the guy that was working on this project before I started working on it did not write it down or leave any information on the password he left. Looks like I may have to reinstall, and back up the files.

          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