Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert to different table

Status
Not open for further replies.
Apr 3, 2005
32
US
I'm trying to add every checked row in a datagrid to another datasource (sqlConnection2) different
from the one I've binded to the datagrid (sqlConnection1). However, I don't know how to proceed this...So far I have this, and now I'm stuck. I'm very new at this, so any suggestion is greatly appreciated.
Thank you


Private Sub Confirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Confirm.Click

Dim DS As DataSet
Dim MyCommand As SqlCommand
Dim InsertCmd As String = "insert into CorrectionData (DGLTACCUNT, CreditAcctUnit, CreditAcct, CreditActivity, CreditCategory, Credit_Ind, CreditAmt, CreditUnit, CreditDescription, CreditReference, DebitAcctUnit, DebitAcct, DebitActivity, DebitCategory, Debit_Ind, DebitAmt, DebitUnit, DebitDescription, DebitReference, TransferUserID, PostingDate, Year, Period, TransType)"

MyCommand = New SqlCommand(InsertCmd, SqlConnection2)


MyCommand.Parameters.Add(New SqlParameter("@CreditAcctUnit", SqlDbType.Char, 5))

MyCommand.Parameters("@CreditAcctUnit").Value =




End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top