asp.net WebService를 만들었습니다. 유효성을 검사 한 후 사용자 정보를 업데이트하려는 경우, 사용자가 입력 한 새 UserName이 이미 존재하지 않는 경우에만 새 UserName을 업데이트 할 수 있습니다.웹 메서드 실행시 오류가 발생했습니다.
문제는 사용자의 유효성을 검사하지만 사용자가 아닌 새로운 UserName을 지정하려고 할 때와 같은 오류가 발생하는 것입니다.
public int UpdateUserInfo(string oldusername, string newusername, string mailid, string password)
{
string validateUser = "Select UserName from tbl_UserInfo where UserName='" + newusername + "' ";
con = new MySqlConnection(conString);
con.Open();
MySqlCommand cmd1 = new MySqlCommand(validateUser, con);
string User = cmd1.ExecuteScalar().ToString();
con.Close();
if (User == newusername)
{
return 0;
}
else
{
string updateUser = "Update tbl_UserInfo SET UserName='" + newusername + "',Password='" + password + "',Email_ID='" + mailid + "' where UserName='" + oldusername + "' ";
con = new MySqlConnection(conString);
con.Open();
MySqlCommand cmd = new MySqlCommand(updateUser, con);
int success = cmd.ExecuteNonQuery();
con.Close();
if (success > 0)
{
return success;
}
else
return 0;
}
}
참고 :
Request format is unrecognized for URL unexpectedly ending in '/UpdateUserInfo'.
다음
내 코드는 내가 같은 결과를 원하는; IF my UserName is A and when i update that UserName with same name
i.e A than it should not be updated but when i give another name as B
than it should be updated by B i.e now UserName A becomes the B
무엇이 문제 일 수 있습니까?
해결책을주십시오.
감사합니다.
이 시도를 http://stackoverflow.com/questions/657313/request-format-is-unlognogn-for-url-unexpectedly-ending-in – Tariqulazam
웹 서비스의 메소드를'[WebMethod]'로 선언 했습니까? 너 어디서 전화하는거야? 그것은 POST 요청 또는 GET입니까? – Murtaza