yes
i did
this code at page 1 submit button
Protected Sub btnGetData_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGetData.Click
Dim strEMPPRJCDE As String
Dim strEMPBRN As String
Dim strVSTDTE As String
Dim strBRNCDE As String
Dim strPRJCDE7 As String
Dim strEMPAGE As String
Dim strEMPSRL As String
Dim strRQSTSRC As String
Dim strUPDUSR As String
Dim strEMPBRTDAT As String
dt.Columns.Add("Serial no.", GetType(Integer))
dt.Columns.Add("Employee code", GetType(String))
dt.Columns.Add("Employee Name", GetType(String))
dt.Columns.Add("Telephone", GetType(String))
dt.Columns.Add("Branch(job)", GetType(String))
dt.Columns.Add("General Clinic", GetType(String))
dt.Columns.Add("Dental Clinic", GetType(String))
dt.Columns.Add("Emp.Age", GetType(String))
dt.Columns.Add("Visit date", GetType(String))
dt.Columns(7).ColumnMapping = MappingType.Hidden
For Each gvRow As GridViewRow In Gridview1.Rows
Dim row As DataRow = dt.NewRow()
row("Serial no.") = gvRow.Cells(0).Text
row("Employee code") = DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Text
row("Employee Name") = DirectCast(gvRow.Cells(3).FindControl("empnme"), TextBox).Text
row("Branch(job)") = DirectCast(gvRow.Cells(8).FindControl("dropjobqs"), DropDownList).SelectedItem
row("Telephone") = DirectCast(gvRow.Cells(4).FindControl("tel"), TextBox).Text
row("General Clinic") = DirectCast(gvRow.Cells(6).FindControl("chkdelete"), CheckBox).Checked
row("Dental Clinic") = DirectCast(gvRow.Cells(7).FindControl("chkdental"), CheckBox).Checked
row("Visit date") = strtDate.Text
If (row("General Clinic").ToString = True) Then
row("General Clinic") = "*"
Else
row("General Clinic") = "-"
End If
If (row("Dental Clinic").ToString = True) Then
row("Dental Clinic") = "*"
Else
row("Dental Clinic") = "-"
End If
Try
If (row("Employee code").Length <> 0) Then
If (row("Employee code").StartsWith(0)) Then
dr = conn.MyReader("SELECT DAYEMPNBR, DEMPNAM, DBRTDAT, DPRJCDE, DEMPBRN FROM DAYBAS WHERE DAYEMPNBR = '" + DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Text + "' and ddayoff ='1900-01-01' ")
'cmd.Parameters.Add("@EMPNBR", SqlDbType.VarChar).Value = box1.Text
If dr.HasRows Then
While dr.Read()
strVSTDTE = DateTime.Now.ToShortDateString
row("Employee Name") = dr(0).ToString
strEMPBRTDAT = dr(1).ToString
strEMPPRJCDE = dr(2).ToString
strEMPBRN = dr(3).ToString
strBRNCDE = row("Branch(job)").ToString 'last added 9/5 2:40
strEMPBRN = dr(4).ToString
'the next step the birthday in correct dormat
strEMPAGE = Now.Year - Convert.ToDateTime(strEMPBRTDAT).Year
row("Emp.Age") = strEMPAGE
End While
Else
strEMPBRN = DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Text
row("Employee Name") = "please check the employee codfgdfde"
End If
dt.Columns(4).ColumnMapping = MappingType.Hidden
Else
dr = conn.MyReader("SELECT EMPNAM , EMPBRTDAT , EMPPRJCDE , EMPBRN, EMPNBR FROM EMPBAS where EMPNBR ='" + DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Text + "' and empmra !='12'")
If dr.HasRows Then
While dr.Read()
strVSTDTE = DateTime.Now.ToShortDateString
row("Employee Name") = dr(0).ToString
strEMPBRTDAT = dr(1).ToString
strEMPPRJCDE = dr(2).ToString
strEMPBRN = dr(3).ToString
strBRNCDE = row("Branch(job)").ToString 'last added 9/5 2:40
strEMPBRN = dr(4).ToString
'the next step the birthday in correct dormat
strEMPAGE = Now.Year - Convert.ToDateTime(strEMPBRTDAT).Year
row("Emp.Age") = strEMPAGE
End While
Else
strEMPBRN = DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Text
row("Employee Name") = "please check the employee dfgdfgcode"
'DirectCast(gvRow.Cells(0).FindControl("empnum"), TextBox).Focus()
End If
End If
dt.Columns(7).ColumnMapping = MappingType.Hidden
End If
Catch ex As Exception
Throw (ex)
End Try
dt.Rows.Add(row)
Next
Session("ProductsTable") = dt
Response.Redirect("preview.aspx")
End Sub