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" connectionString="server=localhost;User
id=postgres;Password=1234;database=proba;Encoding= Unicode"
providerName="Npgsql" />
And in aspx file I have
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:postgres %>"
SelectCommand="select * from table"></asp:SqlDataSource>
But, when I try to run it I get
Keyword not supported: 'encoding'.
because ASP is trying to use System.Data.SqlClient
[ArgumentException: Keyword not supported: 'encoding'.]
System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable
parsetable, String connectionString, Boolean buildChain, Hashtable
synonyms, Boolean firstKey) +263
System.Data.Common.DbConnectionOptions..ctor(Strin g
connectionString, Hashtable synonyms, Boolean useOdbcRules) +129
System.Data.SqlClient.SqlConnectionString..ctor(St ring
connectionString) +116
System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String
connectionString, DbConnectionOptions previous) +46
System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String
connectionString, DbConnectionPoolGroupOptions poolOptions,
DbConnectionOptions& userConnectionOptions) +201
System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String
value) +82
System.Data.SqlClient.SqlConnection.set_Connection String(String
value) +28
System.Web.UI.WebControls.SqlDataSource.CreateConn ection(String
connectionString) +63
System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments
arguments) +215
System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments
arguments, DataSourceViewSelectCallback callback) +84
System.Web.UI.WebControls.DataBoundControl.Perform Select() +154
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +99
System.Web.UI.WebControls.GridView.DataBind() +24