Similar Threads:
1.Passing parameter for Stored Procedure to Data Adapter/Data Se
2.Data Adapters, Data Sets, Data TableMappings, and XML
Here's what I'm trying to do:
1. Create a data adapter with Select and Insert commands.
2. Use DataTableMappings to map XML tags into columns in a
data base table.
3. Create a dataset
3. Read in a schema using dataset.ReadXmLSchema
4. Read in an xml file that contains the data using
dataset.Read XML
5. Add 3 new columns to the dataset. (These columns have
already been mapped in step 2).
6. Put data in the 3 new columns.
7. Modify some data in the other columns using xpath
queries to find the nodes that need changing.
8. Use datadapter.update(dataset, tablename)
Everything seems to work fine until step 8. I get all the
data, the extra columns get added, and the data in other
columns gets modified. When I execute step 8 I get:
Run-time exception thrown :
System.InvalidOperationException - Cannot add or remove
columns from the table once the DataSet is mapped to a
loaded XML document.
Any ideas about how I can either fix this or do it another
way.
TIA,
Candi
3.problem with data adapter and data set while inserting and retrieving data
i am using a data adapter and a dataset for filling and retrieving data
into .mdb database.
following is the code.....
for the form load event
Dim dc(0) As DataColumn
Try
If OleDbConnection1.State = ConnectionState.Closed Then
OleDbConnection1.Open()
Else
MsgBox("connection can not be established")
End If
DA.Fill(DataSet11, "Table1")
cmd = New OleDbCommandBuilder(DA)
dc(0) = DataSet11.Tables("Table1").Columns("EmpID")
DataSet11.Tables("Table1").PrimaryKey = dc
Catch ex As Exception
MsgBox(ex.Message)
End Try
Delete.Enabled = False
End Sub
for inserting values into the DB
Private Sub Insert_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Insert.Click
Dim dr As DataRow
dr = DataSet11.Tables("Table1").NewRow
dr.Item(0) = Val(TB1.Text)
dr.Item(1) = TB2.Text
dr.Item(2) = TB3.Text
dr.Item(3) = Val(TB4.Text)
dr.Item(4) = TB5.Text
DataSet11.Tables("Table1").Rows.Add(dr)
DA.Update(DataSet11, "Table1")
MsgBox("data is saved")
rno = 0
call filldata()
filldata function consists of the following
With DataSet11.Tables("Table1").Rows(rno)
TB1.Text = Trim(.Item(0))
TB2.Text = Trim(.Item(1))
TB3.Text = Trim(.Item(2))
TB5.Text = Trim(.Item(4))
End With
the error it gives is " there is no row at
0........system.nullreference...........i checked the connection and
its working fine and also the database is getting accessed........the
error is occuring at the line " With
DataSet11.Tables("Table1").Rows(rno) "
4.Table Adapter Configuration Wizard replaces data table name with stored procedure's
Hi
When using Table Adapter Configuration Wizard if 'Use SQL Statements' is
selected as Command Type, the data table's name in dataset is retained and
only its data adapter's select statements are replaced. If however 'Create
new stored procedures' is selected as Command Type, the data table name in
replaced by the name of the newly created select stored procedure. Problem
with this is that the data table's name needs to be put back manually.
Is there a way to keep the data table name the same and just stored
procedures are assigned to the data table's data adapter?
Thanks
Regards
5.Need practical advice on using single stored procedure to process data adapter commands
Im trying to minimize the number of stored procedures and was
wondering if there is any downside to using a single stored procedure
to handle the select,insert,update, and delete commands for a data
adapter.
I create the sql dataadapter using system tables to generate the
parameters and add an additional parameter to denote the type of
process.
Would appreciate any experienced criticisms.....thanks
6. Assign new stored procedure to data adapter
7. Customizing stored procedure generated by data adapter wizard.
8. use existing stored procedure in data adapter configuration wizard is disabled