Here is the problem we are having with the data reader. We need to use many data grids in our website, and there seem to be definite advantages in creating them in design view. But we also need to manipulate individual fields of data with code. And we need a connection string in the web config file rather than a fixed connection to the database.
When we create a data grid in designer view, we end up with a connection string in the "connection string" section of the web config file. The connection string we are using with our data reader is in the "app settings" section of web config. And we're just too dumb to figure out a way to get the code-created connection and the designer-created connection to use the same connection string. We tried using the "ConnectionStrings" option for the OleDBConnection, but couldn't find any syntax that would work. And the Help files are NO HELP. So, if you could tell us how to get these two types of connection to use the same connection string, that would be an alternative way to solve our problem.
We are, in case you haven't already guessed, inexperienced at web development. Any help will be appreciated.
Main Topics
Browse All Topics





by: traxionPosted on 2007-06-25 at 13:24:27ID: 19358873
This SQLDataSource is great for bindable controls (such as hte GridView). In your case, I would consider sticking with the dataread. But if you're going to be using something such as the GridView control, drop the SQLDataSource onto your project. You can set the Select Command as follows programatically:
nd = loginSQL
SqlDataSource1.SelectComma