Hi Selvi,

Try this...

Imports System.Data
Imports System.Data.OleDb
Public Class Form1
    Dim ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings("dsn")
    Dim com As OleDbCommand
    Dim str As String
    Dim obj As Object = Nothing

    Private Sub btn_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_login.Click
        Dim con As New OleDbConnection(ConnectionString)
        con.Open()
        str = "select count(*) from login where UserName=@UserName and Password =@Password"
        com = New OleDbCommand(str, con)
        com.CommandType = CommandType.Text
        com.Parameters.AddWithValue("@UserName", TextBox_user_name.Text)
        com.Parameters.AddWithValue("@Password", TextBox_password.Text)
        obj = com.ExecuteScalar()
        If CInt(obj) <> 0 Then
            lb1.Text = "WELLCOME :: " + TextBox_user_name.Text
        Else
            lb1.Text = "invalid user name and password"
        End If
        con.Close()
    End Sub
End Class




Thanks