Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

  • Moderators
Posted

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.

Visit...Bassic Software
Posted

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

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...