MTSkull Posted December 19, 2003 Posted December 19, 2003 I am missing something but can not seem to find an Awnser. strConn = "data source=" & gstrServer & ";" strConn &= "initial catalog=" & gstrDB & ";" strConn &= "Integrated Security=SSPI" strSQL = "EXEC Update_Phys_Address " strSQL &= "'" & giSelectedLocation & "'" strSQL &= "'" & giSelectedDoctor & "'" strSQL &= "'" & txtAddress1.Text.ToString & "'" strSQL &= "'" & txtAddress2.Text.ToString & "'" strSQL &= "'" & txtAddress3.Text.ToString & "'" strSQL &= "'" & txtCity.Text.ToString & "'" strSQL &= "'" & cmbState.Text.ToString & "'" strSQL &= "'" & txtZip.Text.ToString & "'" strSQL &= "'" & txtPhoneNumber.Text.ToString & "'" strSQL &= "'" & txtFaxNumber.Text.ToString & "'" subSetMsgCaption("Updateing Physician Address Table") subSetMsgTitle("Datafeed in Progress") subShowMessageBox() sqlAdapter = New SqlClient.SqlDataAdapter(strSQL, strConn) ????? I am trying to update the Physicians address via stored procedure. I can not seem to find the Execute Command (vb6) is it replaced with the Fill command. By the way I got the Idea to run the Update via stored procedure from another post. I hit my head and thought "Why didn't I think of that." MTS Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Moderators Robby Posted December 19, 2003 Moderators Posted December 19, 2003 To execute a SP you can set the SqlCommand method myCommand.CommandType = CommandType.StoredProcedure If you want to add paremters, declare a SqlParameter and set its' Direction. Quote Visit...Bassic Software
MTSkull Posted December 19, 2003 Author Posted December 19, 2003 I kept playing with it and got this to work. sqlConnection = New SqlClient.SqlConnection(strConn) sqlConnection.Open() sqlCommand = New SqlClient.SqlCommand(strSQL, sqlConnection) iReturn = sqlCommand.ExecuteNonQuery() sqlCommand.Dispose() sqlConnection.Close() sqlConnection.Dispose() Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.