Last post Feb 08, 2011 11:52 AM by firstname.lastname@example.org
Feb 08, 2011 05:10 AMemail@example.com|LINK
I have a VB.net module which works under Dotnetnuke. I had to change the Sql script as I had to draw values from three separate columns and display them in one column, so I wrote a stored procedure to do it. Once I had finished it, I went to the Gridview
and amended the datasource to use the stored procedure instead of the sql script. However, when I went to use the module, I get an error like the one below -
DotNetNuke.Services.Exceptions.ModuleLoadException: Could not find stored procedure ''. ---> System.Data.SqlClient.SqlException: Could not find stored procedure ''. at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet
dataset, DataTable datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at YourCompany.Modules.TherapeuticGroups.ViewTherapeuticGroups.Page_Load(Object
sender, EventArgs e) --- End of inner exception stack trace ---
The connection string is correct, so I cannot understand why DNN cannot find it.
Feb 08, 2011 06:41 AM|Morzel|LINK
Did you qualified your stored procedure name with schema name?
What's your stored procedure full name and how you call it?
Feb 08, 2011 06:55 AMfirstname.lastname@example.org|LINK
Thanks for your reply. I added the stored procedure in the Configure Data Source wizard and tested it on the last tab which works fine. This is how the asp.net source code looks -
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
The stored procedure is called "GetTherapeuticGroups"
Feb 08, 2011 07:34 AM|Morzel|LINK
Have you tried to qualify stored procedure name with schema?
For example 'dbo.GetTherapeuticGroups' instead of 'GetTherapeuticGroups'?
Feb 08, 2011 07:51 AMemail@example.com|LINK
I tried renaming as dbo.therapeuticgroups and still got the same arror.
Feb 08, 2011 09:15 AM|Shuvo Aymon|LINK
have you tried a simple thing? is there any possibility that you have created the SP in a seperat database than what you are currently using? Or if you have several server than may be in another one with same db name.
Is your stored procedure's access is secured with any username?
Feb 08, 2011 09:39 AMfirstname.lastname@example.org|LINK
I have created the datasource using the 'Configure Data Source' wizard in Visual Studio, where you first select the connection string and then select either sql script or stored procedure. If you select the latter you then select the SP from a list. Once
you have done that you can test the SP before saving. Everything works fine up to this point, when I run the web page that is when I get the error.
Feb 08, 2011 09:53 AM|Shuvo Aymon|LINK
try to get data from tables just to check whether the problem is only for SP.
Would you mind checking the spelling of SP again.
You may mail your codes at email@example.com if you feel comfortable.
Feb 08, 2011 11:52 AMfirstname.lastname@example.org|LINK
Thanks Shuvo, I've emailed the source and script for the SP. I would really appreciate your help in resolving this.