No, he said you need to add a space, not remove it. In his example:
Private Sub btnExecute_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnExecute.Click
Dim cmd As SqlCommand = SqlConnection1.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = txtQuery.text
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As DataSet = New DataSet
da.Fill(ds, "Results")
dgResults.DataSource = ds
dgResults.DataMember = "Results"
End Sub
Or in mine, I forgot to add that if you take out the underscore, you need to have it all on the first line like this:
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click
Dim cmd As SqlCommand = SqlConnection1.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = txtQuery.text
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As DataSet = New DataSet
da.Fill(ds, "Results")
dgResults.DataSource = ds
dgResults.DataMember = "Results"
End Sub
All of this:
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click
is on a single line, not broken over two lines.
|