Хотя csc /t:library strconcat.cs
с using System.Collections.Generic;
я получаю сообщение об ошибкекомпиляции CS0305 ошибок Использование универсального типа списка
strconcat.cs(9,17): error CS0305: Using the generic type
'System.Collections.Generic.List<T>' requires '1' type arguments
mscorlib.dll: (Location of symbol related to previous error)
Код .cs берется из here: Использование Common Language Runtime.
Я проверил description на MSDN, но не может составить до сих пор
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.IO;
using Microsoft.SqlServer.Server;
[Serializable]
[SqlUserDefinedAggregate(Format.UserDefined, MaxByteSize=8000)]
public struct strconcat : IBinarySerialize{
private List values;
public void Init() {
this.values = new List();
}
public void Accumulate(SqlString value) {
this.values.Add(value.Value);
}
public void Merge(strconcat value) {
this.values.AddRange(value.values.ToArray());
}
public SqlString Terminate() {
return new SqlString(string.Join(", ", this.values.ToArray()));
}
public void Read(BinaryReader r) {
int itemCount = r.ReadInt32();
this.values = new List(itemCount);
for (int i = 0; i <= itemCount - 1; i++) {
this.values.Add(r.ReadString());
}
}
public void Write(BinaryWriter w) {
w.Write(this.values.Count);
foreach (string s in this.values) {
w.Write(s);
}
}
}
Я бегу Windows 7 x64 с c:\Windows\Microsoft.NET\Framework\v2.0.50727
, а также c:\Windows\Microsoft.NET\Framework64\v2.0.50727>
Как компилировать? К сожалению, я только начиная с C# - я искал некоторые другие вопросы здесь SO, и эти советы не сделать прогресс для меня (
Список хранящей 'string' не 'SqlString'. –