1
매개 변수없이 OnClick
버튼에서 저장 프로 시저를 어떻게 실행할 수 있습니까? 이미 연결이 그냥 당신이 당신의 SqlConnection
가 평생 오픈 들고 전역 변수를 유지하지 제언 ExecuteNonQuery 방법 그러나저장 프로 시저 실행 OnClick
Protected Sub btnExport_Click(sender As Object, e As System.EventArgs) Handles btnExport.Click
Dim exec As SqlCommand = New SqlCommand("up_ExportFile", conn)
exec.CommandType = CommandType.StoredProcedure
exec.ExecuteNonQuery()
End Sub
를 추가 열었습니다 치죠
Protected Sub btnExport_Click(sender As Object, e As System.EventArgs) Handles btnExport.Click
Dim exec As SqlCommand = New SqlCommand("up_ExportFile", conn)
exec.CommandType = CommandType.StoredProcedure
End Sub
감사를 배치 바로 그 때 연결 개체가 생성됩니다 이런 식으로
입니다. 누락 된 exec.ExecuteNonQuery()가 트릭을 수행했습니다. 이제 실행 중입니다. 답변을 수락했습니다. –