TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
469.6k
Cannot find procedure GetAdvertReport
Feb 18 2020 5:03 AM
Hi Mates
I am trying to develop a report as pdf, i get thrown for an error saying "Cannot find the store procedure" . But there is a store procedure on the database table name 'Tbl_TrainingAcademy'.
// Repository
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Data.SqlClient;
using
System.Configuration;
using
System.Web;
using
ContentManagementSystem.Models;
using
System.Data;
namespace
ContentManagementSystem.Repository
{
public
class
ReportsMaster : IlReports
{
public
DataSet Generate_AdvertDetailsReport()
{
using
(SqlConnection con =
new
SqlConnection(ConfigurationManager.ConnectionStrings[
"eNtsaOnlineRegistrationDB"
].ToString()))
{
con.Open();
DataSet ds =
new
DataSet();
// Handling Exception
try
{
SqlCommand cmd =
new
SqlCommand(
"GetAdvertReport"
, con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da =
new
SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(ds);
if
(ds.Tables.Count > 0)
{
return
ds;
}
else
{
return
ds =
null
;
}
}
catch
(Exception )
{
throw
;
// Exception states cant find the store procedure 'GetAdvertReport'
}
finally
{
ds.Dispose();
}
}
}
}
}
// ConnectionString from Web.config
<connectionStrings>
<add name=
"eNtsaOnlineRegistrationDB"
connectionString=
"Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\eNtsaOnlineRegistrationDB.mdf;Initial Catalog=eNtsaOnlineRegistrationDB; Integrated Security=True"
providerName=
"System.Data.SqlClient"
/>
</connectionStrings>
Reply
Answers (
2
)
Formatting the html.dropdownlist
Telegram API code is no longer sending messages