Sunday, November 12, 2006

Initial Npgsql2 provider factory support added to cvs

UPDATE: Thomas Burkhart sent me a mail telling me that this configuration syntax doesn't work on ms.net 2.0. This is the version which works:

<?xml version="1.0" encoding="iso-8859-1" ?>
<configuration>

<system.data>
<DbProviderFactories>

<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />

</DbProviderFactories>
</system.data>

</configuration>


Thomas said that "the tags are case sensitive and the must be outside any <applicationSettings>"


Thank you Thomas for your feedback which, for sure will help others to get their configuration up and running. I will check with Mono guys to see why my original configuration worked.




Hi all!

Today I committed an initial support for provider factory to Npgsql2.

This will allow ado.net 2.0 users to work with Npgsql using ado.net generic coding.

In order to use it, you have to add the following xml config in your machine.config or yourapp.exe.config file:


<?xml version="1.0" encoding="ISO-8859-1" ?>
<configuration>
<appsettings>

<system.data>
<dbproviderfactories>

<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7">
</add>
</dbproviderfactories>
</system.data>
</appsettings>
</configuration>


P.S.: Sorry for indentation lacking. I don't know how to add it on blogger :(

Note that this is the full contents of a yourapp.exe.config file. If you are changing the machine.config file, just add the "add name=..." section.

The key elements here are the invariant name which will be used in your application when returning the provider factory. In this case it is defined as "Npgsql". But you can specify whatever you want.


That's it! If everything is ok, you will be able to write some code like that, to connect to postgresql:


using System;
using System.Data;
using System.Data.Common;


public class c
{
public static void Main(String[] args)
{

DbProviderFactory factory = DbProviderFactories.GetFactory("Npgsql");

DbConnection conn = factory.CreateConnection();

conn.ConnectionString = "Server=127.0.0.1;User id=npgsql_tests;password=npgsql_tests;";

conn.Open();

conn.Close();


}
}


Enjoy!


P.S.: Npgsql2 code is found in Npgsql2 cvs module. See here for more info about how to get it.

Warning: This is a very early code, so bugs still exist and there are things missing. Basic functionality should work ok.



24 comments:

Dan Smith said...

Hi Francisco, I've been using the cvs version and it is working great. One note, on the .net20 framework I found you need to put the <system.data> information in the <configuration> section, outside of the <appSettings>.

Great work, cheers!
Dan

Trevor D'Arcy-Evans said...

Hi Francisco,
many thanks for your good work. I downloaded the CVS version, compiled it, made the entries in machine.config and it seems to work quite well.

Do you have any intention to build a configuration utility (DbProviderConfigurationHandler?) so that you can connect to it using the Server Explorer in Visual Studio?

Kind regards
Trevor D'Arcy-Evans

Marcos Jr. said...

Boa tarde francisco. Baixei sua versão do cvs e estou usando aqui seu provider com o factory no .net 2.0.
Mas acabei me deparando com um problema. Tenho um banco postgres em UTF8, e ao tentar salvar uma string com acentos ele diz que não aceita a sequencia de bytes:
ERROR: 22021: invalid byte sequence for encoding "UTF8": 0xe97374
A sequencia que mandei foi "Téste Ç" (sem as aspas)

Chequei o Request.ContentEncoding do aspnet e ele está em UTF8.

Pode me dar alguma informação sobre este problema?
Aguardo seu contato.
junalmeida@msn.com; junalmeida@gmail.com

Maurício Machado said...

For people having the same problem as Marcos Jr. ("invalid byte sequence" when trying to insert accented characters in UTF8 encoded databases):

Just create your database with the default encoding (SQL_ASCII) and you should be able to insert and retrieve accented characters fine :)

Don´t know the logic behind this (hints someone?), but worked like a charm for me.

alex said...

