Korzh.com developer tools forums :: View topic - Error with Connection String Initialization
Korzh.com
home : Community forums  FAQFAQ   SearchSearch  |  RegisterRegister  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Error with Connection String Initialization

 
Post new topic   Reply to topic    Korzh.com developer tools Forum Index -> EasyQuery ASP.NET
View previous topic :: View next topic  
Author Message
epercipio
Novice


Joined: 25 Oct 2011
Posts: 1

PostPosted: Tue Oct 25, 2011 10:04 pm    Post subject: Error with Connection String Initialization Reply with quote

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
View user's profile Send private message
Admin
Site Admin


Joined: 07 Nov 2005
Posts: 272

PostPosted: Mon Oct 31, 2011 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Korzh.com developer tools Forum Index -> EasyQuery ASP.NET All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group