Hi
To check the login I have given the coding as
[code=cpp]
protected void imgLogin1_Click (object sender, ImageClickEvent Args e)
{
SqlConnection con;
SqlCommand cmd;
string str;
SqlDataReader rd;
str = "user id=sa;password= cast;database=H ello_Dr;server= AURORA-SERVER";
con = new SqlConnection(s tr);
try
{
con.Open();
}
catch
{
}
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select count(UserId1) from DoctorRegistrat ion2 where UserId1='" + txtUserId.Text. ToString() + "' and Password1= '" + txtPassword.Tex t.ToString() + "'";
Int16 cnt;
cnt = cmd.ExecuteScal ar();
if (cnt <= 0)
{
Response.Write( "Un authorise user");
}
else
{
Response.Write( "Authorise user");
}
}[/code]
ERROR: Error 1 Cannot implicitly convert type 'object' to 'short'. An explicit conversion exists (are you missing a cast?)
To check the login I have given the coding as
[code=cpp]
protected void imgLogin1_Click (object sender, ImageClickEvent Args e)
{
SqlConnection con;
SqlCommand cmd;
string str;
SqlDataReader rd;
str = "user id=sa;password= cast;database=H ello_Dr;server= AURORA-SERVER";
con = new SqlConnection(s tr);
try
{
con.Open();
}
catch
{
}
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select count(UserId1) from DoctorRegistrat ion2 where UserId1='" + txtUserId.Text. ToString() + "' and Password1= '" + txtPassword.Tex t.ToString() + "'";
Int16 cnt;
cnt = cmd.ExecuteScal ar();
if (cnt <= 0)
{
Response.Write( "Un authorise user");
}
else
{
Response.Write( "Authorise user");
}
}[/code]
ERROR: Error 1 Cannot implicitly convert type 'object' to 'short'. An explicit conversion exists (are you missing a cast?)
Comment