Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
AnswerRe: change folder permission during installation Pin
Dave Kreskowiak19-Sep-05 17:15
mveDave Kreskowiak19-Sep-05 17:15 
Questionlaunch dotnetfx.exe during installation Pin
kani9819-Sep-05 13:01
kani9819-Sep-05 13:01 
AnswerRe: launch dotnetfx.exe during installation Pin
Christian Graus19-Sep-05 14:09
protectorChristian Graus19-Sep-05 14:09 
GeneralRe: launch dotnetfx.exe during installation Pin
kani9820-Sep-05 13:35
kani9820-Sep-05 13:35 
GeneralRe: launch dotnetfx.exe during installation Pin
Christian Graus20-Sep-05 13:44
protectorChristian Graus20-Sep-05 13:44 
GeneralRe: launch dotnetfx.exe during installation Pin
kani9820-Sep-05 14:25
kani9820-Sep-05 14:25 
Questionperform drag&drop operation in listview Pin
Sasuko19-Sep-05 12:45
Sasuko19-Sep-05 12:45 
QuestionHow to Use satallite Assembly Pin
dwark10619-Sep-05 12:10
dwark10619-Sep-05 12:10 
QuestionDataGrid Columns Pin
jinksk19-Sep-05 11:19
jinksk19-Sep-05 11:19 
AnswerRe: DataGrid Columns Pin
miah alom19-Sep-05 11:36
miah alom19-Sep-05 11:36 
AnswerRe: DataGrid Columns Pin
Taurian11019-Sep-05 16:59
Taurian11019-Sep-05 16:59 
AnswerRe: DataGrid Columns Pin
deep719-Sep-05 20:09
deep719-Sep-05 20:09 
QuestionDataGrid Issue Please HELP Pin
Taurian11019-Sep-05 10:45
Taurian11019-Sep-05 10:45 
AnswerRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 11:35
protectorChristian Graus19-Sep-05 11:35 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 14:31
Taurian11019-Sep-05 14:31 
GeneralRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 14:34
protectorChristian Graus19-Sep-05 14:34 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 17:01
Taurian11019-Sep-05 17:01 
GeneralRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 18:15
protectorChristian Graus19-Sep-05 18:15 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 18:39
Taurian11019-Sep-05 18:39 
QuestionProblem with this function.. Pin
Yannielsen19-Sep-05 10:19
Yannielsen19-Sep-05 10:19 
AnswerRe: Problem with this function.. Pin
Christian Graus19-Sep-05 11:37
protectorChristian Graus19-Sep-05 11:37 
AnswerRe: Problem with this function.. Pin
miah alom19-Sep-05 11:38
miah alom19-Sep-05 11:38 
GeneralRe: Problem with this function.. Pin
Yannielsen19-Sep-05 12:23
Yannielsen19-Sep-05 12:23 
QuestionFiltering Publisher ID with LCE (COM+) Pin
Fred dBu19-Sep-05 10:11
Fred dBu19-Sep-05 10:11 
QuestionC# and SQL database Pin
Drew McGhie19-Sep-05 9:46
Drew McGhie19-Sep-05 9:46 
Ok, so I’m a month into my first programming job, and I’ve run into a little problem, hopefully I’ll be able to get help here (its worked before for a school project).

I’m manipulating a SQL database in C# (using the latest 2005 releases of .NET and SQL Server, if that helps), and I’m having some problems updating the Tables correctly.

I’m manipulating a Form, which can have multiple versions. Each form has an ID (“Key”) and each version has an ID as well (“VersionKey”). One Key can relate to multiple VersionKeys, but each VersionKey is unique and only corresponds back to one Key.

The two important tables are organized as follows:

BaseTable:
*Key
Latest Version (the version to load on startup)
(Other nonimportant stuff)

VersionTable:
*VersionKey
Key
(Other nonimportant stuff)

My problem is in creating a new “version”. Here’s simplified code:

1: VersionRow dr = (VersionRow)myDataSet.VersionTable.NewRow();
(Assign the other entries in the row)
2: myDataSet.VersionTable.Rows.Add(dr);
3: myDataSet.Basetable.FindbyKey(currentKey).LatestVersion=dr.VersionKey;
4: (Save function)

#1 generates a new (unique)VersionKey, #2 adds the row to the set, and #3(should) assign the new row's versionkey to it's Key's latestVersion key so the newest version that we're making now will load at startup on the next run.

The problem (and I know the cause) is that the value given to dr.VersionKey is not necessarily the value it will be saved as in the database on the server. At the moment, if I start running off the current partially filled database, displaying dr.VersionKey in a messagebox gives me 15, but that row is saved to a number in the 70’s(it goes up one each time I save to the database). Ordinarily, this wouldn’t be a problem, but I want to set the Latest Version parameter, and I cannot set it with the wrong value that my database generates.

Any ideas on how to retrieve what primary key value the datarow was given?



-- modified at 15:48 Monday 19th September, 2005 (Aparrantly a college degree doesn't make me typo any less)

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.