اريد من Procedure يقرا التكست بوكس volationcode و التكست بوكس actionnumber
وبناء على البقيمتين يظهلي
volationactionname, volationfees كلا في التكست بوكس الخاص فيه
لم تفهم سؤالي
ماذا تريد من Procedure أن يعيد لك، فهو يعيد مجموعة أعمدة وليست واحدة
اريده أن يعيد العمودين
volationactionname, volationfees
بناء على أو Where
volationcode و actionnumber
قمت بتعديل الدالة Load_Volations_Details أرجو أن يتضح الأمر فيها
كود :
Friend Function Load_Volations_Details(ByVal VolationCode As Integer, ByVal ActionNumber As Integer) As DataTable
Dim daa As New SqlDataAdapter("Load_Volations_Details", cnn)
daa.SelectCommand.CommandType = CommandType.StoredProcedure
daa.SelectCommand.Parameters.AddWithValue("@VolationCode", VolationCode)
daa.SelectCommand.Parameters.AddWithValue("@ActionNumber", ActionNumber)
Dim tbl As New DataTable
If daa.Fill(tbl) > 0 Then
Dim r As DataRow = tbl.Rows(0)
MsgBox(r.Item("volationfees"))
MsgBox(r.Item("volationactionname"))
End If
Return tbl
End Function
أشكرك جزيل الشكر لكن هل أغير شي على هذه الأكواد
في زر البحث
كود :
ActionOneName.Text = p.Load_Volations_Details(txtFineCode.Text, ActionOne.Text).ToString
ActionOneFees.Text = p.Load_Volations_Details(txtFineCode.Text, ActionOne.Text).ToString
وفي كلاس Business
كود :
Public Function Load_Volations_Details(ByVal VolationCode As Integer, ByVal ActionNumber As Integer) As SqlDataReader
p.Load_Volations_Details(dr, VolationCode, ActionNumber)
Return dr
End Function
لان يظهرلي خطأ
في زر البحث
Object reference not set to an instance of an object