I am trying to make a login form, and i need it to check for the inputed name in the database. I can't figure how to get text from the cell. i would also prefer not to use a GDV on the form. I am mainly seeking a way to do it with SQL statements and vb.net code.

here is what i have atm...

Imports System.Data


Public Class login


    Sub UpdateGrid(ByVal sqlStr As String)
        Dim dt As New DataTable()
        Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                                "Data Source=logindb.MDB"
        Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
        dataAdapter.Fill(dt)
        dataAdapter.Dispose()
        dgvDisplay.DataSource = dt


    End Sub

    Private Sub login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim check As String
        UpdateGrid("Select username From logintbl")
        check = dgvDisplay.Rows(1).Cells(1).

    End Sub
End Class

it isn't much, but i just can't start this until i figure out how to check names.


thanks in advance.

I figured out how to get it to read the values from a cell.
for those who need help on my old problem here is the solution.

datatableview.Rows.Item(num).Cells.Item(num).Value

num = number (0 or w/e)

0 in both nums = topleft cell


________________

new problem for me is trying to count number og columns used.
like when using txt files you use
do while sr.readlin <> -1
count +=1
loop

only for a database column.

thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.