473,763 Members | 7,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sqldatasource problems

Hi!

Did anyone successfully managed to use some custom ADO.NET
provider with SqlDataSource? I'd like to connect to some
other database than MSSQL (like MySQL, Firebird or PostgreSQL)
but I'm having problems making this work.
Inside connectionStrin gs I added my name, provider and
connectionStrin g but for some reason SqlDataSource is trying
to use System.Data.Sql Client even if my provider is
different.

Also I tried registering my provider in machine.config but it
won't show up in VS.

Any help would be appreciated.
Nov 23 '05 #1
3 5072
what driver did you specify in the connect string?

-- bruce (sqlwork.com)

"zapov" <za***@yahoo.co m> wrote in message
news:dm******** **@news1.xnet.h r...
Hi!

Did anyone successfully managed to use some custom ADO.NET
provider with SqlDataSource? I'd like to connect to some
other database than MSSQL (like MySQL, Firebird or PostgreSQL)
but I'm having problems making this work.
Inside connectionStrin gs I added my name, provider and
connectionStrin g but for some reason SqlDataSource is trying
to use System.Data.Sql Client even if my provider is
different.

Also I tried registering my provider in machine.config but it
won't show up in VS.

Any help would be appreciated.

Nov 23 '05 #2
Bruce Barker wrote:
what driver did you specify in the connect string?


I'm using PostgreSQL driver.
In Web.config I added
<add name="postgres" connectionStrin g="server=local host;User
id=postgres;Pas sword=1234;data base=proba;Enco ding=Unicode"
providerName="N pgsql" />

And in aspx file I have
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:postgres %>"
SelectCommand=" select * from table"></asp:SqlDataSour ce>

But, when I try to run it I get
Keyword not supported: 'encoding'.
because ASP is trying to use System.Data.Sql Client
[ArgumentExcepti on: Keyword not supported: 'encoding'.]
System.Data.Com mon.DbConnectio nOptions.ParseI nternal(Hashtab le
parsetable, String connectionStrin g, Boolean buildChain, Hashtable
synonyms, Boolean firstKey) +263
System.Data.Com mon.DbConnectio nOptions..ctor( String
connectionStrin g, Hashtable synonyms, Boolean useOdbcRules) +129
System.Data.Sql Client.SqlConne ctionString..ct or(String
connectionStrin g) +116

System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnectionO ptions(String
connectionStrin g, DbConnectionOpt ions previous) +46

System.Data.Pro viderBase.DbCon nectionFactory. GetConnectionPo olGroup(String
connectionStrin g, DbConnectionPoo lGroupOptions poolOptions,
DbConnectionOpt ions& userConnectionO ptions) +201
System.Data.Sql Client.SqlConne ction.Connectio nString_Set(Str ing
value) +82
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing
value) +28
System.Web.UI.W ebControls.SqlD ataSource.Creat eConnection(Str ing
connectionStrin g) +63

System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteSelect(Da taSourceSelectA rguments
arguments) +215
System.Web.UI.D ataSourceView.S elect(DataSourc eSelectArgument s
arguments, DataSourceViewS electCallback callback) +84
System.Web.UI.W ebControls.Data BoundControl.Pe rformSelect() +154
System.Web.UI.W ebControls.Base DataBoundContro l.DataBind() +99
System.Web.UI.W ebControls.Grid View.DataBind() +24
Nov 23 '05 #3
zapov wrote:
Bruce Barker wrote:
what driver did you specify in the connect string?


I'm using PostgreSQL driver.
In Web.config I added
<add name="postgres" connectionStrin g="server=local host;User
id=postgres;Pas sword=1234;data base=proba;Enco ding=Unicode"
providerName="N pgsql" />

And in aspx file I have
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:postgres %>"
SelectCommand=" select * from table"></asp:SqlDataSour ce>


Also, when I change SqlDataSource to
<asp:SqlDataSou rce ID="SqlDataSour ce2" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:postgres %>"
ProviderName="< %$ ConnectionStrin gs:postgres.pro viderName %>"
SelectCommand=" select * from bugs.bugs"></asp:SqlDataSour ce>

