SabaRehan
September 28th, 2006, 02:49 AM
i am working on two databases one is for human resource management and the other is of projects details. my problem is occuring while saving record or deleting record. i've created a form of departments where i am inserting Department_ID, Department_Name and Location when i entered values and press add then there is an erroe of type casting.
i am casting the text values into integer but the problem is still unsolved the code behind add button is :
Dim drAdd As DataRow
Dim value As Integer
value = CInt(TextBox1.Text)
drAdd = DsDep1.Tables("Departments_Detail").NewRow()
drAdd(0) = value
drAdd(1) = TextBox2.Text
drAdd(2) = TextBox3.Text
DsDep1.Tables("Departments_Detail").Rows.Add(drAdd)
DaDep.Update(DsDep1, "Departments_Detail")
MsgBox("New Record added to the Database")
data types are:
Department_ID = Integer
Department_Name = Varchar
Location = Text
i am casting the text values into integer but the problem is still unsolved the code behind add button is :
Dim drAdd As DataRow
Dim value As Integer
value = CInt(TextBox1.Text)
drAdd = DsDep1.Tables("Departments_Detail").NewRow()
drAdd(0) = value
drAdd(1) = TextBox2.Text
drAdd(2) = TextBox3.Text
DsDep1.Tables("Departments_Detail").Rows.Add(drAdd)
DaDep.Update(DsDep1, "Departments_Detail")
MsgBox("New Record added to the Database")
data types are:
Department_ID = Integer
Department_Name = Varchar
Location = Text