Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
   public static string Newmember(string mname, int password, string email)
        SqlConnection con = new SqlConnection(Database.ConnectionString);
            SqlCommand cmd = new SqlCommand("select isnull(max(mid),0)+1 from members", con);
            int mid = (int)cmd.ExecuteScalar();
            cmd.CommandText = "insert into members values(@mid,@mname,@password,@email)";
            cmd.Parameters.Add("@mid", SqlDbType.Int).Value = mid;
            cmd.Parameters.Add("@mname", SqlDbType.VarChar, 50).Value = mname;
            cmd.Parameters.Add("@password", SqlDbType.Int).Value = password;
            cmd.Parameters.Add("@email", SqlDbType.VarChar, 40).Value = email;
            HttpContext.Current.Trace.Write("Member has been added successfully with ID = " + mid +"\n "+"your name is" +mname +" " +"your password is"+password+" "+"your email is "+ email);
        catch (Exception ex)
            HttpContext.Current.Trace.Write("error" + ex.Message);
Posted 24-Dec-12 13:47pm
jibesh at 24-Dec-12 23:07pm
why are you posting the same question again and again. I have found 2 Query with same questions
and both of them are marked as resolved why? If the answer didnt satisfy your query you can ask more question in the same thread itself. you can always use the 'Improve Question' link at the right bottom of your question to modify your question.
do not overpopulate CP with redundant questions
Sergey Alexandrovich Kryukov at 25-Dec-12 0:02am
How is this code related to the question? :-)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It could be something like
myButton.Click += (sender, eventArgs) => { TheMethodToExecute(/* ... */); }

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 mhegazy94 460
1 Sergey Alexandrovich Kryukov 430
2 Ravi Bhavnani 190
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,135
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,619
4 Gihan Liyanage 2,797

Advertise | Privacy | Mobile
Web04 | 2.8.140922.1 | Last Updated 25 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100