Click here to Skip to main content
15,889,413 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem Of Getting Image ID Through Javascript Pin
GlobX1-Dec-10 18:49
GlobX1-Dec-10 18:49 
Questioninsert query Pin
Ramkumar_S1-Dec-10 7:52
Ramkumar_S1-Dec-10 7:52 
AnswerRe: insert query Pin
David Mujica1-Dec-10 9:33
David Mujica1-Dec-10 9:33 
GeneralRe: insert query Pin
Ramkumar_S1-Dec-10 15:08
Ramkumar_S1-Dec-10 15:08 
GeneralRe: insert query Pin
PunkIsNotDead2-Dec-10 9:54
PunkIsNotDead2-Dec-10 9:54 
Questionwhy I am not getting the ID Pin
Jassim Rahma1-Dec-10 2:59
Jassim Rahma1-Dec-10 2:59 
AnswerRe: why I am not getting the ID Pin
T M Gray1-Dec-10 4:52
T M Gray1-Dec-10 4:52 
QuestionGridview update numeric values Pin
amina891-Dec-10 1:35
amina891-Dec-10 1:35 
hello,
I want insert student markes by aonce click using a gridview and this code:

 private void Update()
    {


      
        string cmd = @"UPDATE EXAMEN set NOTE= CASE 
WHEN CODE_MATIERE = '1' and @note1 =99  then '0'  
when CODE_MATIERE = '1' and @note1 <>99  then @note1  
        WHEN CODE_MATIERE = '2' and @note2 ='99'  then '0'  
when CODE_MATIERE = '2' and @note2 <>99  then @note2 END, PRESENCE=
CASE WHEN CODE_MATIERE = '1' and @note1 =99 then 'TRUE' 
when CODE_MATIERE = '2' and @note2 ='99'  then 'TRUE'  else 'FALSE'

end
WHERE NUM_INSCRIPTION = @num;";

       
        float note1, note2;
        string num;
        SqlCommand myCommand;
        SqlParameter param1, param2, param3;

        using (SqlConnection myConnection = new SqlConnection(ConnectionString))
        {
            myConnection.Open();

            foreach (GridViewRow row in GridView1.Rows)
            {
                note1 = float.Parse(((TextBox)row.FindControl("tmoy1")).Text);
                note2 = float.Parse(((TextBox)row.FindControl("tmoy4")).Text);
                num = ((Label)row.FindControl("lblUserID1")).Text;
               
                myCommand = new SqlCommand(cmd, myConnection);
           
                param1 = new SqlParameter("num", SqlDbType.VarChar, 4);
                param1.Value = num;
                myCommand.Parameters.Add(param1);

                param2 = new SqlParameter("note1", SqlDbType.Float, 2);
                param2.Value = note1;
                myCommand.Parameters.Add(param2);

                param3 = new SqlParameter("note2", SqlDbType.Float, 2);
                param3.Value = note2;
                myCommand.Parameters.Add(param3);
               
               myCommand.ExecuteNonQuery();
              
            }        

        }  myConnection.Close();

    }




but the code not work I tried the float and decimal and money for the type of note
I tried float.parse, Decimal.Parse, convert.todecimal
the code multiplies the values of the first row by 2 for each click on update button bizarre .

help me please,thanks
Écouter
Lire phonétiquement
AnswerRe: Gridview update numeric values Pin
Hiren solanki1-Dec-10 21:48
Hiren solanki1-Dec-10 21:48 
GeneralRe: Gridview update numeric values Pin
amina891-Dec-10 23:59
amina891-Dec-10 23:59 
Questionasp:Menu Pin
Satish_S30-Nov-10 22:26
Satish_S30-Nov-10 22:26 
AnswerRe: asp:Menu Pin
musefan1-Dec-10 0:50
musefan1-Dec-10 0:50 
QuestionModalPopupExtender Problem Pin
Vimalsoft(Pty) Ltd30-Nov-10 21:53
professionalVimalsoft(Pty) Ltd30-Nov-10 21:53 
AnswerRe: ModalPopupExtender Problem Pin
phil.o30-Nov-10 23:49
professionalphil.o30-Nov-10 23:49 
GeneralRe: ModalPopupExtender Problem Pin
Vimalsoft(Pty) Ltd1-Dec-10 0:48
professionalVimalsoft(Pty) Ltd1-Dec-10 0:48 
GeneralRe: ModalPopupExtender Problem Pin
phil.o1-Dec-10 2:20
professionalphil.o1-Dec-10 2:20 
GeneralRe: ModalPopupExtender Problem Pin
Vimalsoft(Pty) Ltd1-Dec-10 2:30
professionalVimalsoft(Pty) Ltd1-Dec-10 2:30 
GeneralRe: ModalPopupExtender Problem Pin
phil.o1-Dec-10 4:26
professionalphil.o1-Dec-10 4:26 
GeneralRe: ModalPopupExtender Problem Pin
phil.o1-Dec-10 5:36
professionalphil.o1-Dec-10 5:36 
GeneralRe: ModalPopupExtender Problem Pin
Vimalsoft(Pty) Ltd1-Dec-10 18:55
professionalVimalsoft(Pty) Ltd1-Dec-10 18:55 
GeneralRe: ModalPopupExtender Problem Pin
Vimalsoft(Pty) Ltd1-Dec-10 20:15
professionalVimalsoft(Pty) Ltd1-Dec-10 20:15 
Question[asp.net] can i catch back browser button? Pin
buffering8330-Nov-10 16:37
buffering8330-Nov-10 16:37 
AnswerRe: [asp.net] can i catch back browser button? Pin
Anurag Gandhi30-Nov-10 19:19
professionalAnurag Gandhi30-Nov-10 19:19 
QuestionTengo el mismo problema Pin
alejandro fon30-Nov-10 12:36
alejandro fon30-Nov-10 12:36 
AnswerRe: Tengo el mismo problema Pin
Not Active30-Nov-10 14:38
mentorNot Active30-Nov-10 14:38 

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.