Hi,
I am baffled as to why I can't seem to get this while statement to bail out
when it iterates to an empty row? Thanks.
While (Not IsNothing(objEx cel.worksheets( h).cells(i, 1)))
Try
connection.Open ()
Dim command As New SqlCommand("sp_ insertClaId",
connection)
command.Command Type = CommandType.Sto redProcedure
command.Paramet ers.Add("@iPubI d", Int(TextBox1.Te xt))
command.Paramet ers.Add("@sCode ",
objExcel.worksh eets(h).cells(i , j).Value())
command.Paramet ers.Add("@sName ",
objExcel.worksh eets(h).cells(i , j + 1).Value())
command.Paramet ers.Add("@iCatI dOffset", h - 2)
command.Execute NonQuery()
Catch ex As Exception
MsgBox(ex.Messa ge.ToString())
Finally
connection.Clos e()
End Try
i = i + 1
k = k + 1
End While
--
bic
I am baffled as to why I can't seem to get this while statement to bail out
when it iterates to an empty row? Thanks.
While (Not IsNothing(objEx cel.worksheets( h).cells(i, 1)))
Try
connection.Open ()
Dim command As New SqlCommand("sp_ insertClaId",
connection)
command.Command Type = CommandType.Sto redProcedure
command.Paramet ers.Add("@iPubI d", Int(TextBox1.Te xt))
command.Paramet ers.Add("@sCode ",
objExcel.worksh eets(h).cells(i , j).Value())
command.Paramet ers.Add("@sName ",
objExcel.worksh eets(h).cells(i , j + 1).Value())
command.Paramet ers.Add("@iCatI dOffset", h - 2)
command.Execute NonQuery()
Catch ex As Exception
MsgBox(ex.Messa ge.ToString())
Finally
connection.Clos e()
End Try
i = i + 1
k = k + 1
End While
--
bic
Comment