Re: working with dataset
- From: "puja" <pujarpatel@xxxxxxxxxxx>
- Date: Mon, 31 Jul 2006 16:34:03 +1000
hi, here is the code to insert a row and update ur table. I don't know code
to join 2 tables. Its in VB.net but am sure u will get some idea.
Dim myConnection As SqlConnection
Dim mySqlDataAdapter As SqlDataAdapter
myConnection = New SqlConnection("")
mySqlDataAdapter = New SqlDataAdapter("Select * from tblInstallation",
myConnection)
Dim myDataSet As DataSet = New DataSet
Dim myDataRow As DataRow
' Create command builder. This line automatically generates the update
commands for you, so you don't
' have to provide or create your own.
Dim myDataRowsCommandBuilder As SqlCommandBuilder = New
SqlCommandBuilder(mySqlDataAdapter)
' Set the MissingSchemaAction property to AddWithKey because Fill will not
cause primary
' key & unique key information to be retrieved unless AddWithKey is
specified.
mySqlDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
mySqlDataAdapter.Fill(myDataSet, "tblInstallation")
myDataRow = myDataSet.Tables("tblInstallation").NewRow()
myDataRow("StoreCode") = "storeno"
myDataRow("Installer") = Me.tx_installer.Text
myDataRow("dt_stamp1") = Me.lbl_date.Text
myDataRow("Assessor") = Me.tx_assessor.Text
myDataSet.Tables("tblInstallation").Rows.Add(myDataRow)
mySqlDataAdapter.Update(myDataSet, "tblInstallation")
myDataSet = Nothing
"kalaivanan" <mail2kalai@xxxxxxxxx> wrote in message
news:1154326181.769698.138460@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
how do i insert new row, update and join two tables in a dataset.
.
- Follow-Ups:
- Re: working with dataset
- From: kalaivanan
- Re: working with dataset
- References:
- working with dataset
- From: kalaivanan
- working with dataset
- Prev by Date: Re: working with dataset
- Next by Date: Re: Casting Generic Classes - Possible Solution
- Previous by thread: Re: working with dataset
- Next by thread: Re: working with dataset
- Index(es):