| View previous topic :: View next topic |
| Author |
Message |
epercipio Novice
Joined: 25 Oct 2011 Posts: 1
|
Posted: Tue Oct 25, 2011 10:04 pm Post subject: Error with Connection String Initialization |
|
|
I just purchased EasyQuery.Net webforms. I loaded the WebDemoAjazCS2010 sample project and made the following changes:
Default.aspx
Changed: <asp:AccessDataSource ID="ResultDS" runat="server"></asp:AccessDataSource>
To: <asp:SqlDataSource ID="ResultDS" runat="server"></asp:SqlDataSource>
Default.aspx.designer.cs
Changed: protected global::System.Web.UI.WebControls.AccessDataSource ResultDS;
To: protected global::System.Web.UI.WebControls.SqlDataSource ResultDS;
Default.aspx.cs
Changed all oledb references to sqlclient references and also changed the .xml file to a new one that references my database. Changed the SqlClient connection to point to my database.
When I build queries, it builds the SQL statements correctly, but when I try to display the query results, I get the following error message:
"Error in SQL statement: The ConnectionString property has not been initialized."
Please help! |
|
| Back to top |
|
 |
Admin Site Admin
Joined: 07 Nov 2005 Posts: 272
|
Posted: Mon Oct 31, 2011 3:45 pm Post subject: |
|
|
You should set the ConnectionString property of ResultDS object before
execution of SQL statement.
For example, you can do it in Page_Load or right before calling ResultDS.Select
Something like:
ResultDS.ConnectionString = "Data Source=localhost;Initial
Catalog=nwind;Integrated Security=True;"; |
|
| Back to top |
|
 |
|