Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a class course
C#
public static class Course
    {
        static SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

        public static bool Updateuserdetails(string Name, string useremail, string usercont)
        {

            bool Result = false;


            try
            {
                conn.Open();

                SqlCommand cmd = new SqlCommand("Select_User_Details", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                String strResult = String.Empty;
                strResult = Convert.ToString(cmd.ExecuteScalar());
                conn.Close();

                if (strResult.Length == 0)
                {
                    MessageBox.Show("Inserting new user");
                    Course.Saveuserdetails(Name, useremail, usercont);

                }
                else
                {
                    MessageBox.Show("user already exist");
                    SqlCommand cmmd = new SqlCommand("Update_user_details", conn);
                    cmmd.CommandType = CommandType.StoredProcedure;
                    cmmd.ExecuteNonQuery();


                }

I WANT TO PUT IN WEBSERVICES..

C#
[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]  
    public  class LoginPage : System.Web.Services.WebService
    {
        [WebMethod]
       public bool insert()
        {
         Db_Helper.Course.Updateuserdetails();
         Db_Helper.Course.Saveuserdetails(Name, useremail, usercont);

BUT IT SHOWS AN ERROR IN ACESSING IN METHOD....PLEASE CHECK IT
Posted
Updated 3-Oct-11 0:43am
v2
Comments
RaisKazi 3-Oct-11 6:45am    
1) Use "pre" tag for code blocks.
2) Whats the benefit of all capital letters?
Reiss 3-Oct-11 6:58am    
What is the error message you are getting?

1 solution

Are you sure you are using the correct method names, the method signatures do not match;
In Course you have;
public static bool Updateuserdetails(string Name, string useremail, string usercont)


In the WebService you have;
Db_Helper.Course.Updateuserdetails();

and
Db_Helper.Course.Saveuserdetails(Name, useremail, usercont);


Should the second call in the webservice not be Updateuserdetails(blah blah blah); and bin the first one.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900