I want to create a login form, the username and password are stored in Database access, I tried it but it failed
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.Clear() <--This line is always pointed PasswordTextBox.Clear() Dim ctr, i As Integer ds.Clear() If cn.State = ConnectionState.Open Then cn.Close() End If Module1.conn() cn.Open() str = "select * from Users" cmd = New OleDbCommand(str, cn) da.SelectCommand = cmd da.Fill(ds, "Users") ctr = ds.Tables("Users").Rows.Count - 1 For i = 0 To ctr ComboBox1.Items.Add(ds.Tables("Users").Rows(i)(1).ToString) Next End Sub
Items
null
ComboBox1.DataSource = Nothing; ComboBox1.Items.Clear();
nil
Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)