I want to generate a report showing payslips for a single employee using values from a SP with parameter values that have been passed from a datagrid row. However the report that is generated is blank. What am I missing. Below is what I have.
First I populate the datagrid view using values returned by a function called "sqlselect"
Dim dbcall As New dbcalls
dtgPayslip_Old.DataSource = dbcall.sqlselect("empno AS Employee_Number,empname AS Employee_Name, date AS Date", "payrollarchiveview")
Secondly i select empno from datagrid view as the parameter value which I pass to the SP
Private Sub dtgPayslip_Old_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtgPayslip_Old.CellDoubleClick
Dim dbcall As New dbcalls
Dim empno As String = dtgPayslip_Old.Item(0, dtgPayslip_Old.CurrentRow.Index).Value.ToString()
dbcall.CallparametizedSP("payrollarchivedataview", "@e", empno)
<
The sub that makes a db call
Public Sub CallparametizedSP(ByVal procedureName As String, ByVal parameter As String, ByVal value As String)
conn.Open()
cmd.Parameters.AddWithValue(parameter, value)
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = procedureName
cmd.CommandTimeout = 6000
cmd.ExecuteScalar()
cmd.Dispose()
conn.Close()
After al
l this I would expect details of the employee into the report But all I get are the column headings. How can I resolve this. Thank you community