Wednesday, 6 June 2012

transfer data from one page to other page

http://www.codeproject.com/Articles/8055/Transferring-page-values-to-another-page

the most helpful for me in the transfer of data from one page to other in asp.net

Sunday, 6 May 2012

webservice code for authentication of doctor, patient and adding of new patient


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Data.Odbc;
using System.EnterpriseServices;
using System.Web.Services.Configuration;



/// <summary>
/// Summary description for hello
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class project : System.Web.Services.WebService {

    public project () {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

  
    
    // [WebMethod(TransactionOption = TransactionOption.RequiresNew)]
  // [WebMethod]
   // public string HelloWorld() {
   //    return "Hello World";
  // }
   
  
    OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=project_table; User=root;Password=project;Option=3;");
  
    [WebMethod(Description = "login for doctor", EnableSession = false)]
    public string dlogin(string user, string password)
    {
    string mystring ="select dname from doctor_login where duser='"+ Convert.ToString(user) +"' AND  dpassword='" + Convert.ToString(password) + "'";
    OdbcCommand cm = new OdbcCommand(mystring, cn);
    cn.Open();
    OdbcDataReader r = cm.ExecuteReader();
        while (r.Read())
            {
                string thisrow = "";
            for (int i = 0; i < r.FieldCount; i++)
                thisrow = thisrow + r.GetValue(i).ToString() + ",";
             
               return (thisrow);
           // if (thisrow.Length >= 1)
            //    return(true);
            //else
             //   return(false);
          
            }
        cn.Close();
        return null;
         }


    [WebMethod(Description = "login for Patient", EnableSession = false)]
    public string plogin(string user, string password)
    {
        string mystring = "select pid,pname from patient_login where puser='" + Convert.ToString(user) + "' AND  ppassword='" + Convert.ToString(password) + "'";
        OdbcCommand cm = new OdbcCommand(mystring, cn);
        cn.Open();
        OdbcDataReader r = cm.ExecuteReader();
        while (r.Read())
        {
            string thisrow = "";
            for (int i = 0; i < r.FieldCount; i++)
                thisrow = thisrow + r.GetValue(i).ToString() + ",";

             return (thisrow);
          //  if (thisrow.Length >= 1)
            //    return (true);
            //else
              //  return (false);

        }
        cn.Close();
        return null;
    }


    [WebMethod(Description = "register new patient", EnableSession = false)]
    public bool insertpatient(int id, string name, string user, string password, string email)
    {
        bool returnBool = false;
        string str = "INSERT INTO patient_login(pid,pname,puser,ppassword,pemail) values(" + id + ",'" + name + "','" + user + "','" + password + "','" + email + "')";
        OdbcCommand cmd = new OdbcCommand(str, cn);
        try
        {
            cn.Open();
            if (cmd.ExecuteNonQuery() != 0)
                returnBool = true;
            returnBool = true;
        }
        catch
        {
            returnBool = false;
        }
        cn.Close();
        return returnBool;
    }
  }

Tuesday, 1 May 2012

exclusion of HTTP,POP3 ports


To solve problem of localhost ie it converts to www.localhost.com

It is due to antivirus NOD32.

open up nod32 (you probably have it installed on your system if the above methods don't work) go to advanced setup, on the left menu, select protocol filtering, and select HTTP and POP3 ports... ;)

Friday, 20 April 2012

testing webservices

access my sql remotely

Solved: How to enable remote access to MySQL server on Windows XP
Hi there,

On Linux, we can easily enable remote access to MySQL server, but on Windows, I got no success so far ( a client tried to connect to MySQL on the server)

Here's the steps to do that (on the server computer):

1. Open a DOS command prompt on the server.
2. Run the following command from the mysql\bin directory:
mysql -u root --password=
3. A mysql> prompt should be displayed.
4. To create a remote user account with root privileges, run the following commands:
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';

'USERNAME' is the username to be created.
'IP' is the public IP address of the remote connection.
'PASSWORD' is the password to be assigned for this username.
(IP can be replaced with % to allow this user to logon from any host or IP)

mysql> FLUSH PRIVILEGES;
mysql> exit;

Thursday, 19 April 2012

getback windows bootloader

Get the Windows 8 Developer Preview boot menu back.

  1. Start from the Windows 8 Developer Preview installation medium.
  2. Optionally, choose your keyboard settings.
  3. Hit SHIFT+F10 to enter the command prompt.
  4. Execute bootrec /fixmbr to update the main boot record just to be sure, partitions will remain.
  5. Execute bootrec /fixboot to update the boot sector of the system partition.
  6. Execute bootrec /scanos to add known OSes to the boot configuration data.

Get it to list Windows XP.

  1. Execute bootrec /rebuildbcd, this will rebuild the boot configuration data.
  2. If that doesn't work, reboot and use bcdedit from Windows 8 Developer Preview like this:
     
    bcdedit /create {ntldr} /d "Windows XP"
    
    bcdedit /set {ntldr} device partition=X:
    
    bcdedit /set {ntldr} path \ntldr
    
    bcdedit /displayorder {ntldr} /addlast
    
    Please note that you need to right click the Command Prompt tile, then click on advanced in the lower right corner and then click on Run As Administrator. Replace X: by your XP partition.