musoswire
Mon Mar 19 07:10:38 CDT 2007
Hi again,
Don't worry about my last question - I fixed it. Sorry about that.
Cheers
Dan
"musosdev" wrote:
> Hi guys
>
> I'm having a bit of trouble getting these changes to work. Wonder if someone
> can explain what I'm missing.
>
> I exchanged the AccessDataSource objects for SQLDataSource objects, which
> look like..
>
> <asp:SqlDataSource ID="sdsTopStories" runat="server" ConnectionString="<%$
> ConnectionStrings:sdsBeggars %>" ProviderName="<%$
> ConnectionStrings:sdsBeggars.ProviderName %>"
> SelectCommand="...">
> </asp:SqlDataSource>
>
> and changed the DataSourceID of my Repeater to "sdsTopStories".
>
> VS added a connection strings element to web config which looks like...
>
> <add name="sdsBeggars"
> connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=|DataDirectory|\Beggars.mdb;Persist Security Info=True;Jet
> OLEDB:Database Password="my password"" providerName="System.Data.OleDb" />
>
> Which, when I test the connection, seems to work. But I now get the
> following .net error when I debug my website... (im not passing any paraments
> to my sql - it doesnt need any)
>
> =====================================================
> Server Error in /Beggars Application
>
> No value given for one or more required parameters.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information about
> the error and where it originated in the code.
>
> Exception Details: System.Data.OleDb.OleDbException: No value given for one
> or more required parameters.
>
> Source Error:
>
> An unhandled exception was generated during the execution of the current web
> request. Information regarding the origin and location of the exception can
> be identified using the exception stack trace below.
>
> Stack Trace:
>
>
> [OleDbException (0x80040e10): No value given for one or more required
> parameters.]
>
> System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
> dbParams, Object& executeResult) +267
> System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
> +192
> System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
> Object& executeResult) +48
> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> behavior, String method) +106
> System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +111
>
> System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
> System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
> IDbCommand command, CommandBehavior behavior) +141
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +137
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
>
> System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
> System.Web.UI.WebControls.Repeater.GetData() +50
> System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean
> useDataSource) +232
> System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
> System.Web.UI.WebControls.Repeater.DataBind() +72
> System.Web.UI.WebControls.Repeater.EnsureDataBound() +55
> System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +12
> System.Web.UI.Control.PreRenderRecursiveInternal() +77
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Control.PreRenderRecursiveInternal() +161
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
>
> ===================================================
>
>
>
>
>
>
>
>
>
> ________________________________________
> "musosdev" wrote:
>
> > Hi guys
> >
> > Thanks for the info - much appreciated. I'll give it ago!
> >
> > Ta
> >
> >
> > Dan
> >
> >
> >
> > "Paul Clement" wrote:
> >
> > > On Tue, 13 Mar 2007 13:04:13 -0700, musosdev <musoswire@community.nospam> wrote:
> > >
> > > ¤ Hi
> > > ¤
> > > ¤ I'm using AccessDataSources to access my .mdb file, like so...
> > > ¤
> > > ¤ <asp:AccessDataSource ID="adsStory" runat="server"
> > > ¤ DataFile="~/App_Data/MyDB.mdb"
> > > ¤ SelectCommand="SELECT * FROM Table WHERE ColumID = ?">
> > > ¤ <SelectParameters>
> > > ¤ <asp:QueryStringParameter Type="Int32"
> > > ¤ QueryStringField="id" />
> > > ¤ </SelectParameters>
> > > ¤ </asp:AccessDataSource>
> > > ¤
> > > ¤ I want to password protect the database in Access, so that if someone
> > > ¤ downloads it they can't get to the data. How do I do that, and still able to
> > > ¤ open the database from my AccessDataSource?
> > > ¤
> > > ¤ Obviously, I don't want the cleartext password in any of my .aspx pages.
> > > ¤
> > > ¤ Thanks,
> > >
> > > If the connection string to the database is stored in your web.config file you can modify it there.
> > > You can check the following for the connection string syntax and database password argument:
> > >
> > >
http://www.connectionstrings.com/?carrier=access
> > >
> > >
> > > Paul
> > > ~~~~
> > > Microsoft MVP (Visual Basic)
> > >