Click here to Skip to main content
15,909,953 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to run outlook on client Pin
Anurag Gandhi13-Oct-10 0:17
professionalAnurag Gandhi13-Oct-10 0:17 
AnswerRe: how to run outlook on client Pin
fjdiewornncalwe13-Oct-10 3:42
professionalfjdiewornncalwe13-Oct-10 3:42 
GeneralRe: how to run outlook on client Pin
magichi13-Oct-10 16:56
magichi13-Oct-10 16:56 
GeneralRe: how to run outlook on client Pin
fjdiewornncalwe14-Oct-10 13:15
professionalfjdiewornncalwe14-Oct-10 13:15 
QuestionUpdate all gridview rows at once Pin
amina8912-Oct-10 1:47
amina8912-Oct-10 1:47 
AnswerRe: Update all gridview rows at once Pin
Geoff Williams12-Oct-10 3:06
Geoff Williams12-Oct-10 3:06 
GeneralRe: Update all gridview rows at once Pin
phil.o12-Oct-10 4:23
professionalphil.o12-Oct-10 4:23 
GeneralRe: Update all gridview rows at once [modified] Pin
amina8914-Oct-10 0:02
amina8914-Oct-10 0:02 
Hi; Thak you phil.o Smile | :)
I tried using a parameterized query but it does not work:It update with zero all marks
 foreach (GridViewRow row in GridView1.Rows)<br />
        {<br />
            TextBox notem1 = row.FindControl("note1") as TextBox;<br />
            TextBox notem2 = row.FindControl("note2") as TextBox;<br />
            Label num = row.FindControl("lblUserID1") as Label;<br />
            SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
<br />
            SqlCommand myCommand = new SqlCommand(<br />
"UPDATE EXAMEN "<br />
   + "SET NOTE = "<br />
   + "(CASE "<br />
   + "WHEN CODE_MATIERE = '111' then @note1 "<br />
   + "WHEN CODE_MATIERE = '112' then @note2 "<br />
   + "END) "<br />
   + "WHERE NUM_INSCRIPTION = @num;"<br />
<br />
<br />
       , myConnection);<br />
<br />
            myCommand.Parameters.Add(new SqlParameter("@num", SqlDbType.VarChar, 4));<br />
<br />
            myCommand.Parameters["@num"].Value = num.Text;<br />
            myCommand.Parameters.Add(new SqlParameter("@note1", SqlDbType.Float, 2));<br />
<br />
            myCommand.Parameters["@note1"].Value = notem1.Text.Replace(",", ".");<br />
<br />
<br />
            myCommand.Parameters.Add(new SqlParameter("@note2", SqlDbType.Float, 2));<br />
<br />
            myCommand.Parameters["@note2"].Value = notem2.Text.Replace(",", ".");<br />
            myConnection.Open();<br />
           <br />
           myCommand.ExecuteNonQuery();<br />
<br />
            myConnection.Close();<br />
          <br />
        }


modified on Thursday, October 14, 2010 6:21 AM

GeneralRe: Update all gridview rows at once Pin
phil.o14-Oct-10 5:35
professionalphil.o14-Oct-10 5:35 
GeneralRe: Update all gridview rows at once Pin
amina8917-Oct-10 3:35
amina8917-Oct-10 3:35 
GeneralRe: Update all gridview rows at once Pin
amina8921-Oct-10 0:04
amina8921-Oct-10 0:04 
GeneralRe: Update all gridview rows at once Pin
amina8922-Oct-10 15:24
amina8922-Oct-10 15:24 
QuestionPanel Control Pin
Thanusree Duth11-Oct-10 20:58
Thanusree Duth11-Oct-10 20:58 
AnswerRe: Panel Control Pin
Brij11-Oct-10 22:05
mentorBrij11-Oct-10 22:05 
AnswerRe: Panel Control Pin
Tej Aj12-Oct-10 21:35
Tej Aj12-Oct-10 21:35 
QuestionAUTOCOMPLETE Pin
padmanabhan N11-Oct-10 20:37
padmanabhan N11-Oct-10 20:37 
AnswerRe: AUTOCOMPLETE Pin
Pete O'Hanlon11-Oct-10 23:57
mvePete O'Hanlon11-Oct-10 23:57 
AnswerRe: AUTOCOMPLETE Pin
Steve Echols13-Oct-10 7:05
Steve Echols13-Oct-10 7:05 
GeneralRe: AUTOCOMPLETE Pin
padmanabhan N14-Oct-10 0:20
padmanabhan N14-Oct-10 0:20 
GeneralRe: AUTOCOMPLETE Pin
Steve Echols14-Oct-10 16:46
Steve Echols14-Oct-10 16:46 
QuestionDataPager with ListView Pin
Łukasz Nowakowski11-Oct-10 3:48
Łukasz Nowakowski11-Oct-10 3:48 
QuestionPrinting question Pin
Abrojus11-Oct-10 2:56
Abrojus11-Oct-10 2:56 
QuestionMerge between VB & C# [modified] Pin
Abdullah S. Abdelhay11-Oct-10 1:53
Abdullah S. Abdelhay11-Oct-10 1:53 
AnswerRe: Merge between VB & C# Pin
Brij11-Oct-10 2:40
mentorBrij11-Oct-10 2:40 
AnswerRe: Merge between VB & C# Pin
Abhijit Jana11-Oct-10 7:59
professionalAbhijit Jana11-Oct-10 7: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.