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