I receive
Failed to find or load the registered .Net Framework Data Provider.

[ConfigurationEr rorsException: Failed to find or load the registered
..Net Framework Data Provider.]
System.Data.Com mon.DbProviderF actories.GetFac tory(DataRow
providerRow) +371
System.Data.Com mon.DbProviderF actories.GetFac tory(String
providerInvaria ntName) +138
System.Web.UI.W ebControls.SqlD ataSource.GetDb ProviderFactory () +64
System.Web.UI.W ebControls.SqlD ataSource.GetDb ProviderFactory Secure() +51
System.Web.UI.W ebControls.SqlD ataSource.Creat eConnection(Str ing
connectionStrin g) +37
Ok, I get it. ASP can't find registered DbProviderFacto ry
But, I have in machine.config under <DbProviderFact ories>
<add name="PostgreSQ L Data Provider" invariant="Npgs ql"
description=".N et Framework Data Provider for PostgreSQL"
type="Npgsql.Np gsqlFactory, System.Data, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9" />

And as I understand this should enable it to be displayed in VS
but it isn't.

So, I am wondering is there anything special that should be
implemented in ADO.NET provider so it could be used in SqlDataSource?
Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4480
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a ControlParameter <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XYZ %>"
0
2633
by: Alain Hogue | last post by:
When I try to use "%" with the LIKE command it return nothing if they are an acute charater in the search string. For example if I have a field named "Title" containing words like "Hébert, Gagné, Sauté, etc...) and I try to do this: <asp:SqlDataSource SelectCommand="SELECT * FROM WHERE Title LIKE '%' + @Search + '%') > <SelectParameters> <asp:ControlParameter ControlID="txtSearch" PropertyName="Text" Name="Search" Type="string"...
2
1589
by: stuart.d.jones | last post by:
Hi, I'm using a detailsview control with an SqlDataSource control. My Update query isn't working, and I've narrowed it down to the optimistic concurrency parameters - i.e. when I comment them out of the query, it works. What seems to be happening is that if a field is NULL when it is read in through the select statement, it's causing the update statment not to find a match. I've got ConvertEmptyStringToNull not set (so it should...
0
3283
by: Camel | last post by:
Hi, I'm just learning the new databinding paradigm in ASP.NET 2 and I have a question. What if I want to use 1 SqlDataSource for 2 comboboxes? What I want is a master/detail relationship between the 2 comboboxes. That is, the value in combobox A filters the values shown in combobox B. My first thought is to load the data once (via a SqlDataSource), turn the caching feature on and filter the data using a DataView.
3
8923
by: Daniel R. H. | last post by:
Hi, I'm having problems to get the value of a Querystring into the SelectCommand of a SQLDataSource, here's my code: ---------------------------------------------- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT cedula,nombre,tipo FROM clientes WHERE nombre LIKE '%' + @nombre +...
9
2223
by: Dan Sikorsky | last post by:
When I hit the Test Query button in the SqlDataSource design, all the rows come back. But when I run the website, without any changes, in the IDE, the GridView tied to the SqlDataSoure is empty. How do I get this working? -- Thank you kindly, Dan Sikorsky BA, BSCE, MCS
2
1998
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or several items. The reason I'm wondering if I should use an SqlDataSource object is overhead. For example, prior to learning about the sqlDataSource I would just code the ado.net procedure myself. For example, create connection object, create and...
1
4273
by: Corey B | last post by:
I have a page with a DetailsView control and a SQLDataSource control. The SQLDataSource control is connected to an Access database. Everything works fine. Now I want to change the back end database from Access to SQL Server. So I go in to the SQLDataSource and modify it to connect to the SQL Server database. No problem. However, the DetailsView control does not seem to pick up the changes. When I click on the little shortcut menu (not...
0
1000
by: Luke Graham | last post by:
hi, I'm coding a social network style application for my dissertation and am having a few problems, I'm using ASP.net and VB.net I have a button within a DetailsView control that I want to trigger an Insert for a Datasource that is also within the DetailsView There is an OnClick event handler for the button but I'm having problems finding the datasource to trigger it the code I'm using is Dim DataSource As SqlDataSource =...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.