Showing posts with label procedure. Show all posts
Showing posts with label procedure. Show all posts

Sunday, March 11, 2012

Connecting to DB Stored Proc with asp.net

I am used to using asp and i am trying to connect to a db and bring back a recordset from a stored procedure in asp.net, but I am getting the following error;

Server Error in '/' Application.

Object variable or With block variable not set.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:System.NullReferenceException: Object variable or With block variable not set.
Source Error:

Line 58: Line 59: qry = "AWS_RPT_WEB_MAGSUBSSTATS_PROC "Line 60: rs = dbConn.Execute(qry)Line 61: %>Line 62:

Source File:D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx Line:60
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.] Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +927 ASP._65_aspx.__RenderForm1(HtmlTextWriter __output, Control parameterContainer) in D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx:60 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +260 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241 ASP._65_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx:52 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241 System.Web.UI.Page.ProcessRequestMain() +1926

Check the following :

Whether the appropriate dll's for data provider such as System.Data.dll,System.Data.OracleClient.dll are added to the references.

And make sure your connection object has connectionString property

Make sure the connection is opened prior to execute statement

|||

...and have you properly created "dbConn"?

Wednesday, March 7, 2012

Connecting to a different stored procedure at runtime

Hello..
I am using Crystal Reports 10. Am running the report through some asp pages. The report is tied to a stored procedure at design time. Can I make the report connect to a different stored procedure at runtime? Both these stored procs have the same output in terms of columns. They differ only in the data.
Thanks,
ManishTry this
In your Application Use

CR.Database.tables(0)="SP Name"

Friday, February 24, 2012

connecting on SQL server database to another SQL server database

I am hoping to find a reference for the procedure on
connecting one SQL server database (SQLServerA) with
another SQL server database (SQLServerB) where SQLServerA
is in a different physical location and on a different
network from SQLServerB. In the past SQLServerA was an
Access database that used 'linked tables' to bring the
tables in from SQLServerB. I am hoping to recreate the
linked tables functionality on the SQL server. I'd
appreciate any websites or manuals,
Thanks,
Rachel"Rachel Gibson" <gibsora@.shands.ufl.edu> wrote in message
news:822201c40776$eba263c0$a601280a@.phx.gbl...
> I am hoping to find a reference for the procedure on
> connecting one SQL server database (SQLServerA) with
> another SQL server database (SQLServerB) where SQLServerA
> is in a different physical location and on a different
> network from SQLServerB. In the past SQLServerA was an
> Access database that used 'linked tables' to bring the
> tables in from SQLServerB. I am hoping to recreate the
> linked tables functionality on the SQL server. I'd
> appreciate any websites or manuals,
You can use Linked Servers to accomplish that, see BOL for more
instructions. Basically you can use EM to create the link or
sp_addlinkedserver.
Steve

Friday, February 17, 2012

Connecting a stored procedure to another server

I created a new stored procedure on one server because this is the only
server we can create new stored procedures on, however, all of my select
statements in this procedures are on a different server. How do I execute
this stored procedure on the other server, database, table, and login?Create a REMOTE Server or LINK Server, which you may not be able to do. You
can setup a Linked server to run under the context of one account.
"Ryan D" <RyanD@.discussions.microsoft.com> wrote in message
news:C749A1D6-F81F-4F50-8CDA-6681AF057BCD@.microsoft.com...
>I created a new stored procedure on one server because this is the only
> server we can create new stored procedures on, however, all of my select
> statements in this procedures are on a different server. How do I execute
> this stored procedure on the other server, database, table, and login?
>|||Andy,
I need the syntax for this please. Do you mean to use the
sp_addlinkedserver command? And then do I use the USE statement, followed b
y
the query?
"Andy Wilbourn" wrote:

> Create a REMOTE Server or LINK Server, which you may not be able to do. Yo
u
> can setup a Linked server to run under the context of one account.
> "Ryan D" <RyanD@.discussions.microsoft.com> wrote in message
> news:C749A1D6-F81F-4F50-8CDA-6681AF057BCD@.microsoft.com...
>
>|||Off the top of my head:
1. create a linked server.
2. change your select statements to have fully qualified names.
for example,
select colA, colB
from MyLinkServer.MyDatabase.dbo.MyTable
if you need to execute a stored procedure that exists on another server or
dynamic sql and it should run on that other server, exec
MyLinkServer.master.dbo.sp_executesql MySPName/@.SQL
Hope that helps,
Joe
"Ryan D" wrote:

> I created a new stored procedure on one server because this is the only
> server we can create new stored procedures on, however, all of my select
> statements in this procedures are on a different server. How do I execute
> this stored procedure on the other server, database, table, and login?
>

Tuesday, February 14, 2012

Connect with Access

Can someone point me in the right direction.. I want to connect to and call
either a procedure or function from accessYou can add a linked server to Access from SQL Server. For examples, see
sp_addlinkedserver, and sp_addlinkedsrvlogin in SQL Server Books Online.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Brian" <nixtootec@.hotmail.com> wrote in message
news:edIFt3k#DHA.2324@.tk2msftngp13.phx.gbl...
Can someone point me in the right direction.. I want to connect to and call
either a procedure or function from access

Connect with Access

Can someone point me in the right direction.. I want to connect to and call
either a procedure or function from accessYou can add a linked server to Access from SQL Server. For examples, see
sp_addlinkedserver, and sp_addlinkedsrvlogin in SQL Server Books Online.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Brian" <nixtootec@.hotmail.com> wrote in message
news:edIFt3k#DHA.2324@.tk2msftngp13.phx.gbl...
Can someone point me in the right direction.. I want to connect to and call
either a procedure or function from access