我有一个nvarchar(max)数据类型列的表.此列中的最大数据长度为37000,然后我无法使用nvarchar(4000).如何为此列创建索引?我的数据是波斯语中的unicode文本.
我在我的应用程序中使用属性网格来显示对象属性的名称和值.
默认情况下,列的宽度(名称和属性)的比例为50:50.我们可以选择滑动分离器来改变这个宽度.我想知道如何以编程方式调整此宽度,以便可以设置为25:75.
我有一个属性网格有2个项目.国家和城市.我在数据库中有1个表:CountryCityTable保存LocationId,Title,ParentId.对于国家,parentId = 0,而对于城市,则为countryid.
在我的propertygrid中,我使用这些并在2个组合框项目中显示.请看我的代码:
namespace ProGrid
{
public class KeywordProperties
{
[TypeConverter(typeof(CountryLocationConvertor))]
public string CountryNames { get; set; }
[TypeConverter(typeof(CityLocationConvertor))]
public string CityNames { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
和
namespace ProGrid
{
public class CountryLocationConvertor : StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
HumanRoles Db = new HumanRoles();
List<LocationsFieldSet> Items = new List<LocationsFieldSet>();
Items = Db.LoadLocations(0,0);
string[] LocationItems = new string[Items.Count];
int count = 0;
foreach (LocationsFieldSet Item in …
Run Code Online (Sandbox Code Playgroud) 我的存储过程是:
create Procedure spSetUser
(
@Name NVarchar(50),
@OrganicTitle NVarchar(30),
@UserName NVarchar(20),
@Password NVarchar(16),
@Result Int Output
)
As
Begin
Set @Result = -1
If Not Exists(Select UserId From dbo.Users Where UserName=@UserName)
Begin
Insert Into dbo.Users (Name,OrganicTitle,UserName,[Password])
Values(@Name,@OrganicTitle,@UserName,@Password)
Set @Result = SCOPE_IDENTITY()
End
Return
End
Go
Run Code Online (Sandbox Code Playgroud)
我的班级是(在microsft企业库中):
[DataObjectMethod(DataObjectMethodType.Insert)]
public Int32 SetUser(UserFieldSet Data)
{
Int32 Result = 0;
object[] values = new object[] { Data.Name, Data.OrganicTitle, Data.UserName, Data.Password, Data.UserId };
Result = Db.ExecuteNonQuery("spSetUser", values);
return Result;
}
Run Code Online (Sandbox Code Playgroud)
结果是执行存储过程的行受影响,但我想得到@Result的值(过程的输出参数),我该如何得到它?
UserFieldClass是:
public class UserFieldSet …
Run Code Online (Sandbox Code Playgroud) 我用这段代码创建了一个类:
public class Customer
{
public Customer() { }
public Customer(Customer cust)
{
ID = cust.ID;
Name = cust.Name;
FatherName = cust.FatherName;
Email = cust.Email;
}
public int ID { get; set; }
public string Name { get; set; }
public string FatherName { get; set; }
public string Email { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
并创建此函数以加载包含一些数据的列表:
public List<Customer> Generate_Data()
{
List<Customer> lstCustomer = new List<Customer>();
Customer customer = new Customer();
customer.ID = 1;
customer.Name = "John Cena";
customer.FatherName = "John"; …
Run Code Online (Sandbox Code Playgroud) 我的文字位于richtextbox中:
<Parag1 Level="One">
First text of parag1. Second text of parag1.
</Parag1>
<Parag2 Level="Two">
First text of parag2. Second text of parag2.
</Parag2>
<Parag3 Level="Footer">
First text of parag3. Second text of parag3.
</Parag3>
<Parag4 Level="Three">
First text of parag4. Second text of parag4.
</Parag4>
Run Code Online (Sandbox Code Playgroud)
我想要更改文本的颜色字体和文本颜色:
1-对于标签 - >字体名称= Tahoma,尺寸= 10,颜色=红色
示例:<Parag1 Level="One">
或</Parag1>
2-对于标签之间的文本,标签的级别不是页脚 - >字体名称= Arial,大小= 12,颜色=黑色
示例:First text of parag1. Second text of parag1.
或First text of parag4. Second text of parag4.
3-对于标签之间的文本标签的级别是页脚 …
我的数据在表中有2个字段,Id和ParentId.我用这种结构存储数据(下面的类似图像).如何获得包含Id = 6的从叶到根的所有路径?(结果样本如下)
--Data structure is as follow :
-- 1
-- /
--2 <- 3 9
-- \ \ /
-- 4 <- 5 7 8
-- \ / / /
-- 6 - - -
-- / \
-- 10 <- 11
-- /
--12
--Data In Table Is :
--Id ParentId
--1 null
--2 1
--3 2
--4 2
--5 3
--5 4
--6 4
--6 5
--6 7
--6 8
--7 9
--8 null
--9 null …
Run Code Online (Sandbox Code Playgroud) 我正在使用Acrobat ActiveX在我的应用程序中显示PDF文档.我想知道是否可以在显示pdf时禁用或隐藏PDF adobe reader上的书签(以及页面左侧的页面,搜索,评论,附件)?
我使用Microsoft.Office.Interop.Word在c#中创建一个word文档
我想在rtl(RightToLeft)方向显示我的阿拉伯文字.如何将文本方向设置为rtl?
在我的下面的代码中,我改变了Alighnment,但我无法改变方向.请帮我!
Word.Application wordApp = new Word.Application();
object objMissing = System.Reflection.Missing.Value;
Word.Document wordDoc = wordApp.Documents.Add(ref objMissing, ref objMissing, ref objMissing, ref objMissing);
Word.Paragraph wordParagraph = wordDoc.Paragraphs.Add(ref objMissing);
wordParagraph.Range.Font.Name = "B Titr";
wordParagraph.Range.Font.Size = 14;
WordParagraph.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight;
wordParagraph.Range.Text = "My Arabic text";
wordParagraph.Range.InsertParagraphAfter();
Run Code Online (Sandbox Code Playgroud) 例如我有 2 个项目: Item1 是string
, Item2 是int
。如何设置 Item1 8 个字符和 Item2 5 个数字的最大长度(在 C# 中)?