S
sam
I wanna perform an update but SQL SVR do nothing
But when I perform at T-SQL at Query Analyzer it is working OK.
ASP.Net 1.1 Coding
----------------------
Dim constrUpdate As String = "server='SQLSVR';
Database='JDE_ERP_ARCHIVAL'"
Dim sqlconUpdate As System.Data.SqlClient.sqlconnection
= New System.Data.SqlClient.sqlconnection(constrUpdate)
Dim sqlcmdUpdate As System.Data.SqlClient.SqlCommand =
New SqlCommand()
Dim sqldaUpdate As New
system.Data.SqlClient.sqldataAdapter()
Try
sqlcmdUpdate = sqlconUpdate.CreateCommand
sqlcmdUpdate.CommandText = "update
Rpt_WH_Result_W1_FG set glclass = dim_item.gl_category from
Rpt_WH_Result_W1_FG
, dim_item where
Rpt_WH_Result_W1_FG.illitm
= dim_item.item_number_nk"
sqldaUpdate.SelectCommand = sqlcmdUpdate
sqlconUpdate.Open
sqlcmdUpdate.ExecuteNonQuery
Finally
sqlconUpdate.Close()
sqlconUpdate.Dispose()
End Try
constrUpdate = Nothing
sqlconUpdate = Nothing
sqlcmdUpdate = Nothing
Please advise.
Many thanks.
But when I perform at T-SQL at Query Analyzer it is working OK.
ASP.Net 1.1 Coding
----------------------
Dim constrUpdate As String = "server='SQLSVR';
Database='JDE_ERP_ARCHIVAL'"
Dim sqlconUpdate As System.Data.SqlClient.sqlconnection
= New System.Data.SqlClient.sqlconnection(constrUpdate)
Dim sqlcmdUpdate As System.Data.SqlClient.SqlCommand =
New SqlCommand()
Dim sqldaUpdate As New
system.Data.SqlClient.sqldataAdapter()
Try
sqlcmdUpdate = sqlconUpdate.CreateCommand
sqlcmdUpdate.CommandText = "update
Rpt_WH_Result_W1_FG set glclass = dim_item.gl_category from
Rpt_WH_Result_W1_FG
, dim_item where
Rpt_WH_Result_W1_FG.illitm
= dim_item.item_number_nk"
sqldaUpdate.SelectCommand = sqlcmdUpdate
sqlconUpdate.Open
sqlcmdUpdate.ExecuteNonQuery
Finally
sqlconUpdate.Close()
sqlconUpdate.Dispose()
End Try
constrUpdate = Nothing
sqlconUpdate = Nothing
sqlcmdUpdate = Nothing
Please advise.
Many thanks.