Dim myConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Userpass.mdb;Jet OLEDB:Database Password=1234567890"
Dim ds As New DataSet()
Dim con As New OleDb.OleDbConnection(myConnString)
Dim daCust As New OleDb.OleDbDataAdapter("Select * From Userpass1", con)
Dim m_dtContacts As New DataTable
Dim m_datarow As DataRow
Dim m_cbCommandBuilder As OleDb.OleDbCommandBuilder
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'UserpassDataSet.Userpass1' table. You can move, or remove it, as needed.
'Me.Userpass1TableAdapter.Fill(Me.UserpassDataSet.Userpass1)
ComboBox1.SelectedIndex = 0
ds.Clear()
m_cbCommandBuilder = New OleDb.OleDbCommandBuilder(daCust)
'Uncomment either of the following two lines to obtain additional schema information.
daCust.MissingSchemaAction = MissingSchemaAction.AddWithKey
'daCust.FillSchema(ds, SchemaType.Source, "Cust")
daCust.Fill(UserpassDataSet.Userpass1)
'Userpass1DataGidView.DataSource = ds
' Userpass1DataGidView.DataMember = "123"
'm_dtContacts.Columns("NewID").AutoIncrement = True
'm_dtContacts.Columns("NewID").AutoIncrementSeed = 1
' m_dtContacts.PrimaryKey =
'con.Close()
'con = Nothing
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If UserFound = False And PassFound = False Then
m_datarow.BeginEdit()
UserpassDataSet.Tables(0).Rows(0)!GroupID = "WA"
m_datarow = m_dtContacts.NewRow
m_datarow("UsersID") = RegName
m_datarow("Keyword") = getMd5Hash((RegPass))
m_datarow("GroupID") = ComboBox1.SelectedItem.ToString
m_dtContacts.Rows.Add(m_datarow)
ds.AcceptChanges()
Try
Me.Validate()
m_datarow.EndEdit()
Dim ds2 As DataSet = UserpassDataSet.GetChanges()
'daCust.Update(UserpassDataSet.Userpass1)
daCust.Update(ds2, "Userpass1")
MsgBox("Update successful")
'daCust.Fill(ds2)
Catch ex As Exception
MsgBox("Update failed" & ex.Message)
End Try
End If
End Sub
I try to fix these for 2days,searching solution all over the net, but with no luck:(. My Dataset just cannot be save into Database file, even every time message popup say it is sucessfull updated. Seem like i just updated my dataset and not Database. Is weird that even i stop debugging then rerun, the dataset seem updated, but i open my datafile everything is the same. My database is password protected, and the Datasource wizard dont allow me add the password in the connection string, so i need to do it manually.
Any help is highly appreciated(i have no clue aready),Maybe i try open new project n try@@Thanks in advance^^