From: Sam M. <sam...@cl...> - 2004-04-05 13:16:22
|
I have a column defined as a BLOB SUB_TYPE TEXT When I do an INSERT with a length of 736,174 bytes then an error is raised the DB is created from: Hashtable dbCreateParams = new Hashtable(); dbCreateParams.Add("Database", DatabaseName); dbCreateParams.Add("User", UserName); dbCreateParams.Add("Password", Password); dbCreateParams.Add("Charset", "ASCII"); dbCreateParams.Add("Overwrite", "true"); dbCreateParams.Add("PageSize", "4096"); try { FbConnection.CreateDatabase(dbCreateParams); } catch (FbException e) { Parent.ReportError("Error creating FB database: " + e.Message); } but changing the PageSize seems to have no effect. the table is created from: cmd.CommandText = "create table Users (UserId bigint NOT NULL, XML blob sub_type text NOT NULL, "+TimeColumn+" timestamp NOT NULL);"; cmd.ExecuteNonQuery(); // Create Index cmd.CommandText = "CREATE UNIQUE INDEX IX_Users ON Users(UserId);"; cmd.ExecuteNonQuery(); I was a bit confused by the documentation on CreateDatabase with regard to PageSize as it doesn't actually say what units it is in. I can quite believe I am doing something silly here. Any comments welcome Thanks! Sam |
From:
<car...@te...> - 2004-04-05 23:47:23
|
Hello: > I have a column defined as a BLOB SUB_TYPE TEXT > When I do an INSERT with a length of 736,174 bytes then an error is raised What error ?? How re you doing the insert ?? -- Best regards Carlos Guzmán álvarez Vigo-Spain |
From: Sam M. <sam...@cl...> - 2004-04-06 09:44:14
|
Sorry, I thought I posted this... This is the insert code: StreamReader ValuesStream = new StreamReader(FileName); string ValueList = string.Empty; while (ValuesStream.Peek() >= 0) { ValueList = ValuesStream.ReadLine(); Cmd.CommandText = "INSERT INTO " + TableReference + " " + ColumnList + " VALUES (" + ValueList + ");"; Cmd.ExecuteNonQuery(); } ValuesStream.Close(); And it generates this error: A first chance exception of type 'System.Net.Sockets.SocketException' occurred in system.dll Additional information: An existing connection was forcibly closed by the remote host If I reduce the size of the data I am inserting into the XML filed then it works fine. Thanks! Sam "Carlos Guzmán Álvarez" <car...@te...> wrote in message news:407...@te...... > Hello: > > > I have a column defined as a BLOB SUB_TYPE TEXT > > When I do an INSERT with a length of 736,174 bytes then an error is raised > > What error ?? How re you doing the insert ?? > > > > -- > Best regards > > Carlos Guzmán álvarez > Vigo-Spain > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > |
From:
<car...@te...> - 2004-04-06 10:42:54
|
Hello: > This is the insert code: > > StreamReader ValuesStream = new StreamReader(FileName); > string ValueList = string.Empty; > while (ValuesStream.Peek() >= 0) > { > ValueList = ValuesStream.ReadLine(); > Cmd.CommandText = "INSERT INTO " + TableReference + " " + ColumnList + " > VALUES (" + ValueList + ");"; > Cmd.ExecuteNonQuery(); > } > ValuesStream.Close(); Can you make a test using parameterized querys, please ?? -- Best regards Carlos Guzmán álvarez Vigo-Spain |
From: Sam M. <sam...@cl...> - 2004-04-06 14:24:08
|
Parameterized queries work fine. Here is my code: public override void Load(FbCommand Cmd) { Cmd.Parameters.Clear(); StreamReader ValuesStream = new StreamReader(FileName); string ValueList = string.Empty; string ValueListParam = string.Empty; string Sep = string.Empty; int FieldIndex = 0; bool First = true; FbParameter CurParam; while (ValuesStream.Peek() >= 0) { ValueList = ValuesStream.ReadLine(); FieldIndex = 0; foreach(string Value in Regex.Split(ValueList, "','")) { if (First) { CurParam = new FbParameter("Field" + FieldIndex.ToString(), Value.Trim("'".ToCharArray())); Cmd.Parameters.Add(CurParam); ValueListParam += Sep + "?"; Sep = ","; } else { Cmd.Parameters[FieldIndex].Value = Value.Trim("'".ToCharArray()); } FieldIndex++; } First = false; Cmd.CommandText = "INSERT INTO " + TableReference + " " + ColumnList + " VALUES (" + ValueListParam + ");"; Cmd.ExecuteNonQuery(); } ValuesStream.Close(); Cmd.Parameters.Clear(); } Sam "Carlos Guzmán Álvarez" <car...@te...> wrote in message news:407...@te...... > Hello: > > > This is the insert code: > > > > StreamReader ValuesStream = new StreamReader(FileName); > > string ValueList = string.Empty; > > while (ValuesStream.Peek() >= 0) > > { > > ValueList = ValuesStream.ReadLine(); > > Cmd.CommandText = "INSERT INTO " + TableReference + " " + ColumnList + " > > VALUES (" + ValueList + ");"; > > Cmd.ExecuteNonQuery(); > > } > > ValuesStream.Close(); > > Can you make a test using parameterized querys, please ?? > > > > > > -- > Best regards > > Carlos Guzmán álvarez > Vigo-Spain > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > |