在调试中运行时效果很好,但在服务器上运行时则不行

时间:2011-03-09 16:42:45

标签: asp.net sql-server vb.net

由于某种原因,这是完美的,当我在调试模式下执行它时,它将任务添加到stagingtable,然后将没有重复项传输到常规表。但是,当我将其上传到服务器时,它无法正常工作。

任何想法

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()


atasks.Visible = False
UpdatePanel2.Update()
Label2.Visible = False


Catch ex As Exception
    Label2.Text = ex.ToString
    'Label2.Visible = True
    UpdatePanel2.Update()
End Try

1 个答案:

答案 0 :(得分:0)

运行此过程的进程是否具有proc的EXEC权限?