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

Database

 
GeneralRe: read & update using reader Pin
Mycroft Holmes12-Dec-10 13:16
professionalMycroft Holmes12-Dec-10 13:16 
GeneralRe: read & update using reader Pin
PIEBALDconsult12-Dec-10 16:05
mvePIEBALDconsult12-Dec-10 16:05 
GeneralRe: read & update using reader Pin
Miroslav Bučko14-Dec-10 5:39
Miroslav Bučko14-Dec-10 5:39 
GeneralRe: read & update using reader Pin
Mycroft Holmes14-Dec-10 11:17
professionalMycroft Holmes14-Dec-10 11:17 
GeneralRe: read & update using reader Pin
Jassim Rahma13-Dec-10 2:41
Jassim Rahma13-Dec-10 2:41 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 2:56
mvePIEBALDconsult13-Dec-10 2:56 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 10:33
professionalMycroft Holmes13-Dec-10 10:33 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 14:20
mvePIEBALDconsult13-Dec-10 14:20 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 14:29
professionalMycroft Holmes13-Dec-10 14:29 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 14:57
mvePIEBALDconsult13-Dec-10 14:57 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 15:14
professionalMycroft Holmes13-Dec-10 15:14 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 15:18
mvePIEBALDconsult13-Dec-10 15:18 
GeneralRe: read & update using reader Pin
Fabio Franco14-Dec-10 1:27
professionalFabio Franco14-Dec-10 1:27 
GeneralRe: read & update using reader Pin
Pete O'Hanlon13-Dec-10 11:15
mvePete O'Hanlon13-Dec-10 11:15 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 13:53
mvePIEBALDconsult13-Dec-10 13:53 
GeneralRe: read & update using reader Pin
Gary Huck13-Dec-10 23:56
Gary Huck13-Dec-10 23:56 
GeneralRe: read & update using reader Pin
James Lonero15-Dec-10 14:00
James Lonero15-Dec-10 14:00 
AnswerRe: read & update using reader Pin
Brady Kelly13-Dec-10 23:24
Brady Kelly13-Dec-10 23:24 
It is maybe neater to not use a reader, but rather a DataTable and a TableAdapter. Then you can loop through the table rows, update the is_sent on each row as you process it, and then call Update. Something like this:
using (var ad = new SqlDataAdapter("sp_send_pending_sms", ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString))
{
    ad.SelectCommand.CommandType = CommandType.StoredProcedure;
    var dt = new DataTable();
    ad.Fill(dt);

    // blah blah blah. do your work.
    ad.AcceptChangesDuringUpdate = true;
    ad.Update(dt);
}


If the list is long, you may want to call Update every n rows, not just at the end.
AnswerRe: read & update using reader Pin
Gary Huck13-Dec-10 23:51
Gary Huck13-Dec-10 23:51 
GeneralRe: read & update using reader Pin
PIEBALDconsult15-Dec-10 2:20
mvePIEBALDconsult15-Dec-10 2:20 
AnswerRe: read & update using reader Pin
Spectre_00114-Dec-10 1:48
Spectre_00114-Dec-10 1:48 
GeneralRe: read & update using reader Pin
PIEBALDconsult15-Dec-10 2:22
mvePIEBALDconsult15-Dec-10 2:22 
GeneralRe: read & update using reader Pin
Spectre_00115-Dec-10 2:27
Spectre_00115-Dec-10 2:27 
AnswerRe: read & update using reader Pin
Jason Christian14-Dec-10 8:44
Jason Christian14-Dec-10 8:44 
Questionconverting column values to column. [modified] Pin
livewire1310-Dec-10 18:39
livewire1310-Dec-10 18:39 

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.