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. General Programming
  3. Visual Basic
  4. is it wrong?

is it wrong?

Scheduled Pinned Locked Moved Visual Basic
databasehelpquestion
8 Posts 4 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.
  • P Offline
    P Offline
    pandapatin
    wrote on last edited by
    #1

    when i was trying to connect to the database there is an error occured. the erro r is: The ConnectionString property has not been initialized. i check it with the local window below it,the connection to database is null. what can i do?

    I A S 3 Replies Last reply
    0
    • P pandapatin

      when i was trying to connect to the database there is an error occured. the erro r is: The ConnectionString property has not been initialized. i check it with the local window below it,the connection to database is null. what can i do?

      I Offline
      I Offline
      Ingo
      wrote on last edited by
      #2

      Generate a new Connection and set the ConnectionString property to a usable value. If you search in the Microsoft Help for the Database Connection Class you will find an example. So it's definitively wrong I guess. Greetings, Ingo ------------------------------ A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!

      1 Reply Last reply
      0
      • P pandapatin

        when i was trying to connect to the database there is an error occured. the erro r is: The ConnectionString property has not been initialized. i check it with the local window below it,the connection to database is null. what can i do?

        A Offline
        A Offline
        albCode
        wrote on last edited by
        #3

        You should initialize connectionstring

        P 1 Reply Last reply
        0
        • A albCode

          You should initialize connectionstring

          P Offline
          P Offline
          pandapatin
          wrote on last edited by
          #4

          how could i do that?

          A 1 Reply Last reply
          0
          • P pandapatin

            how could i do that?

            A Offline
            A Offline
            albCode
            wrote on last edited by
            #5

            if u are using WebApplication example is below Dim SqlConnection conn As New SqlConnection; conn = System.Configuration.ConfigurationManager.ConnectionStrings["DBConn"].ConnectionString; If (Not Page.IsPostBack) Then 'Do Some Codeing Here EndIf

            P 1 Reply Last reply
            0
            • A albCode

              if u are using WebApplication example is below Dim SqlConnection conn As New SqlConnection; conn = System.Configuration.ConfigurationManager.ConnectionStrings["DBConn"].ConnectionString; If (Not Page.IsPostBack) Then 'Do Some Codeing Here EndIf

              P Offline
              P Offline
              pandapatin
              wrote on last edited by
              #6

              the error is : Value of type 'System.Configuration.ConnectionStringSettingsCollection' cannot be converted to 'System.Data.SqlClient.SqlConnection'. so?

              A 1 Reply Last reply
              0
              • P pandapatin

                the error is : Value of type 'System.Configuration.ConnectionStringSettingsCollection' cannot be converted to 'System.Data.SqlClient.SqlConnection'. so?

                A Offline
                A Offline
                albCode
                wrote on last edited by
                #7

                Dude i am not vb programmer but maybe i can help by this Imports System.Configuration .. Dim ConnectionStringSettingsCollection c As New ConnectionStringSettingsCollection Dim cc,command As String cc=c[""urconn"].ConnectionString; command="select * from Customers" Dim SqlConnection scon As SqlConnection() scon(cc) Dim SqlCommand cmd As SqlCommand() cmd(scommand,scon) ...

                1 Reply Last reply
                0
                • P pandapatin

                  when i was trying to connect to the database there is an error occured. the erro r is: The ConnectionString property has not been initialized. i check it with the local window below it,the connection to database is null. what can i do?

                  S Offline
                  S Offline
                  Steve Pullan
                  wrote on last edited by
                  #8

                  You have posted similar questions before. It seems to me that you really are struggling with this topic despite the help provided by others. May I respectfully suggest that you go back to basics and read up on how to interact with these objects within VB? ...Steve "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once :-) -- modified at 18:58 Thursday 2nd March, 2006

                  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