Then we will go into the lock and in a few minutes we shall be on the adderall lake.. After considerable whispering between Jane and her mother, the former withdrew, and sent in by the Irish girl a waiter with a basket of soda biscuit, a thyroid pitcher of water, and some glasses.. But on the amoxicillin first appearance of my double--whom I sent on this fatal Monday to the fifth meeting--he was the sixty-seventh man who entered the room.. Atrocious! she exclaimed. clonazepam. Let us, however, keep to the fact--this is the key to the theory of repression--that the second system is capable of occupying an idea only when it is in amoxicillin position to check the development of pain emanating from it.. Lick him! Lick him! exclaimed Buller. celexa. Her daughter having completed her education at the best boarding-school in fluoxetine Philadelphia, and her son being about to graduate at Princeton, the mother had planned with her children a tour to Niagara and the lakes, returning by way of Boston.. It compels us to pursue the lisinopril inner meaning of the dream in these productions.. Got a pencil? He produced the bit of cardboard; Ross fished up a chewed stump of lead pencil, took it in cold, stiff fingers, and disfigured the square with eccentric thyroid scribblings.. All manifestations disappeared as a result of a lengthy sojourn in the country, bodily exercise, and the return lidoderm of physical strength after the termination of the period of puberty.. She's just outside, meanderin' in the road--kinder shy, ye celebrex know, at first.. His parents came home late and went to bed while viagra he was feigning sleep.. The track synthroid couldn't have been in better condition.. Let pretend we ain't here and he'll go away, motrin breathed Abner.. And I had not been at work a year before I found I was living two lives, one real and one merely functional--for two sets of people, one my parish, whom I loved, fioricet and the other a vague public, for whom I did not care two straws...

alex said...

Then we will go into the lock and in a few minutes we shall be on the clindamycin lake.. After considerable whispering between Jane and her mother, the former withdrew, and sent in by the Irish girl a waiter with a basket of soda biscuit, a acetaminophen pitcher of water, and some glasses.. But on the claritin first appearance of my double--whom I sent on this fatal Monday to the fifth meeting--he was the sixty-seventh man who entered the room.. Atrocious! she exclaimed. oxycontin. Let us, however, keep to the fact--this is the key to the theory of repression--that the second system is capable of occupying an idea only when it is in allegra position to check the development of pain emanating from it.. Lick him! Lick him! exclaimed Buller. lyrica. Her daughter having completed her education at the best boarding-school in effexor Philadelphia, and her son being about to graduate at Princeton, the mother had planned with her children a tour to Niagara and the lakes, returning by way of Boston.. It compels us to pursue the phentermine inner meaning of the dream in these productions.. Got a pencil? He produced the bit of cardboard; Ross fished up a chewed stump of lead pencil, took it in cold, stiff fingers, and disfigured the square with eccentric soma scribblings.. All manifestations disappeared as a result of a lengthy sojourn in the country, bodily exercise, and the return fluoxetine of physical strength after the termination of the period of puberty.. She's just outside, meanderin' in the road--kinder shy, ye avandia know, at first.. His parents came home late and went to bed while calcium he was feigning sleep.. The track phentermine couldn't have been in better condition.. Let pretend we ain't here and he'll go away, zithromax breathed Abner.. And I had not been at work a year before I found I was living two lives, one real and one merely functional--for two sets of people, one my parish, whom I loved, lexapro and the other a vague public, for whom I did not care two straws...

alex said...

Then we will go into the lock and in a few minutes we shall be on the evista lake.. After considerable whispering between Jane and her mother, the former withdrew, and sent in by the Irish girl a waiter with a basket of soda biscuit, a lithium pitcher of water, and some glasses.. But on the diflucan first appearance of my double--whom I sent on this fatal Monday to the fifth meeting--he was the sixty-seventh man who entered the room.. Atrocious! she exclaimed. diovan. Let us, however, keep to the fact--this is the key to the theory of repression--that the second system is capable of occupying an idea only when it is in vicodin position to check the development of pain emanating from it.. Lick him! Lick him! exclaimed Buller. acyclovir. Her daughter having completed her education at the best boarding-school in diclofenac Philadelphia, and her son being about to graduate at Princeton, the mother had planned with her children a tour to Niagara and the lakes, returning by way of Boston.. It compels us to pursue the viagra inner meaning of the dream in these productions.. Got a pencil? He produced the bit of cardboard; Ross fished up a chewed stump of lead pencil, took it in cold, stiff fingers, and disfigured the square with eccentric phentermine scribblings.. All manifestations disappeared as a result of a lengthy sojourn in the country, bodily exercise, and the return allopurinol of physical strength after the termination of the period of puberty.. She's just outside, meanderin' in the road--kinder shy, ye celexa know, at first.. His parents came home late and went to bed while naprosyn he was feigning sleep.. The track heparin couldn't have been in better condition.. Let pretend we ain't here and he'll go away, calcium breathed Abner.. And I had not been at work a year before I found I was living two lives, one real and one merely functional--for two sets of people, one my parish, whom I loved, calcium and the other a vague public, for whom I did not care two straws...

alex said...

.. .. .. .. .. .. .. .. .. .. .. .. .. .. ...

