title: How to Display Query Results From Sql to my Program VB
body: <p>i have a problem.. now when i execute a Query From Visual Studio 2012 at Sql Button it gives to me The results as 1 Rows affected like this pic >>    </p>
  
  <p>photo Link : <a href="http://imgur.com/OqzaKqq" rel="nofollow">http://imgur.com/OqzaKqq</a></p>
  
  <p>but when i execute the Same query From my Program it give me this message >>>  </p>
  
  <p>Photo Link 2 : <a href="http://imgur.com/sTMwtaL" rel="nofollow">http://imgur.com/sTMwtaL</a></p>
  
  <p>give me only message not like the visual studio sql and the Sql Server </p>
  
  <p>now i need to make like visual studio i need when the user execute the query show the Results in textbox like sql not only message i need to show all results in textbox</p>
  
  <p>my codes:</p>
  
  <pre><code>  mysqlconn = New SqlConnection
      mysqlconn.ConnectionString = "Data Source=" + Form2.txtServerName.Text + ";initial catalog=" + Form2.txtdatabasename.Text + ";user id=" + Form2.textusername.Text + ";password=" + Form2.txtpassword.Text
  
  
  
      If TextBox2.Text = "" Then
          MsgBox("please put a name")
      Else
          Try
              mysqlconn.Open()
  
  
              command = New SqlCommand(Query.Text, mysqlconn)
              command.ExecuteNonQuery()
  
              mysqlconn.Close()
  
  
              MsgBox("completed successfully. ", MsgBoxStyle.Information, "Your Query")
          Catch ex As Exception
              MessageBox.Show(ex.Message)
          End Try
      End If
  </code></pre>