Yes. It will write the code(TextBox1.Text) in TextBox2 control and will excute from the TextBox2 control. as it show in the picNo, you're not clear. Are you asking whether the user can type source code into a TextBox and then you execute it?
That doesn't really make sense. TextBox1.Text on its own isn't really useful code. Why would you want to do such a thing? Maybe you should provide a FULL and CLEAR explanation of what you're actually trying to achieve. You must have some larger purpose in mind so please explain it because what you've asked to do really is pointless. For a start, why would the user even know that there is a TextBox named TextBox1 on that form? Secondly, what if they they type "Hello" in the second TextBox too? What's supposed to happen then? Etc, etc.
Dim command As New SqlCommand("SELECT C1, C2 FROM T WHERE C3 = @C3") command.Parameters.AddWithValue("@C3", TextBox1.Text)For more information, follow the Blog link in my signature and check out my post on Parameters In ADO.NET.
Public Sub Display_DB(ByVal SQL As String) Dim dp As New OleDbDataAdapter(SQL, conn) Dim Tabl As New DataTable dp.Fill(Tabl) DataGridView1.DataSource = Tabl End Sub 'in Button I'll insert this code Display_DB(Me.TextBox4.Text)' I'll write the SQL query in the textbox4
Dim command as New SqlCommand("SELECT Name, Tel, Address FROM Table1 WHERE Tel = @tel")
command.Parameters.AddWithValue("@tel", TextBox1.Text)
"SELECT Name, Tel, Address FROM Table1 WHERE Tel = '" & TextBox1.Text & "'"
Oky how to complete the code to load data from db to DGV?Dim command as New SqlCommand("SELECT Name, Tel, Address FROM Table1 WHERE Tel = @tel")
command.Parameters.AddWithValue("@tel", TextBox1.Text)
Dim command As New OleDbCommand("SELECT Name, Tel, Address FROM Table1 WHERE Tel = @tel")
command.Parameters.AddWithValue("@tel", Form1.TextBox4.Text)
Dim Tabl As New DataTable
' I don't know how to set the Tbl to carry the data from database
Form1.DataGridView1.DataSource = Tabl