Monday, August 25, 2014

Call from Home

Heart stops beating when you get a call and its from the babysitter only to tell you that little Mr 4 does not want to listen, they had a fight, he chased her away, brought the dog inside and did not want to talk to her. Happy Days!

Problems storing and retrieving images

Started with storing in the file system and then realised this won't work if file names are the same or if to be retrieved via API. Worked on Saturday to use the image data type which works perfectly only to find out today that it has been deprecated.

Now to try this one:

Monday, August 11, 2014

Login Control

I've been using this code for login for the last 3years and have no idea where I found it but found a similar tutorial that shows most if not all of it:

 private bool SiteLevelCustomAuthenticationMethod(string UserName, string Password)
        {
            bool boolReturnValue = false;
            string connStr = ConfigurationManager.ConnectionStrings["standdsConnectionString"].ConnectionString;
            SqlConnection Con = new SqlConnection(connStr);
            String strSQL = "Select * from tblUserAccounts";
            SqlCommand command = new SqlCommand(strSQL, Con);
            SqlDataReader Dr;
            Con.Open();
            Dr = command.ExecuteReader();
            while (Dr.Read())
            {
                if ((UserName == Dr["strUserName"].ToString()) & (Password == Dr["strPassword"].ToString()))
                {
                    TypeID = Convert.ToInt32(Dr["strTypeID"].ToString());
                    boolReturnValue = true;
                }
            }
            Dr.Close();
            return boolReturnValue;
        }

Here the link to one with more details:

I know that at some point I will need to use the 2013 control along with the OWIN login option and hopefully I can figure out how to apply that to our present database by then

Webforms UnobstrusiveValdcationMode Error

This problem usually comes when creating an empty project and then attempting to use the login control 


The fix: 
Add this line of code in web.config file

  <appSettings>        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />      </appSettings>