Tuesday, January 22, 2013
tsql add default constraint
IF NOT EXISTS(select * from sys.DEFAULT_CONSTRAINTS where NAME like 'def_myconstraint1%')
BEGIN
ALTER TABLE mytable1
ADD CONSTRAINT def_myconstraint1 DEFAULT 1 FOR mycolumn1
END
GO
Posted by SF at 2:32 pm 0 comments
Friday, January 18, 2013
css center a div
tried to use text-align:center didnt work, the correct way is:
width: 10240px ; margin-left: auto ; margin-right: auto ;
Posted by SF at 1:04 pm 0 comments
Saturday, January 12, 2013
asp.net web application update web.config SMTP settings in global.ascs application_start():
asp.net web application update web.config SMTP settings in global.ascs application_start():
System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/");
System.Net.Configuration.MailSettingsSectionGroup mailSettingsGroup = config.GetSectionGroup("system.net/mailSettings") as System.Net.Configuration.MailSettingsSectionGroup;
mailSettingsGroup.Smtp.Network.Host = Properties.Settings.Default.SMTPServer;
mailSettingsGroup.Smtp.Network.Port = Properties.Settings.Default.SMTPPort;
mailSettingsGroup.Smtp.Network.DefaultCredentials = Properties.Settings.Default.SMTPAuthenticationEnabled;
if (mailSettingsGroup.Smtp.Network.DefaultCredentials)
{
mailSettingsGroup.Smtp.Network.UserName = Properties.Settings.Default.SMTPUsername;
mailSettingsGroup.Smtp.Network.Password = Properties.Settings.Default.SMTPPassword;
}
Posted by SF at 9:56 pm 0 comments
Wednesday, January 09, 2013
prevent double click on asp.net button control
headache solved after search and search and search for solutions:
OnClientClick="this.disabled = true; this.value = 'Submitting...';__doPostBack('SaveChangesButton','')"
Posted by SF at 1:14 pm 0 comments
Subscribe to:
Posts (Atom)