Posts

Showing posts from January, 2014

LDAP Authentication for ASP.NET

  protected void Button2_Click(object sender, EventArgs e)     {         string ss = LogonValid("000.000.000.000:0000/OU=orgenization,DC=domain(ex:blogger),DC=domain(ex:com)", txtLoginId.Text, txtPassword.Text);          lblError.Text = ss;     }     public static string LogonValid(string ldapDomain, string userName, string password)     {         DirectoryEntry de = new DirectoryEntry(@"LDAP://" + ldapDomain, userName, password);         try         {             object o = de.NativeObject;             DirectorySearcher search = new DirectorySearcher(de);             search.PropertiesToLoad.Add("description");             search.PropertiesToLoad.Add("mail");             search...

How to Call Stored Procedure

                SqlConnection conn = new SqlConnection("Data Source=*****;Initial Catalog=****User                           ID=**;Password=**;");                 SqlCommand cmd = new SqlCommand("NL_PremiumCalculation", conn);                 conn.Open();                 cmd.CommandType = CommandType.StoredProcedure;                 cmd.Parameters.AddWithValue("@BP", Convert.ToDouble(BasicPremium));                 cmd.Parameters.AddWithValue("@PolicyType", policyType);                 SqlDataAdapter da = new SqlDataAdapter(cmd);                 DataSet ds = new DataSet();        ...

Confirm Button Extender

<cc1:ConfirmButtonExtender ID="btnSave_ConfirmButtonExtender" runat="server"                                     ConfirmText="Are you sure to save the Claim ?" Enabled="True"                                     TargetControlID="btnSave"> </cc1:ConfirmButtonExtender>