Hi there,
First of all thanks for a great job you guys have done on the .NET API,
there are some really great functions that ease a lot of hard work.
Using newest stable release of firebird and firebird-client API
Now my problem:
If I create a new database using the below code:
code snippet:
// construct the connection string
FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
csb.ServerType = FbServerType.Default;
csb.Database = txtNewDatabaseName.Text;
csb.UserID = "SYSDBA";
csb.Password = "masterkey";
csb.DataSource = "localhost";
csb.Dialect = 3;
csb.Charset = "iso8859_1";
// create a new database
FbConnection.CreateDatabase(csb.ToString());
And use your command to store some values using SQL:
FbCommand cmd = new FbCommand(SQL, connection); --> SQL: INSERT INTO
<sometable> VALUES('foo bar')"
if (connection.State == ConnectionState.Closed)
connection.Open();
try
{
cmd.ExecuteNonQuery();
}
catch (Exception exp)
{
return exp.Message;
}
return string.Empty;
And use your FbDataAdapter to retrieve values again
FbDataAdapter da = new FbDataAdapter(SQL, connection); --> SQL: "SELECT *
FROM <sometable>"
da.Fill(dt);
ds.Tables.Add(dt);
dataGridViewSQL.AutoGenerateColumns = true;
dataGridViewSQL.DataMember = "Query";
dataGridViewSQL.DataSource = ds;
It always get all the returned values in UPPERCASE, using a SELECT
If I use a script to insert the values like this:
FbScript script = new FbScript(new StreamReader(
new MemoryStream(Encoding.UTF8.GetBytes(txtSQLScript.Text))));
script.Parse();
FbBatchExecution fbe = new FbBatchExecution(connection);
foreach (string cmd in script.Results)
{
fbe.SqlStatements.Add(cmd);
}
fbe.Execute(true);
Data is saved in proper CASE
So my work-around is to make a script file every single time I need to add
new data to my database, but I would prefer to just execute my INSERT
statement against your FbCommand,
Am I doing something wrong?
Best regards,
Kris Kristensen
------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider