title: Dynamic call to a database from web application
body: <p>I am looking to make a database call based on user input.  The line I am using is:</p>
  
  <p><code>general_read.CommandText = "SELECT * FROM general WHERE Business_Name = '" &amp; business_name &amp; "';"</code></p>
  
  <p>business_name is dynamically loaded from:</p>
  
  <pre><code>Protected Sub btnLoad_Click(sender As Object, e As System.EventArgs) Handles btnLoad.Click
      business_name = txtName.Text
  
      dbConnect()
      dbGet()
      dbDisconnect()
  End Sub
  </code></pre>
  
  <p>The error that is being shown is:</p>
  
  <p><code>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</code></p>
  
  <p>I'm assuming it has something to do with the variable not being set before the database call is made, but I'm not entirely sure.</p>