Not had chance to have a proper look - haven't got VS installed on this machine yet.
However I think the problem lies with how you are creating / instantiating your variables.
For example in your form you have the following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
Dim newappl As New application.Class1
newappl = New application.Class1
newappl.AppUser(TextBox1.Text)
'newappl.AppPassword(TextBox2.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim newappl As New application.Class1
newappl = New application.Class1
newappl.Start()
End Sub
You are declaring an instance of application.Class1 and calling .Start on it in the form_load but declaring a seperate instance in the button click event. You may find the following is closer to what you need
Dim newappl As application.Class1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
newappl.AppUser(TextBox1.Text)
'newappl.AppPassword(TextBox2.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
newappl = New application.Class1
newappl.Start()
End Sub
You are also doing a similar thing in application.Class1 try the following instead to see if it helps
Public Class Class1
Dim newdata1 As datalayer.Class1
Public Function AppUser(ByVal test1 As String)
Dim a As Integer
a = newdata.Search(test1)
If a <> -1 Then
MsgBox("Yes")
End If
'newdata.AddStadd(test1, test2)
'Return newdata.Final(test1, test2)
End Function
'Public Function AppPassword(ByVal test2 As String)
' 'newdata.AddStadd(test1, test2)
' 'Return newdata.Final(test1, test2)
'End Function
Public Sub Start()
newdata1 = New datalayer.Class1
newdata1.filldatasetandview()
End Sub
End Class
Also code like
Dim newdata As New datalayer.Class1
newdata = New datalayer.Class1
is redundant as the first line declares a new instance of the class and then the second line declares another new instance.
Hopefully I should have VS installed by tomorrow and can have a better look (notepad isn't the best editor around ;)) - so if there are any other problems jusr reply here.