Click here to Skip to main content
15,920,383 members
Home / Discussions / Database
   

Database

 
GeneralRe: Database documentation tools Pin
Michael P Butler2-Oct-03 22:47
Michael P Butler2-Oct-03 22:47 
GeneralConvert Access97 to 2000 programmatically Pin
Hans-Georg Ulrich1-Oct-03 5:37
Hans-Georg Ulrich1-Oct-03 5:37 
GeneralRe: Convert Access97 to 2000 programmatically Pin
Mike Ellison2-Oct-03 10:16
Mike Ellison2-Oct-03 10:16 
Generalerror in class type Pin
ranjjj1-Oct-03 5:02
ranjjj1-Oct-03 5:02 
Generalbcp Pin
sardinka1-Oct-03 3:07
sardinka1-Oct-03 3:07 
GeneralUpdating Related Tables Pin
Wjousts30-Sep-03 11:07
Wjousts30-Sep-03 11:07 
GeneralRe: Updating Related Tables Pin
STW2-Oct-03 7:29
STW2-Oct-03 7:29 
GeneralRe: Updating Related Tables Pin
Wjousts2-Oct-03 8:54
Wjousts2-Oct-03 8:54 
Okay, thanks for your reply. Here's an example of the problem I'm having. I've included some of the code I've added just to try and figure out what's happening. When I iterate throw the rows of the child table I find that all the rows have RowState = Unchanged, even though some of them have an Original and a Proposed value. I believe they are not getting updated because the RowState is Unchanged, but I can't figure out why the RowState is Unchanged when there is clearly a Proposed value available. Surely setting a Proposed value for a row should automatically change the RowState?

<br />
public void UpdateData()<br />
{<br />
	connDB.Open();<br />
        // I tried to intecept the RowUpdating events, but they never actually occur!<br />
	SubApt.RowUpdating += new OleDbRowUpdatingEventHandler(MyRowUpdateHandler);<br />
<br />
        // Try to find out what the status of the rows in the child table actually is.<br />
	string s = "";<br />
	foreach (DataRow thisRow in m_myDS.Tables["tblSub"].Rows)<br />
        {<br />
		s += thisRow["Key"] + " -> " + thisRow["Field1"] + " " + thisRow.RowState.ToString() + "\n";<br />
                // RowState is ALWAYS Unchanged even though some rows have a proposed value!<br />
		if (thisRow.HasVersion(DataRowVersion.Proposed))<br />
		{<br />
                // The proposed value really is the value it's supposed to be changed to, and the original value<br />
                // really is the original value<br />
			s += thisRow["Field1", DataRowVersion.Original] + " " + thisRow["Field1", DataRowVersion.Proposed] + "\n";<br />
		}<br />
	}<br />
	MessageBox.Show(s);<br />
<br />
        // the main table updates just fine<br />
	MainApt.Update(m_myDS.Tables["tblMain"]);<br />
        // but this does nothing!!! It doesn't matter which way around I update the two tables, or even if I leave<br />
        // out the main table altogether<br />
	SubApt.Update(m_myDS.Tables["tblSub"]);<br />
	connDB.Close();<br />
}<br />

GeneralRe: Updating Related Tables Pin
STW2-Oct-03 22:31
STW2-Oct-03 22:31 
GeneralRe: Updating Related Tables Pin
Wjousts3-Oct-03 4:52
Wjousts3-Oct-03 4:52 
GeneralRe: Updating Related Tables Pin
Wjousts3-Oct-03 5:20
Wjousts3-Oct-03 5:20 
Generalwhere close Pin
sardinka30-Sep-03 5:05
sardinka30-Sep-03 5:05 
GeneralRe: where close Pin
Edbert P16-Oct-03 20:45
Edbert P16-Oct-03 20:45 
Generaladd record to a database Pin
ranjjj30-Sep-03 4:33
ranjjj30-Sep-03 4:33 
GeneralGetting the SQL commands from OleDbDataAdapter.Update Pin
Wjousts29-Sep-03 10:38
Wjousts29-Sep-03 10:38 
GeneralRe: Getting the SQL commands from OleDbDataAdapter.Update Pin
Guillermo Rivero29-Sep-03 11:53
Guillermo Rivero29-Sep-03 11:53 
GeneralRe: Getting the SQL commands from OleDbDataAdapter.Update Pin
Wjousts29-Sep-03 12:18
Wjousts29-Sep-03 12:18 
GeneralRe: Getting the SQL commands from OleDbDataAdapter.Update Pin
Wjousts30-Sep-03 4:57
Wjousts30-Sep-03 4:57 
GeneralRedistribute MS DataGrid Control Pin
pallattila29-Sep-03 7:57
pallattila29-Sep-03 7:57 
GeneralRe: Redistribute MS DataGrid Control Pin
Steve S30-Sep-03 5:21
Steve S30-Sep-03 5:21 
GeneralSQLServer and XML RAW Pin
Guillermo Rivero29-Sep-03 7:45
Guillermo Rivero29-Sep-03 7:45 
GeneralRe: SQLServer and XML RAW Pin
Mike Dimmick1-Oct-03 12:43
Mike Dimmick1-Oct-03 12:43 
GeneralRe: SQLServer and XML RAW Pin
Guillermo Rivero3-Oct-03 2:37
Guillermo Rivero3-Oct-03 2:37 
GeneralPrimary Key as a Foreign Key Pin
DotNet_Newbie29-Sep-03 6:44
DotNet_Newbie29-Sep-03 6:44 
GeneralRe: Primary Key as a Foreign Key Pin
STW2-Oct-03 22:40
STW2-Oct-03 22: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.