Why cant I add this sql query

  • Thread starter Thread starter elisch123
  • Start date Start date
E

elisch123

Guest
I have posted this inquiry elsewhere as a reply to the problem I suspect, but still no response. I believe there is a simple answer. Using VB, I have a simple 3-column table selection that works to obtain many rows with no qualifying clause. When I try to add a where clause to the query, I get a rejection saying that a variable is not identified. In the code I am pasting below, the variable is "PAR". I believe that something is wrong in the hierarchy of my declarations that causes this problem but cannot figure it out.
Public Class WebForm1
Inherits System.Web.UI.Page
Dim i, ID, jj, j As Integer, a As String, em, pw, dataarea, par, flds(30) As String
Dim loginAdapter As New DataSet1TableAdapters.EMAILTableAdapter
Dim theDataSet1 As New Table
Protected Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Dim par As String
a = TextBox1.Text
i = InStr(a, "@")
If (i < 2) Then GoTo failed1
j = InStr(a, ".")
If (j < i + 2) Then GoTo failed1
If (InStr(a, " ") > 0) Then GoTo failed1
em = a
par = a
loginAdapter.GetData()
jj = loginAdapter.GetData().Rows.Count
If (jj < 1) Then GoTo INSERT_NEW
For Each row In loginAdapter.GetData().Rows
flds(1) = row.Item(0)
flds(2) = row.Item(1)
flds(3) = row.Item(2)
j = MsgBox(flds(1) + ", " + flds(2) + ", " + flds(3))
Next
GoTo failed1
INSERT_NEW:


failed1:

Continue reading...
 
Back
Top