Click here to Skip to main content
16,006,006 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionXamlXmlReader in Framework 4 Pin
od@ananzi.co.za28-Jan-10 2:45
od@ananzi.co.za28-Jan-10 2:45 
AnswerRe: XamlXmlReader in Framework 4 Pin
od@ananzi.co.za28-Jan-10 8:37
od@ananzi.co.za28-Jan-10 8:37 
QuestionInstalling .NET Framework 2 and 3 Pin
Kaikus27-Jan-10 22:38
Kaikus27-Jan-10 22:38 
AnswerRe: Installing .NET Framework 2 and 3 Pin
Not Active28-Jan-10 1:38
mentorNot Active28-Jan-10 1:38 
QuestionFilter search Pin
akosidandan27-Jan-10 19:43
akosidandan27-Jan-10 19:43 
AnswerRe: Filter search Pin
dan!sh 27-Jan-10 22:00
professional dan!sh 27-Jan-10 22:00 
GeneralRe: Filter search Pin
akosidandan27-Jan-10 23:55
akosidandan27-Jan-10 23:55 
QuestionDataset/DataAdapter and updating changes to the database.. Pin
ruanr27-Jan-10 0:28
ruanr27-Jan-10 0:28 
Hi. I'm quite new to using DataSets/DataAdapters.

At first, I tried to populate my DataSet (which consists of several tables) with one select query, like so:
var cmd =
                        new SqlCommand("SELECT * FROM TableOne;SELECT * FROM TableTwo", con);
                    myDataAdapter= new SqlDataAdapter(cmd);
                     
                    myDataAdapter.Fill(ds);


I then proceed to set the primary key for TableTwo in the dataset and instantiate a SqlCommandBuilder with the Adapter as parameter.

When I eventually call myDataAdapter.Update(ds.Tables["TableTwo"]); the adapter gets confused and complains that it can't find a column from TableOne in TableTwo. I googled around and read that you can fix this problem by using seperate DataAdapters for each table in the DataSet. I tried this, creating a new SqlCommand for each adapter with only one select query in each, but calling the second myDataAdapter.Fill overwrites the contents of the DataSet completely!

Of course I could use seperate DataSets for each table but that seems like the incorrect solution. I've googled for tutorials and examples but all of them are too simple to help me (never more than 1 table in the DataSet, and some other issues as well).

Basically, I'd appreciate some advice on how to approach this problem - is it doable with one DataAdapter? if so, how do I get the DataAdapter to understand my DataSet (which seems to be the problem here..)? Otherwise, how do I use more than one DataAdapter to populate a single DataSet?

Thanks in advance for any help...
AnswerRe: Dataset/DataAdapter and updating changes to the database.. Pin
ruanr27-Jan-10 0:38
ruanr27-Jan-10 0:38 
QuestionHow to detect a particular version of driver is installed on the PC when device is not connected. Pin
temp555626-Jan-10 12:31
temp555626-Jan-10 12:31 
QuestionRegQueryValueEx and REG_MULTI_SZ in Interop Pin
Alberto Bar-Noy26-Jan-10 7:42
Alberto Bar-Noy26-Jan-10 7:42 
QuestionAbout ComboBox re-population Pin
Hurricane300026-Jan-10 5:14
Hurricane300026-Jan-10 5:14 
AnswerRe: About ComboBox re-population Pin
Luc Pattyn26-Jan-10 6:18
sitebuilderLuc Pattyn26-Jan-10 6:18 
GeneralRe: About ComboBox re-population Pin
Hurricane300026-Jan-10 8:36
Hurricane300026-Jan-10 8:36 
GeneralRe: About ComboBox re-population Pin
Luc Pattyn26-Jan-10 13:26
sitebuilderLuc Pattyn26-Jan-10 13:26 
QuestionHow to refresh Database Connections Pin
akosidandan26-Jan-10 4:05
akosidandan26-Jan-10 4:05 
AnswerRe: How to refresh Database Connections Pin
Ciumac Sergiu26-Jan-10 6:59
Ciumac Sergiu26-Jan-10 6:59 
Questionhow to acess Control Reference in Thread Method Pin
shaina223126-Jan-10 2:58
shaina223126-Jan-10 2:58 
AnswerRe: how to acess Control Reference in Thread Method Pin
Jimmanuel26-Jan-10 3:11
Jimmanuel26-Jan-10 3:11 
GeneralRe: how to acess Control Reference in Thread Method Pin
Luc Pattyn26-Jan-10 3:30
sitebuilderLuc Pattyn26-Jan-10 3:30 
GeneralRe: how to acess Control Reference in Thread Method Pin
Jimmanuel26-Jan-10 3:53
Jimmanuel26-Jan-10 3:53 
QuestionSoftware Requirements Tool for .NET Pin
Calla25-Jan-10 21:16
Calla25-Jan-10 21:16 
AnswerRe: Software Requirements Tool for .NET Pin
Not Active26-Jan-10 1:46
mentorNot Active26-Jan-10 1:46 
GeneralRe: Software Requirements Tool for .NET Pin
Calla26-Jan-10 3:28
Calla26-Jan-10 3:28 
Questionwindows application Pin
mylogics25-Jan-10 20:40
professionalmylogics25-Jan-10 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.