hey guys im almost there having an error : "Failed to convert parameter value from a String to a Int64."
this what ive change with your advice guys:
Using con As New SqlClient.SqlConnection(SqlconnectionString)
Dim cmd As New SqlClient.SqlCommand("Populatecsv", con) ' create command objects and add parameters
With cmd.Parameters
.Add("@id", SqlDbType.BigInt)
cmd.Parameters("@id").Value = ID
.Add("@srn", SqlDbType.VarChar, 50)
.Add("@srcode", SqlDbType.VarChar, 50)
.Add("@srnumber", SqlDbType.VarChar, 50)
.Add("@status", SqlDbType.VarChar, 500)
.Add("@CustomerName", SqlDbType.VarChar, 500)
.Add("@HomeContact", SqlDbType.VarChar, 500)
.Add("@BusinessContact", SqlDbType.VarChar, 500)
.Add("@MobileContact", SqlDbType.VarChar, 500)
.Add("@LotHouseNo", SqlDbType.VarChar, 500)
.Add("@RoomUnitStall", SqlDbType.VarChar, 500)
.Add("@BldgFloor", SqlDbType.VarChar, 500)
.Add("@BldgName", SqlDbType.VarChar, 500)
.Add("@Street", SqlDbType.VarChar, 500)
.Add("@Subdivision", SqlDbType.VarChar, 500)
.Add("@Barangay", SqlDbType.VarChar, 500)
.Add("@CityMunicipality", SqlDbType.VarChar, 500)
.Add("@Province", SqlDbType.VarChar, 500)
.Add("@Region", SqlDbType.VarChar, 500)
.Add("@Package", SqlDbType.VarChar, 500)
.Add("@PromoCode", SqlDbType.VarChar, 500)
.Add("@ApplicationDate", SqlDbType.DateTime)
.Add("@PaymentDate", SqlDbType.DateTime)
.Add("@EndorsedDate", SqlDbType.DateTime)
.Add("@PaymentDate", SqlDbType.DateTime)
.Add("@ScheduleDate", SqlDbType.DateTime)
.Add("@ActivationDate", SqlDbType.DateTime)
.Add("@PCDelivery", SqlDbType.VarChar, 500)
.Add("@NoPCAvailable", SqlDbType.VarChar, 50)
.Add("@DatePCPickUp", SqlDbType.DateTime)
.Add("@SalesAgent", SqlDbType.VarChar, 500)
.Add("@Coordinator", SqlDbType.VarChar, 500)
.Add("@SalesChannel", SqlDbType.VarChar, 500)
.Add("@SalesGroup", SqlDbType.VarChar, 500)
.Add("@CreatedBy", SqlDbType.VarChar, 500)
.Add("@loanStatus", SqlDbType.VarChar, 500)
.Add("@timestamp", SqlDbType.DateTime)
End With
con.Open()
Dim adapter As New SqlClient.SqlDataAdapter()
adapter.InsertCommand = cmd
'--Update the original SQL table from the datatable
Dim iRowsInserted As Int64 = _
adapter.Update(dt)
Try
cmd.ExecuteNonQuery()
Catch ex As System.Data.SqlClient.SqlException
MsgBox(ex.Message)
End Try
con.Close()
MsgBox("Success")
End Using
Updated 5-Jun-13 16:33pm
v2