473,472 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
Sep 5 '06 #1
1 2561
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" <de*****@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...
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

Sep 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brad H McCollum | last post by:
I'm writing an application using VB 6.0 as the front-end GUI, and the MSDE version of SQL Server as the back-end (it's a program for a really small # of users --- less then 3-4). I'm trying to...
2
by: Jegg | last post by:
I wrote a web app using an ASP front end (not .NET) connecting to a SQL Server 2000 (no SP) back end. Both the web server and the database server are Windows 2003 boxes. The app was running fine...
0
by: Jim Sneeringer | last post by:
I have a GridView that loads correctly from a SQL table using a TableAdapter and stored procedures. However, when I try to delete from the GridView, I get "Procedure or Function 'EventDelete'...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
5
by: James Wong | last post by:
Hi, I am writing a vb.net2005 program that needs to create a stored procedure with SqlServerProject Template. Now, I have two questions for this stored procedure. 1) How can I import and...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
4
by: =?Utf-8?B?Unlhbg==?= | last post by:
1. How do i create a stored procedure in VB.Net and then execute it in VB.Net? 2. How do I modify a table property in VB.Net?
2
by: Neil | last post by:
I'm using Access 2000 with a SQL 7 back end. I recently implemented some code in a form's AfterUpdate event which calls a stored procedure which copies the contents of the current record to a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.