SELECT c.COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.COLUMNS c
WHERE c.COLUMN_DEFAULT IS NOT NULL
and c.TABLE_NAME = '
AND C.COLUMN_NAME = '
Another Way
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q318048
Control FeaturedProductUserControl = LoadControl(Request.ApplicationPath + "/UserControls/UCfeeds.ascx");
FeaturedProductUserControl.ID = "UsercontrolID" + counter.ToString();
Type typ = FeaturedProductUserControl.GetType();
//Procurar propriedade definida no objecto Usercontrol
System.Reflection.PropertyInfo pi = typ.GetProperty("nome");
pi.SetValue(FeaturedProductUserControl, "nome", null);
plh1.Controls.Add(FeaturedProductUserControl);
1: <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
2: <DataBindings>
3: <asp:MenuItemBinding DataMember="SiteMapNode" />
4: </DataBindings>
5: </asp:Menu>
6: <div id="recibo" runat="server">
7: <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false"
8: StartingNodeUrl="~/Users/default.aspx?i=1" />
1: DateTime month = Convert.ToDateTime(DateTime.Now.ToString()).AddMonths(-12);
2: for (int i = 0; i < 12; i++)
3: {
4: DateTime NextMont = month.AddMonths(i);
5: ListItem list = new ListItem();
6: list.Text = NextMont.ToString("yyyy") + "-" + NextMont.ToString("MMMM").PadRight(15);
7: list.Value = NextMont.Month.ToString();
8: ddlmeses.Items.Add(list);
9: }
10: if (SetCurruntMonth == true)
11: {
12: MyddlMonthList.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true;
13: }
A classe ProfileCommon não é gerada quando asp.net Application project. Para isso teremos de utilizar o WebProfileGenerator em:
http://webprofile.codeplex.com/Thread/View.aspx?ThreadId=20291
Para o utilizar com o Visual Studio 2010 temos de colocar uma pasta chamada AddIns e dentro colocar o ficheiro .dll.
Teremos ainda de alterar o ficheiro (WebProfileGenerator.AddIn) de forma a contemplar o seguinte:
(...)
<code>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>10.0</Version>
</HostApplication>
</code>
(...)
De seguida surge dentro do Visual Studio uma opção (clique lado direito do botão do rato) para gerar a classe profile.
Após classe gerada, podemos por exemplo adicionar uma opção de perfil a um determinado utilizador:
<code>
//Criar o profile para colocar a informacao adicional
WebProfile webProfile = new WebProfile();
WebProfile pro = webProfile.GetProfile(username.Text);
pro.GenericField= ddlphc.SelectedItem.Value;
pro.Save();
</code>
Não esquecer de definir o web.config:
(...)
<code>
<profile defaultProvider="MyProfileProvider" enabled="true">
<providers>
<add name="MyProfileProvider" connectionStringName="intraweb.Properties.Settings.ConnString" applicationName="intraweb" type="System.Web.Profile.SqlProfileProvider, System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxx"/>
</providers>
<properties>
<add name="GenericField" type="String" />
</properties>
</profile>
</code>
(...)
<!-- Jquery para datepicker -->
"<link href="../js/jquery-ui-1.8.4.custom/css/ui-lightness/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-ui-1.8.4.custom/development-bundle/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.4.custom/development-bundle/ui/jquery-ui-1.8.4.custom.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.4.custom/development-bundle/ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.4.custom/development-bundle/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.4.custom/development-bundle/ui/i18n/jquery.ui.datepicker-pt-BR.js"></script>
<script type="text/javascript" >
$(document).ready(function () {
$.datepicker.setDefaults($.datepicker.regional['']);
$("input[name*='dtactivodeTextBox']").datepicker($.datepicker.regional['pt-BR']);
$("input[name*='dtactivodeTextBox']").datepicker();
$("input[name*='dtactivoateTextBox']").datepicker($.datepicker.regional['pt-BR']);
$("input[name*='dtactivoateTextBox']").datepicker();
});
</script>"
<!-- Fim jquery datepicker -->