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

Discussion in 'ASP .Net' started by =?Utf-8?B?ZGVuIDIwMDU=?=, Sep 5, 2006.

  1. 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_GetLatestFiveTrainingResources");
    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
     
    =?Utf-8?B?ZGVuIDIwMDU=?=, Sep 5, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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_GetLatestFiveTrainingResources");
    > 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
     
    Cowboy \(Gregory A. Beamer\), Sep 5, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MS
    Replies:
    5
    Views:
    11,504
    Marc Scheuner [MVP ADSI]
    Jan 31, 2005
  2. =?Utf-8?B?Um9iIEM=?=
    Replies:
    0
    Views:
    584
    =?Utf-8?B?Um9iIEM=?=
    Apr 16, 2005
  3. Peri
    Replies:
    1
    Views:
    418
    Patrick Olurotimi Ige
    Jun 13, 2005
  4. Replies:
    0
    Views:
    422
  5. Mike P
    Replies:
    0
    Views:
    3,372
    Mike P
    Jun 19, 2006
Loading...

Share This Page