Private Sub inserttoDatagridview()
con.Open()
For Each rw As DataGridViewRow In DataGridView1.Rows
cmd = New SqlCommand("insert into tblEmp (empid,empname,empdesg,dob) values (" & rw.Cells(0).Value & ",'" & rw.Cells(1).Value & "','" & rw.Cells(2).Value & "','" & CDate(rw.Cells(3).Value.ToString()) & "') ", con)
cmd.ExecuteNonQuery()
Next
con.Close()
End Sub