6. Dezember 2016 12:35
internal string ReadTextData()
{
//zuerst lese ich das Feld in eine Datei ein
SqlConnection con = SQL.getSQL_NAV_Connection();
SqlDataAdapter da = new SqlDataAdapter("SELECT [Formatted Text] as test FROM[TEST$Extended Text Line] WHERE(No_ = 'X0000004') AND([Table Name] = 2) AND(Type = 0) ", con);
SqlCommandBuilder MyCB = new SqlCommandBuilder(da);
DataSet ds = new DataSet("[TEST$Extended Text Line]");
byte[] MyData = new byte[0];
da.Fill(ds, "[TEST$Extended Text Line]");
DataRow myRow;
myRow = ds.Tables["[TEST$Extended Text Line]"].Rows[0];
MyData = (byte[])myRow["test"];
int ArraySize = new int();
ArraySize = MyData.GetUpperBound(0);
FileStream fs = new FileStream(HttpContext.Current.Server.MapPath("~/") + "Artikelbeschreibung.bin", FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(MyData, 0, ArraySize);
fs.Close();
string note = string.Empty;
using (StreamReader streamReader = new StreamReader(HttpContext.Current.Server.MapPath("~/") + "Artikelbeschreibung.bin"))
{
using (BinaryReader reader = new BinaryReader(streamReader.BaseStream))
{
note = reader.ReadString();
reader.Close();
}
streamReader.Close();
}
return "";
}
7. Dezember 2016 08:47
public long Decompress(Stream input, Stream output) {
byte[] buffer = new byte[BUFFER_SIZE];
long nBytes = 0;
using (input = new DeflateStream(input, CompressionMode.Decompress)) {
int length;
while ((length = input.Read(buffer, 0, buffer.Length)) >= 0) {
output.Write(buffer, 0, length);
nBytes += length;
}
}
return nBytes;
}
7. Dezember 2016 11:27
7. Dezember 2016 14:13
7. Dezember 2016 17:26
7. Dezember 2016 17:36
7. Dezember 2016 17:45
17. April 2018 13:39
Scrat2006 hat geschrieben: die Fehlermeldung "Die Blocklänge entspricht nicht dem Komplement".