Hey there,
(using a windows applicaiton) What I have is a database with engineers on it in a table tited 'Engineer', what I want to do is be able to add a new engineer to the database. Via text boxes and a submit button instead of a data grid.
I have the data connections n such and have fiddled around a bit and tried this code.
VB Code:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click Dim Name As String Dim qual As String Dim mob As String Dim phone As String Dim NOK As String Dim specId As String Dim newEngineer As DataRow Name = txtName.Text qual = txtQual.Text mob = txtMobile.Text phone = txtPhone.Text NOK = txtNOK.Text specId = txtSpecID.Text newEngineer = Update1.Engineer.NewRow newEngineer("Eng-name") = Name newEngineer("Eng-Qual") = qual newEngineer("Eng-Mobile") = mob newEngineer("Eng-Phone") = phone newEngineer("ENG-NOK") = NOK newEngineer("Spec-ID") = CInt(specId) Update1.Engineer.Rows.Add(newEngineer) OleDbDataAdapter1.Update(Update1)
but to no prevail, anyone know what im doing wrong? If you need more information please ask




Reply With Quote