我希望在树结构的表中设置数据.
DECLARE @temp TABLE
(
Id INT
, Name VARCHAR(50)
, Parent INT
)
INSERT @temp
SELECT 1,' Great GrandFather Thomas Bishop', null UNION ALL
SELECT 2,'Grand Mom Elian Thomas Wilson' , 1 UNION ALL
SELECT 3, 'Dad James Wilson',2 UNION ALL
SELECT 4, 'Uncle Michael Wilson', 2 UNION ALL
SELECT 5, 'Aunt Nancy Manor', 2 UNION ALL
SELECT 6, 'Grand Uncle Michael Bishop', 1 UNION ALL
SELECT 7, 'Brother David James Wilson',3 UNION ALL
SELECT 8, 'Sister Michelle Clark', …Run Code Online (Sandbox Code Playgroud) 我希望将我的Hijri Shamsi日期'92/2/3'改为这种格式:'92/02/03'
使用此代码,我收到此错误:将varchar数据类型转换为datetime数据类型会导致超出范围的值.
Declare @Str Varchar(10) = '92/2/3'
Select Convert(Varchar(10), Convert(DateTime, @Str), 111)
Run Code Online (Sandbox Code Playgroud)
我该如何更改日期格式?
可能重复:
有条件的"可浏览"属性
我定义AppSettings了具有一些属性的类.在我的形式,当我click Button1,我想要显示属性1和2(1,2显示,其他属性隐藏或不显示),何时click Button2,我想显示属性2和3(1是隐藏,2,3显示,其他属性是隐藏或不显示),我该怎么办?
public class AppSettings
{
[BrowsableAttribute(true), CategoryAttribute("Document Settings"), DefaultValueAttribute(true)]
public bool SaveOnClose{ get; set; }
[BrowsableAttribute(true), CategoryAttribute("Global Settings"), ReadOnlyAttribute(true), DefaultValueAttribute("Welcome to AppDev!")]
public string GreetingText { get; set; }
[BrowsableAttribute(true), DescriptionAttribute("The rate in milliseconds that the text will repeat."), CategoryAttribute("Global Settings"), DefaultValueAttribute(10)]
public int MaxRepeatRate { get; set; }
[BrowsableAttribute(true), CategoryAttribute("Global Settings"), DefaultValueAttribute(4)]
public int ItemsInMRUList { get; set; }
[BrowsableAttribute(true), DefaultValueAttribute(false)]
public bool SettingsChanged { get; set; }
[BrowsableAttribute(true), …Run Code Online (Sandbox Code Playgroud) 如何在c#中获取属性网格项和项的值?例如 :
Name : Ali
LastName : Ahmadi
Run Code Online (Sandbox Code Playgroud)
(Name和LastName是propertygrid的2个属性)
我有一个属性网格,myclass是它的对象源.在我的班级中,我从大小类型中定义了一个项目.如何在item属性中设置默认值?
请看我的代码:
[CategoryAttribute("Information"), DefaultValue(Size(0, 0))]
public Size AndaazehPixel { get; set; }
Run Code Online (Sandbox Code Playgroud)
我的错误:'System.Drawing.Size'是'type'但是像'变量'一样使用