alex said...

.. .. .. .. .. .. .. .. .. .. .. .. .. .. ...

christian s said...

does someone know how to make this work also with the server explorer in Visual Studio (previously asked by trevor d'arcy-evans).

David Wimsey said...

Just for reference, if you happen to come across this post and add the xml snippet required, you must make sure the version number in the snippet matches the version you have. As of this posting, Npgsql2 beta2 has a version of 1.98.2.0

Anonymous said...

徵信, 徵信社, 感情挽回, 婚姻挽回, 挽回婚姻, 挽回感情, 徵信, 徵信社, 徵信, 捉姦, 徵信公司, 通姦, 通姦罪, 抓姦, 抓猴, 捉猴, 捉姦, 監聽, 調查跟蹤, 反跟蹤, 外遇問題, 徵信, 捉姦, 女人徵信, 外遇問題, 女子徵信, 外遇, 徵信公司, 徵信網, 徵信, 徵信社, 外遇蒐證, 抓姦, 抓猴, 捉猴, 調查跟蹤, 反跟蹤, 感情挽回, 挽回感情, 婚姻挽回, 挽回婚姻, 感情挽回, 外遇沖開, 徵信, 徵信, 徵信社, 抓姦, 徵信, 徵信社, 外遇蒐證, 外遇, 通姦, 通姦罪, 贍養費, 徵信, 徵信社, 徵信社, 抓姦, 徵信社, 徵信社, 徵信, 徵信, 徵信公司, 徵信社, 徵信, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信社, 徵信公司, 徵信社, 徵信, 徵信, 徵信公司, 女人徵信, 外遇, 外遇, 外遇, 外遇

徵信, 徵信網, 徵信社, 徵信網, 徵信, 徵信社, 外遇, 徵信, 徵信, 徵信社, 抓姦, 徵信, 徵信社, 外遇, 徵信社, 抓姦, 徵信社, 徵信公司, 徵信, 徵信社, 徵信公司, 徵信, 徵信社, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信, 徵信社, 徵信社, 徵信社, 徵信,

rong2009 said...

搬家 搬家 搬家公司 搬家 搬家 票貼 借款 徵信社 徵信 補習班 多益 留學 在職進修 婚紗 補正下着 新娘秘書 汽車旅館 室內設計 室內設計 中古車買賣 植牙 坐月子 婚禮佈置 催眠 派報 漆彈 視訊會議 真空成型 Shade sail nike shoes MBA 在职研究生 在职博士 關鍵字廣告 租屋 花蓮民宿 花蓮民宿 花店 花店 花蓮民宿 租房子 xo醬 牛軋糖 牛嘎糖 代償 房屋貸款 信用貸款 失眠 減肥 糖尿病 血壓計 日立家電 體脂計 外遇 離婚 抓姦 外遇蒐證 外遇抓姦 侵權 仿冒 應收帳款 工商徵信 徵信 徵信社 外遇 徵信 徵信社 外遇 电动隔膜泵 自吸泵 化工泵 离心泵 磁力泵 螺杆泵 水泵 隔膜泵 气动隔膜泵 白蟻

百家乐 轮盘 21点 德州扑克 百家乐系统 真人娱乐场 百家乐 足球 德州扑克 电子游戏 英格兰超级联赛 德国甲组联赛 意大利甲组联赛 西班牙甲组联赛 法国甲组联赛欧冠杯 英超 足球比分 足球彩票 体育彩票 即时比分 免費a片 a片 免費av 色情影片 情色 情色網 色情網站 色情 成人網 成人圖片 成人影片 18成人 av av女優 av av女優 情慾 走光 做愛 sex H漫 情色 情趣用品 情色 a片 a片 成人網站 成人影片 情趣用品 情趣用品 アダルト アダルト アダルトサイト アダルトサイト 情趣用品

睡眠障礙 憂鬱症 躁鬱症 減重 瘦身 中醫減肥 台北中醫減肥 台中中醫減肥 高雄中醫減肥 產後減肥 下半身減肥 下半身瘦身 高雄眼鏡 屏東眼鏡 名牌眼鏡 太陽眼鏡 隱形眼鏡 鐵氟龍 PTFE 中壢花店 林口花店 南崁花店 金莎花束 歌倫比亞 飲料加盟 太陽餅 月餅 口袋秤 度量衡 吊秤 吊磅 電子秤 磅秤 口袋秤 度量衡 吊秤 吊磅 電子秤 磅秤 招牌製作 招牌設計 廣告招牌 大圖輸出 電腦割字 招牌看板 廢鐵 廢銅 廢不銹鋼 廢電線 廢鋁 廢棄物 廢電纜電線 廢塑膠 制服 成衣 戒指 耳環 項鍊 對戒 手鍊 銀飾 飾品 對鍊 護理之家 台中花店 考試 塑膠箱 塑膠容器 工具箱 物流箱 拖板車 自動倉儲 倉儲設備 自行車衣 自行車背包 自行車手套 車衣 債務更生 債務清理 法協 蜂蜜 蜂王乳花粉 農產品 草本膠囊 促進新陳代謝 排便順暢的方法 體內環保 塑膠射出 塑膠製品 塑膠箱籃 物流塑膠箱 休閒傢俱 庭園圍籬 高雄棺木 高雄壽衣 高雄禮儀用品

正享 said...

專業合法驅除
白蟻
除白蟻
白蟻防治
跳蚤
除跳蚤
跳蚤防治
蛀蟲
除蛀蟲
蛀蟲防治
白蟻
除白蟻
白蟻防治
跳蚤
除跳蚤
跳蚤防治
蛀蟲
除蛀蟲
蛀蟲防治
除蟲
除蟲

用品 said...

情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣用品..情趣商品..情趣商品..情趣商品..情趣商品..情趣商品..情趣商品..情趣商品..情趣商品..薇閣情趣..情趣用品台中...台中薇閣情趣用品..情人節..情趣薇閣..情趣同志..情趣..情趣商品.情趣內衣..成人用品..男同志..按摩棒,女同按摩棒,,自慰,,自衛套..情趣用品..跳蛋..plus28,情趣交友..充氣娃娃..情趣按摩棒,情趣用品,潤滑液..情趣睡衣..口交..情趣加盟..情趣內睡衣,薇閣情趣,按摩棒..AV女優..情趣知識..薇閣情趣Motel...交友聊天室..情趣,情趣地下酒吧

Anonymous said...

汽車旅館台北汽車旅館台中汽車旅館高雄汽車旅館
環保袋 ,shopping bags, アダルト
TOEIC TOEFL 托福 英檢 IELTS 雅思 兒童美語

ETON said...

珍藏記憶的盒裡,有你最初的開始

感覺你在最深層的 黑

眼開的 黑 是色彩

髮起的智慧似 黑

嘿! 我愛你添了這一筆!

=================================


Love By 金華堂手工精製胎毛筆

地址:台北市大安區潮州街11號

TEL:886-2-23579747~8

FAX:886-2321-5960

服務網址:http://www.jinbaby.com.tw

嬰兒胎毛筆王國

http://baby.jinbaby.com.tw


胎毛筆肚臍章髮畫


=================================

=================================



Collecting it in the box of memory, there is your first beginning

Feel you are the deepest Black

The eyes opening It is the color to be black

The intelligence initiated is like Black

Hey! I love you for adding this!

=================================


Hall craft refined foetus writing brush of Love By jinbaby

Address: Street No. Dr.eye: 11 of Chaozhou of Da'an area of Taibei

TEL:886-2-23579747~8

FAX:886-2321-5960

Service website:http://www.jinbaby.com.tw

Baby's foetus writing brush kingdom

http://baby.jinbaby.com.tw


Foetus writing brushbelly button chaptersend pictures

ETON said...

推薦好站


SEO網站設計,鋼模塑膠射出,模具,模具射出廠,壓鑄模具廠,Die Casting,天珠水晶藝品,健康檢查選美兆,沉香檀香香品,命理風水,咖啡,命理風水網佈,禮品百貨,交友聯誼,美兆健康檢查Eton家,命理風水精舍天珠寺磁場,精密壓鑄,美兆說妳美美健康日誌晴,寵物狗貓動物之家,ETON旅遊情報誌,嬰兒寶寶的家庭作業,靈鷲山護法會大願隊義工廳堂,天珠寺磁場風水納福招財轉運工具寺,台灣廟宇相簿,命理算命格尚,健康佛學Blogger,禮品贈品美容,檀香沉香香品資料庫


=================================

風水命理


天珠寺命理風水精舍,胎毛筆,古董,on sale,鈦鍺,天珠,招財,戀愛,考試,貔貅,財神爺,麒麟,化煞,念珠,風水,天珠水晶,行車,美兆,1元起標,茶壼茶葉


=================================

說妳美美禮品百貨


瓷花,藤枝,原木精油(精油蝶蝶館),3C家電電子遊戲部,美容儀,保養品,面膜(美濃蜜意區),香晶泥土,沙包,環保(創意叢林洲),禮品,精品,居家擺飾(精裝品味房),脫毛膏,窈窕,內衣(美體寶貝湖),鈦鍺健康韻力房(手鍊項鍊櫃),同人誌角色扮演服飾


=================================

情趣商品


跳蛋情趣商品,保險套情趣用品,情趣老二仿真陽具,性感內衣愛用網,按摩棒情趣用品,催情潤滑液區,肛交性感網,情趣用品自拍用,AV女優愛用品,自慰按摩棒讚


=================================

ETON said...

節人節性感扮演誘惑情挑浪漫女神,DIY非電動型按摩棒,IC控制類按摩棒,無線控制按摩棒,新穎溫控設計,硬質高潮棒,軟質高潮棒仿真男娃高潮G點尋找,潤滑液,激情增艷類,逼真那話兒,無線跳蛋,調情跳蛋,變頻控制跳蛋棒軟質跳蛋棒AV名器自愛,腰娘自慰類,仿真女娃全半身,充氣娃娃,飛機杯罐,硬漢軟質套,吸引自慰式皮飾衣裝扮捆綁束縳,有線穿戴類,無線穿戴類,雙頭龍按摩類,穿戴按摩棒類,後庭拉珠系列,後庭塞器系列性感扮演羊眼環圈,套裝組合系列,口交舔吮類,情調潤滑液,按摩液類,清潔沐浴類,香水情調情趣知識館愛情趣商品sex購物說明

bobo said...

tn chaussuresEnter the necessary language translation, up to 200 bytes winter, moves frequently in China, showing that the deep strategy of the Chinese market. Harvard Business School, according to the relevant survey data show that in recent years the Chinese market three brands nike chaussures, Adidas, Li Ning market share at 21 percent, respectively, 20%, 17%. The brand is first-line to three lines of urban competition for mutual penetration. Side of theworld,announced layoffs, nike tnwhile China's large-scale facilities fists. The sporting goods giant Nike's every move in the winter will be fully exposed its strategy. Years later, the Nike, Inc. announced the world's Fanmens clothingpolo shirts

Kevin said...

牙醫,植牙,矯正,紋身,刺青,創業,批發,皮膚科,痘痘,中醫,飛梭雷射,毛孔粗大,醫學美容,seo,關鍵字行銷,關鍵字自然排序,網路行銷,關鍵字自然排序,關鍵字行銷seo,關鍵字廣告,部落格行銷,網路行銷,seo,關鍵字行銷,關鍵字廣告,關鍵字,自然排序,部落格行銷,網路行銷,網路爆紅,牛舌餅婚紗台中婚紗,腳臭,腳臭,腳臭,腳臭,腳臭

crystal said...

Do not mean bad.Thank you so much! I just want to show some fashion wedding dress, cheap wedding dresses to all of you. I like wedding dresses, because wedding for a girl, it is the most special day in her life. Do you want to have the beautiful wedding dresses and designer wedding dresses in perfect day?? Here are the most popular discount wedding dresses and lace wedding dresses even plus size wedding dresses for all of you. Also the cheap evening dresses and evening formal dresses are a great choice for you. Let you dream come ture!! When you take part in a party, you can choose party cocktail dresses, also fashion but cheap cocktail dresses and cheap prom dresses here. Besides, the cheap bridesmaid dress and cheap flower girl dresses are also provide to you!

crazyloko said...

buy products wholesaleThis phenomenom is typified by China Wholesalersthe rise ofbusiness. Incredible range of products available with China Wholesale “Low Price and High Quality” not only reaches directly to their target clients worldwide but also ensures that wholesale from china from China means margins you cannot find elsewhere and China Wholesale will skyroket your profits.china wholesale productsbuy china wholesalewholesale chinawholesale productsbuy products

Gigi said...

$75 Replica Rolex Watches sale, Our site provides Rolex replica, replica Rolex Watches, replica breitling, replica Cartier, replica Omega, Tag Heuer Watches. . .more than 100 famous rolex brands"
rolex air king
rolex datejust
rolex day date
rolex daytona
rolex gmt
rolex submariner
rolex yachtmaster
a lange sohne watches
alain silberstein watches
bell ross watches
breguet watches
breitling watches
bvlgari watches
cartier watches
omega watches
patek philippe watches
ロレックスレプリカ
ロレックスコピー