Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net 2.0 & SQL Express: Cannot find stored procedure...

Reply
Thread Tools

ASP.Net 2.0 & SQL Express: Cannot find stored procedure...

 
 
=?Utf-8?B?ZGVuIDIwMDU=?=
Guest
Posts: n/a
 
      09-05-2006
Hi everybody,

I created several stored procedure in a local sql server 2005 express
database, now when I call/execute them in the asp.net 2.0 web page, it
returns an error message of "Cannot find the stored procedure '<proc_name>'",
this is funny, when I execute the command in a sql query window "exec
sp_GetAllArticles", it also returns cannot find stored procedure, but when I
execute the "Use <DBName>" and then execute the statement, it works. The sql
connection used in codes is ok.
So, what I have missed to set or where I made mistake?


Code:
Inside web.config,
<add name="Connectstring" connectionString="Data
Source=DENSIA\SQLExpress;Initial Catalog=DbName;Integrated Security=True"
providerName="System.Data.SqlClient" />

inside Load event,

DAL.ConnectionString =
ConfigurationManager.ConnectionStrings["Connectstring"].ConnectionString;

private void DisplayLatestResources()
{
DAL.CreateCommand("sp_GetLatestFiveTrainingResourc es");
DAL.ExecuteReader();
SqlDataReader dr = DAL.DataReader;
.....
}



Try supplying with user id and password, same result...also try using
aspnet_regsql.exe, same result also...

Thanks in advanced.


den2005


--
MCP Year 2005, Philippines
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      09-05-2006
Make sure the user (anon?) is not set with another default catalog other
than DbName.
Make sure the server is configured to accept TCP/IP connections

Since this is Express, your options are limited (no profiler, for example).
I am not sure how to easily query which DB you are in (someone else surely
knows), but I know you can run this command:

SELECT * FROM sys.database_files

If you find the files are not DBName and DBName_Log, you are in the wrong
database. You can also query the sprocs in this database and make sure you
stuck them there rather than some other database. Other than that, I am
stumped.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"den 2005" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi everybody,
>
> I created several stored procedure in a local sql server 2005 express
> database, now when I call/execute them in the asp.net 2.0 web page, it
> returns an error message of "Cannot find the stored procedure
> '<proc_name>'",
> this is funny, when I execute the command in a sql query window "exec
> sp_GetAllArticles", it also returns cannot find stored procedure, but when
> I
> execute the "Use <DBName>" and then execute the statement, it works. The
> sql
> connection used in codes is ok.
> So, what I have missed to set or where I made mistake?
>
>
> Code:
> Inside web.config,
> <add name="Connectstring" connectionString="Data
> Source=DENSIA\SQLExpress;Initial Catalog=DbName;Integrated Security=True"
> providerName="System.Data.SqlClient" />
>
> inside Load event,
>
> DAL.ConnectionString =
> ConfigurationManager.ConnectionStrings["Connectstring"].ConnectionString;
>
> private void DisplayLatestResources()
> {
> DAL.CreateCommand("sp_GetLatestFiveTrainingResourc es");
> DAL.ExecuteReader();
> SqlDataReader dr = DAL.DataReader;
> .....
> }
>
>
>
> Try supplying with user id and password, same result...also try using
> aspnet_regsql.exe, same result also...
>
> Thanks in advanced.
>
>
> den2005
>
>
> --
> MCP Year 2005, Philippines



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Reference, SQL Queries, SQL help ecoolone ASP .Net 0 01-03-2008 10:58 AM
SQL 2005 installation error, cannot start SQL Vicky MCITP 0 04-06-2007 06:36 PM
Cannot make a Web Reference to Web Service created (HTTP Endpoint) on SQL 2005 stored procedure tovbinm@gmail.com ASP .Net 0 05-21-2006 08:20 AM
Cannot get OUTPUT parameter after running Sql stored procedure MS ASP .Net 5 01-31-2005 08:09 AM
Browser cannot find any server anymore after 5 minutes of normal activity (" The page cannot be displayed ") reply@newsgroup.please Computer Support 6 01-05-2004 04:03 AM



Advertisments