works perfectly when running in debug, but not on server
for some reason this works perfectly, when i do it in debug mode it adds the tasks to stagingtable, and then transfers none duplicates to the regular table. However, when i upload it to the server it does not work.
any ideas
Using bcp As SqlBulkCopy = New SqlBulkCopy(connstring)
bcp.ColumnMappings.Add(0, 1)
bcp.ColumnMappings.Add(1, 2)
bcp.ColumnMappings.Add(2, 3)
bcp.ColumnMappings.Add(3, 4)
bcp.ColumnMappings.Add(4, 7)
bcp.ColumnMappings.Add(5, 5)
bcp.ColumnMappings.Add(6, 10)
bcp.ColumnMappings.Add(7, 13)
bcp.ColumnMappings.Add(8, 6)
bcp.DestinationTableName = "dbo.stagingtasks"
bcp.WriteToServer(table)
If conn.State = System.Data.ConnectionState.Open Then
conn.Close()
End If
If conn1.State = System.Data.ConnectionState.Open Then
conn1.Close()
End If
End Using
cmd1.CommandText = "dbo.taskadding"
cmd1.CommandType = CommandType.StoredProcedure
cmd1.Connection = conn
conn.Open()
cmd1.BeginExecuteNonQuery()
conn.Close()
atas开发者_如何学运维ks.Visible = False
UpdatePanel2.Update()
Label2.Visible = False
Catch ex As Exception
Label2.Text = ex.ToString
'Label2.Visible = True
UpdatePanel2.Update()
End Try
Does the process that runs this have EXEC rights to the proc?
精彩评论