Click here to Skip to main content
15,896,606 members
Home / Discussions / Database
   

Database

 
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 
AnswerRe: converting column values to column. Pin
Kasson10-Dec-10 20:29
Kasson10-Dec-10 20:29 
AnswerRe: converting column values to column. Pin
thatraja10-Dec-10 20:32
professionalthatraja10-Dec-10 20:32 
AnswerRe: converting column values to column. Pin
Goutam Patra10-Dec-10 21:08
professionalGoutam Patra10-Dec-10 21:08 
AnswerRe: converting column values to column. Pin
Mycroft Holmes11-Dec-10 20:28
professionalMycroft Holmes11-Dec-10 20:28 
AnswerRe: converting column values to column. Pin
RaviRanjanKr20-Dec-10 18:22
professionalRaviRanjanKr20-Dec-10 18:22 
QuestionHow to convert varchar values to int while passing as an in parameter? Pin
meeram39510-Dec-10 0:25
meeram39510-Dec-10 0:25 
AnswerRe: How to convert varchar values to int while passing as an in parameter? Pin
meeram39510-Dec-10 0:40
meeram39510-Dec-10 0:40 
GeneralRe: How to convert varchar values to int while passing as an in parameter? Pin
Hiren solanki10-Dec-10 1:33
Hiren solanki10-Dec-10 1:33 
GeneralRe: How to convert varchar values to int while passing as an in parameter? Pin
meeram39512-Dec-10 19:14
meeram39512-Dec-10 19:14 
AnswerRe: How to convert varchar values to int while passing as an in parameter? Pin
Eddy Vluggen10-Dec-10 0:59
professionalEddy Vluggen10-Dec-10 0:59 

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.