Note that there are some explanatory texts on larger screens.

plurals
  1. POInserting just a new record using DataSet (.net c# ado.net )
    primarykey
    data
    text
    <p>I've a form containing more than 200 text boxes in .NET desktop application. I want to insert them into their respective 4 tables of Database. Now how should I go about it using Dataset &amp; DataAdapter to do this?</p> <p>I mean usually this will be the flow:</p> <ol> <li>Populate the DataSet using DataAdapter.Fill(Dataset,"DataTable");</li> <li>manipuate the data of DataSet</li> <li>DataAdapter.Update(Dataset,"DataTable") updates the content back to Database.</li> </ol> <p>Code:<a href="http://dev.mysql.com/doc/refman/5.1/en/connector-net-tutorials-intro.html#connector-net-tutorials-data-adapter" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.1/en/connector-net-tutorials-intro.html#connector-net-tutorials-data-adapter</a></p> <p>But here I just want to insert a new record in 3 different tables.</p> <p>I think the way is to 1. Programatically Create A dataset with 3 Datatables. 2. Bind 200 Textboxes to respective columns of these Datatabes 3. dataAdapter.Update(dataSet, dataTable.TableName);</p> <p>Am I right?</p> <p>How does dataAdapter.Update(dataSet, dataTable.TableName); work? Because, my each dataTable will have only one record. (the new record that is to be inserted. binded with those 200 TextBoxes of the form) where as the Table of the Database will have thousands of records. If I do dataAdapter.Update(dataSet, dataTable.TableName); will it delete all the rest of the records and insert this one alone? </p> <p>I just want to insert a new record (without fetching other 1000s of records into my Dataset) into Database.Table using Dataset.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload