i have username and password text box and i want to check when user enter any login name , login name is in string or digits . If login name is string then this function call other wise other function call .
**Login Function**
public DataTable mlogin(string username, string password)
{
string constring = ConfigurationManager.ConnectionStrings["Real"].ConnectionString;
using (SqlConnection con = new SqlConnection(constring))
{
password = Cryptographer.Encrypt(password);
con.Open();
using (SqlCommand cmd = new SqlCommand("select MD.MembershipID, MembershipName, address, ISNULL(FD.FileID,'') as FileID,ISNULL(Sec.SectorName, '') as SectorName, ISNULL(I.PlotNo, '') as PlotNo, MD.ClientPic from MemberMaster MM " +
" inner join MembersDetail MD on MD.MemberShipID = MM.MemberShipID and MD.Srno = 1 " +
" inner join MasterFileDetail FD on FD.MembershipID = MM.MemberShipID and FD.IsOwner = 1 and FD.IsTransfered = 1 " +
" inner join MasterFile FM on FM.FileID = FD.FileID and FM.Cancel = 0 " +
" inner join Sectors Sec on Sec.Phase_ID = FM.PhaseId and Sec.Sector_ID = FM.Sector_ID " +
" inner join PlotsInventory I on I.Phase_ID = FM.PhaseId and I.Plot_ID = FM.Plot_ID " +
" where MM.MemberShipID = '" + username + "' and MM.IsApproved = 1 and RTRIM(MM.LoginPwd) = '" + password + "' and MM.IsActive = 1 " +
" order by FD.FileID", con))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@MembershipID", username);
cmd.Parameters.AddWithValue("@LoginPwd", password);
DataTable mDT_User = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(mDT_User);
return mDT_User;
}
}
}