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 >>

photo Link : http://imgur.com/OqzaKqq

but when i execute the Same query From my Program it give me this message >>>

Photo Link 2 : http://imgur.com/sTMwtaL

give me only message not like the visual studio sql and the Sql Server

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

my codes:

 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

This code snippet shows how to get data from a database using SQLDB and OLEDB tpe connections. Both examples display the results in a ListView. They also use parameterized queries (strongly recommended).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.