Hi,
i'm working on a system rate analysis.I just worte the code using oop.
i worte a code that inserts a record into the database.when i try to insert a data nothing happens.Please fix my code.
//this code is defined in a class
Public Function AddWorkItem(ByVal workitemNumber As String, ByVal description As String) As Boolean
Dim val As Boolean
Dim conn As New OleDbConnection
Dim cmd As New OleDbCommand
conn = GetDbConnection()
Dim s As String = "INSERT INTO work_item ([work item number],[description])VALUES (" &
"'" & workitemNumber & "','" & description & "')"
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = s
val = ExecuteCommand(cmd)
Return val
End Function
//this is one used at the clent side
Dim oWorkItem As WorkItem = New WorkItem()
Dim result As Boolean
Dim workitemNumber As String
Dim description As String
workitemNumber = TextBox1.Text.ToString
description = TextBox2.Text.ToString
result = oWorkItem.AddWorkItem(workitemNumber, description)
If result = True Then
MessageBox.Show("Data Added Successfully")
TextBox1.Text = ""
TextBox2.Text = ""
Exit Sub
End If