Click here to Skip to main content
16,011,680 members
Home / Discussions / Database
   

Database

 
QuestionDataSet to SQL Pin
Soundman32.28-Feb-07 2:34
Soundman32.28-Feb-07 2:34 
AnswerRe: DataSet to SQL Pin
Aaron VanWieren9-Feb-07 0:23
Aaron VanWieren9-Feb-07 0:23 
QuestionMoving through each record Pin
RugbyLeague7-Feb-07 23:58
RugbyLeague7-Feb-07 23:58 
AnswerRe: Moving through each record Pin
andyharman8-Feb-07 0:48
professionalandyharman8-Feb-07 0:48 
GeneralRe: Moving through each record Pin
RugbyLeague8-Feb-07 0:52
RugbyLeague8-Feb-07 0:52 
GeneralRe: Moving through each record Pin
Colin Angus Mackay8-Feb-07 1:02
Colin Angus Mackay8-Feb-07 1:02 
GeneralRe: Moving through each record Pin
RugbyLeague8-Feb-07 1:05
RugbyLeague8-Feb-07 1:05 
GeneralRe: Moving through each record Pin
Colin Angus Mackay8-Feb-07 4:21
Colin Angus Mackay8-Feb-07 4:21 
RugbyLeague wrote:
I realise it is best to do it SQL but in this instance (and others) I would like to do it in C# fo reasons which aren't relevant to the question.


Then just issue an update command back to the database. You can write pretty much any SQL that the target database will understand in the various flavours of command object.

e.g.

SqlCommand cmd = new SqlCommand();
cmd.Connection = conn; // Assumes already open connection
cmd.CommandText = "UPDATE MyTable "+
                  "SET SomeColumn = @SomeValue "+
                  "WHERE PrimaryKey = @id";
cmd.Parameters.Add("@SomeValue", updatedValue);
cmd.Parameters.Add("@id", reader.GetInt32(0)); // Assumes the first column in 
                                               // the reader is the primary key.
cmd.ExecuteNonQuery();



GeneralRe: Moving through each record Pin
RugbyLeague8-Feb-07 4:26
RugbyLeague8-Feb-07 4:26 
GeneralRe: Moving through each record Pin
Colin Angus Mackay8-Feb-07 5:30
Colin Angus Mackay8-Feb-07 5:30 
GeneralRe: Moving through each record Pin
RugbyLeague8-Feb-07 5:33
RugbyLeague8-Feb-07 5:33 
AnswerRe: Moving through each record Pin
gauthee8-Feb-07 0:49
gauthee8-Feb-07 0:49 
AnswerWell it hasn't been said Pin
Ennis Ray Lynch, Jr.9-Feb-07 3:33
Ennis Ray Lynch, Jr.9-Feb-07 3:33 
QuestionConfigure Report Server Pin
Shahzad.Aslam7-Feb-07 23:15
Shahzad.Aslam7-Feb-07 23:15 
Question[Ask] Using GetSchemaTable() in C# Pin
Jati Indrayanto7-Feb-07 19:51
Jati Indrayanto7-Feb-07 19:51 
AnswerRe: [Ask] Using GetSchemaTable() in C# Pin
andyharman7-Feb-07 23:13
professionalandyharman7-Feb-07 23:13 
QuestionForm Generator Pin
xoxoxoxoxoxox7-Feb-07 6:57
xoxoxoxoxoxox7-Feb-07 6:57 
QuestionSQL 2000 table size Pin
lost in transition 7-Feb-07 6:12
lost in transition 7-Feb-07 6:12 
AnswerRe: SQL 2000 table size Pin
andyharman7-Feb-07 6:51
professionalandyharman7-Feb-07 6:51 
GeneralRe: SQL 2000 table size Pin
lost in transition 7-Feb-07 9:36
lost in transition 7-Feb-07 9:36 
QuestionHelp needed in update query Pin
vidhu raj7-Feb-07 3:02
vidhu raj7-Feb-07 3:02 
GeneralRe: Help needed in update query Pin
Ware@Work7-Feb-07 4:35
Ware@Work7-Feb-07 4:35 
GeneralRe: thanks i got it worked Pin
vidhu raj7-Feb-07 5:06
vidhu raj7-Feb-07 5:06 
GeneralRe: thanks i got it worked Pin
Ware@Work7-Feb-07 9:23
Ware@Work7-Feb-07 9:23 
QuestionAimed @ the SQL Guru's Pin
Illegal Operation7-Feb-07 1:28
Illegal Operation7-Feb-07 1:28 

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.