Hi,
I,m a beginner to application developing in .net :$ . i'm currently developing pocket pc application (Client server architecture). i need help in connecting to webservice frm pocket pc...(difficulty in finding coding). i hav done simple coding for validate user in webservice...i need coding to send username n password string to web service...n recive the return value....hope anyone can help me out...Uregently need to solve this:S .....thanx in advance...:)
Using SQL database
webservice.....
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
[WebMethod]
public Boolean Login(String userName, String password)
{
//Login for employee
String ConnectionString = (@"Data Source=krish\SQLEXPRESS;Initial Catalog=db;Integrated Security=True");
SqlConnection SqlCon = new SqlConnection(ConnectionString);
SqlCon.Open();
SqlCommand cmd = new SqlCommand("Select Password from Employee where Employee_id = '" + userName + "' ", SqlCon);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
String s = (String)reader[0];
if (s == password)
{
return true;
}
}
return false;
pocket pc application .....
namespace DeviceApplication2
{
public partial class Login : Form
{
private void button1_Click_1(object sender, EventArgs e)
{
int intValid;
//private UserLogin UserID;
if (textBox1.Text.Length == 0)
{
MessageBox.Show("Please Enter Username!");
}
else if (textBox2.Text.Length == 0)
{
MessageBox.Show("Please Enter Password!");
}
else
{
service.Service Ws = new service.Service();
if (Login == true)
{
//main menu link
MainMenu MainMenu = new MainMenu();
MainMenu.ShowDialog();
this.Close();
}
else
{
MessageBox.Show("Please Try Again!");
}
}
}
hope someone can help me....thanks in advance........