firebird

c# - reading/writing blob from firebird

浪子不回头ぞ 提交于 2020-01-17 01:39:27
问题 I'm trying to read image from firebird with c#, and save it to file system. I can read from table and save. but image can not be viewed. I tried many piece of code on net.but result is same :( Can any one help me please? 回答1: How are you retrieving the code form Firebird? If you are getting the data and casting it to a byte[] try: byte [] blob = row["image"]; // create a file FileStream to write the data FileStream fs = new FileStream("image.jpg", FileMode.Create); fs.Write(blob,0,blob.Length

firebird embedded multiple inserts using .net provider

天大地大妈咪最大 提交于 2020-01-16 03:29:07
问题 I am developing an application that will use firebird embedded and/or postgres depending on user sophistication. The argument for firebird embedded is that there should be less installation, firewall, UAC, etc issues. So far postgres is like walking on clouds but I have hit a roadblock with firebird. The app is .net and I am using this provider http://www.firebirdsql.org/en/net-provider/ version 3.0.2 Everything technically works but with firebird embedded I am inserting only around 100

Entity Framework NullReferenceException calling ToList?

∥☆過路亽.° 提交于 2020-01-14 09:32:10
问题 I'm very new to WPF and the EF, and I'm trying to display some data from a table in a datagrid. I've got the entity model pulled from an existing database and simple operations seem to work (getting row counts, using 'first'). I'm running against Firebird 2.5.0 using the 2.0.5 DDEX provider and 2.5.2 ADO NETProvider. When I try to get the data into the grid or simply into a list, I get a null reference exception. Possibly I just don't understand how to use the entity framework, but the

Entity Framework NullReferenceException calling ToList?

北战南征 提交于 2020-01-14 09:32:06
问题 I'm very new to WPF and the EF, and I'm trying to display some data from a table in a datagrid. I've got the entity model pulled from an existing database and simple operations seem to work (getting row counts, using 'first'). I'm running against Firebird 2.5.0 using the 2.0.5 DDEX provider and 2.5.2 ADO NETProvider. When I try to get the data into the grid or simply into a list, I get a null reference exception. Possibly I just don't understand how to use the entity framework, but the

How to optimize DELETE .. NOT IN .. SUBQUERY in Firebird

断了今生、忘了曾经 提交于 2020-01-14 08:44:10
问题 I've this kind of delete query: DELETE FROM SLAVE_TABLE WHERE ITEM_ID NOT IN (SELECT ITEM_ID FROM MASTER_TABLE) Are there any way to optimize this? 回答1: You can use EXECUTE BLOCK for sequential scanning of detail table and deleting records where no master record is matched. EXECUTE BLOCK AS DECLARE VARIABLE C CURSOR FOR (SELECT d.id FROM detail d LEFT JOIN master m ON d.master_id = m.id WHERE m.id IS NULL); DECLARE VARIABLE I INTEGER; BEGIN OPEN C; WHILE (1 = 1) DO BEGIN FETCH C INTO :I; IF

DataTable.Load(FbDataReader) does not load everything into DataTable

ぐ巨炮叔叔 提交于 2020-01-14 08:04:24
问题 There is a closely related question here: .NET DataTable skips rows on Load(DataReader) I have a SQL Query that returns 169 results. The result looks like this: CustomerID Customer Name TerminalID Creation Date 1 First Customer 12345 2010-07-07 1 First Customer 12346 2010-07-07 1 First Customer 12347 2010-07-07 2 Second Customer 23456 2011-04-18 This result is correct. I entered the query in a C# program and execute it like this: public DataTable getDataTableFromSql(FbCommand command) { //

DataTable.Load(FbDataReader) does not load everything into DataTable

ⅰ亾dé卋堺 提交于 2020-01-14 08:04:06
问题 There is a closely related question here: .NET DataTable skips rows on Load(DataReader) I have a SQL Query that returns 169 results. The result looks like this: CustomerID Customer Name TerminalID Creation Date 1 First Customer 12345 2010-07-07 1 First Customer 12346 2010-07-07 1 First Customer 12347 2010-07-07 2 Second Customer 23456 2011-04-18 This result is correct. I entered the query in a C# program and execute it like this: public DataTable getDataTableFromSql(FbCommand command) { //

How to iterate through a Firebird Database without having to completely load it inside my program?

岁酱吖の 提交于 2020-01-14 06:41:17
问题 I've recently began to work with Database queries when I was asked to develop a program that would have read data from the last 1 month in a Firebird database with almost 100M rows. After stumbling a little bit, I finally managed to filter the database, using Python (and, more specifically, Pandas library), but the code takes more than 8 hours just to filter the data, so it becomes useless when trying to realize the task with the required frequency. The rest of the code runs really quickly,

Firebird的好工具——FlameRobin

家住魔仙堡 提交于 2020-01-13 22:39:21
我有个朋友曾经感叹,Firebird最需要的是一个好的管理工具。从Interbase 6.0到 Firebird1.5,我一直用的是SQL脚本加Marathon。客观的说,这是一个非常优秀的Admin Tool,但是,Marathon却有几个无法回避的问题: 1、Marathon已经有一年没有更新了,已经不能如过去那样完美的支持飞速发展的Firebird。 2、Marathon存在所仰赖的Delphi已经注定要谢幕了(Windows平台上最优秀的开发工具,整整一个时代的辉煌,天才之作,如今徒留感叹……)这让Marathon项目的未来变得迷茫寒冷。 3、Marathon只能运行在Windows平台,这是我那些工作在*nix平台上的朋友非常不满的地方。 最近,在Firebird的站点上,我发现了一个新的优秀管理工具—— FlameRobin 。虽然这个工具还在0.7.5版(按照开源软件的惯例,一个优秀的开源软件在0.1版就足够稳定和好用了),但是已经有了很多亮点: 1、它是跨平台的,不管是*nix还是Windows,都可以用。 2、更新很快,支持最新版本的Firebird(我用的是Firebird 2.0RC3)。 3、每一步操作都通过SQL完成,所有的SQL都可以在操作过程中跟踪到,秉承IBExport的风格,在同一个操作窗中的SQL脚本,还可以回溯,对于我等SQL爱好者

Firebird: How to make an md5 hash?

ぐ巨炮叔叔 提交于 2020-01-13 12:00:08
问题 I want to update all passwords in the DB to have a MD5 hashes password. The following doesn't solve my problem: UPDATE USERS SET USERPASS = hash('SALT' || USERPASS); Problem being: it returns a hash that was not generated using the MD5 algorithm. How can I impliment the md5 hash algorithm in Firebird? 回答1: Unfortunately the algortihm of the hash function is not mentioned in the documentation... anyway, you can implement it as an UDF or use some thirdparty UDF lib which implements it. There is