Connection To MS SQL From ASP Page
Apr 25, 2006
Can someone tell me why the following code isnt working .. i just want to connect and even read a database tuple to begin..the error i am gettin is as follows:
ADODB.Recordset error '800a0e7d'
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/MediaServer/test_connect.asp, line 23
----------------------------------------------------------------
<%
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.RecordSet")
objConn.Open "Driver={SQL Server};" & _
"Server=MEDIA1-47;" & _
"Database=pubs;" & _
"Uid=sa;" & _
"Pwd=12345;"
objRS.Open "Select * from authors"
objRS.close
objConn.close
set objRS = nothing
set objConn = nothing%>
View 1 Replies
ADVERTISEMENT
Dec 7, 2004
I am using an asp.net page with vb.net. The following connection in my web.config file will connect the database to my page no problem:
"Data Source=MIAPPS1;Initial Catalog=MASTER_DB;Integrated Security=SSPI;"
However, when I add data to the page and try to preview it in the browser I get the following error:
"System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
I'm kind of perplexed as to why I can attach a database to my page, test the connection view data -but not be able to connect when previewing through the browser.
Any Ideas?
Bill
View 3 Replies
View Related
May 31, 2005
Hi,
I'm getting a connection and then loosing my connection upon refreshing the browser with this script connecting to MSSQL using php, when trying the following:
PHP Code:
$connection = mssql_connect("127.0.0.1","test","") or
die("Could not connect mssql db on " .$config['dbhost']);
mssql_select_db("dbName") or
die("Could not select database " ."dbName");
Are their other ways to see more error handling in connecting to MSSQL
View 1 Replies
View Related
Jan 8, 2007
Hi!I have two servers, the web (with IIS - win2003) and the test dataserver (winXPpro with SQL Express)I'm trying to connect to the db but with no success...here is the connection string I'm using:sConn = "Driver=SQLNCLI;Server=marco-serverSQLEXPRESS;Database=grimp;Uid=grimpuser;Pwd=somePassword;"I get this:Microsoft OLE DB Provider for ODBC Drivers error '80004005'[Microsoft][ODBC Driver Manager] Data source name not found and nodefault driver specifiedI've tried also with Driver={SQL Native Client} but I get the sameerror.do I have to install something on the web server???
View 1 Replies
View Related
Apr 7, 2008
May I know how to connect a database writing a source code at html page, is it by using javascript?Because I need to use it for <ul> and <li> tag html to display the text from database. Can you please provide me same example by using this tag. Appreciate if anyone can help me to solve this, thanks
View 4 Replies
View Related
Dec 16, 2003
Dear i am using visual studio.net.......... when i connect database (in sqlserver) using sqldataAdapter with datagrid in visual basic.net every thing work properly........... but when i use the same in asp.net then i get an error message on the resultant explorer page give below.
Server Error in '/studentData' Application.
--------------------------------------------------------------------------------
Login failed for user 'RAMIZSARDARASPNET'.
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.Data.SqlClient.SqlException: Login failed for user 'RAMIZSARDARASPNET'.
Source Error:
Line 85: 'Put user code to initialize the page here
Line 86: Dim ds As New DataSet()
Line 87: SqlDataAdapter1.Fill(ds)
Line 88: DataGrid1.DataSource = ds.Tables(0)
Line 89: DataGrid1.DataBind()
Source File: c:inetpubwwwrootstudentDataWebForm1.aspx.vb Line: 87
Stack Trace:
[SqlException: Login failed for user 'RAMIZSARDARASPNET'.]
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
studentData.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootstudentDataWebForm1.aspx.vb:87
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Ramiz
View 1 Replies
View Related
Nov 11, 2015
I have created one reports but all the records are displaying on one page.find a solution to display the records page by page. I created the same report without group so the records are displaying in page by page.
View 3 Replies
View Related
Mar 26, 2008
If this post belongs somewhere else I appologize. I have spent several days trying to solve this problem with no luck. My site is online. Hosted at NeikoHosting. I can connect to the database remotely when adding a datacontrol. It tests fine. But when running the page it won't connect. Even if I go in and change the Web.Config connection string to a local Data Source provided to me by Neiko, it still won't work. It just won't connect. Here are the two connection strings in the Web.Config, minus my login info: Only the remote string will pass testing. Neither works on the site. <add name="yourchurchmychurchDBConnectionString" connectionString="Data Source=MSSQL2K-A;Initial Catalog=yourchurchmychurchDB;Persist Security Info=True;User ID=me;Password=pwd" providerName="System.Data.SqlClient" />
<add name="yourchurchmychurchDBConnectionString2" connectionString="Data Source=66.103.238.206;Initial Catalog=yourchurchmychurchDB;Persist Security Info=True;User ID=me;Password=pwd" providerName="System.Data.SqlClient" />
Here is the stack trace, if that helps.
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
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.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1131233
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.FormView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.FormView.EnsureDataBound() +163
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
So....... HELP!!!!
Thank you!
View 3 Replies
View Related
Dec 28, 2006
Creating a web application. Running a simple query "SELECT username FROM vwCustomer"
vwCustomer is a view built on top of an Access DB which is set up as a linked server. Within SQL Server that view responds immediately. But when I try to access it from an ASP page it takes over 20 seconds to respond.
Used the following to create the linked server:
EXEC sp_addlinkedserver 'DBName', 'Jet 4.0', 'Microsoft.Jet.OLEDB.4.0', 'c:databasesdatabase.mdb'
GO
EXEC sp_addlinkedsrvlogin 'DBName', FALSE, NULL, 'Admin', ''
GO
The view is simply(this works fine in SQL Server):
SELECT * FROM DBName.db.dbo.customer
The ASP page:
SELECT * FROM vwCustomer
Can anyone give me a hint as to where the bottleneck is? Or how I can figure that out using SQL Profiler or something?
Please help!
View 3 Replies
View Related
Oct 4, 2007
Hi all,
I have a production website at Godaddy and an ASP.net 2.0 page that successfull connects to a SQL 2005 instance provided by Godaddy using SQL authentication(User ID/Password). The Godaddy database has become too small (200MB limit) and the plan is to use the SQL Server 2005 standard edition at my office. In other words, I want to host my own SQL server and keep the front-end at Godaddy.
The ASP.net test page at Godaddy generates the basic connection errors when attempting to connect to my SQL server at the office. This error has several variations depending on how the connection string is configured:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
In this case the connection string is:
Data Source=xxx.xxx.xx.xxx,1433; Network Library=DBMSSOCN; Initial Catalog=Test; User ID=xxx; Password=xxx"
I've embedded this connection string directly into the ASP.net test page in order to make this page independent of the web.config file.
My MS SQL server is on a Small Bussiness Server 2003 with Sharepoint and Remote Workplace running, and this machine is behind a linksys router, and Routing and Remote Access is running in place of windows firewall.
I've openned ports TCP 1433 and UDP 1434 on the router and Routing and Remote Access. Telnet xxx.xxx.xxx.xxxx 1433 connects successfull, and the SQL log shows listening on 1433. I don't know if telnet is telling me that there is successful connection to the port on the router, or if it makes it all the way to the SQL server.
The SQL server is running the default instance MSSQLSERVER. Locally, I am able to connect using SQL 2005 Studio, and I am able to confirm this activity in the SQL log. Since I've openned port 1433, I also see numerous dictionary attacks in the SQL Log. Based on this, remote connectivity is there.
The strange observation is that the SQL log shows no sign of a connection attempt from the ASP.net page. The connection appears to be failing before it reaches the SQL server. I've openned ports in the Linksys router and the NAT/Firewall the same way I've openned them for Sharepoint and Remote Workplace.
I also found that when I move the ASP.net test page to another ISP, then the SQL connection that worked from the Godaddy website, is no longer able to connect. An explanation of this would also be very helpful to me.
Is there something that needs to be configured to expose the SQL server to ASP.net pages that is different from remote access?
Does IIS need to somehow be involved?
Is there something in Small Business Server 2003 that could be interferring with ASP.net page requests to the SQL server?
Do I need to run my machine as a web server to make this work?
Any help with this configuration would be greatly appreciated.
View 9 Replies
View Related
Nov 28, 2006
Hello I have a project that uses a large number of MS Data access pages created in Access 2003 and runs on MS SQL2005.
When I am on lets say my client, (first page in a series) data access page and I have completed the fields in the (DAP), I am directing my users to the next step of the registration process by means of a hyperlink to another Data access page in the same web but in a linked or sometimes different table.
I need to pass data entered /created on the first page to the next page and populate the next page with some data from the first page / table. (like staying on the client name and ID when i go to the next page)
I also need the first data access page to open and display a blank or new record. Not an existing record. I will also be looking to creata a drop down box as a record selector.
Any pointers in the right direction would be appreciated.
I am some what new to data access pages so a walk through would be nice but anything you got is welcome. Thanks Peter€¦
View 2 Replies
View Related
Oct 16, 2006
The following objects are placed on the Report body of the Report pane of SQL Server 2005 Reporting Services :
<textbox: expression1>
<textbox: expression2>
<table:table1 with at least 30 columns and 30 expressions>
<textbox: string1> - considered as the Title in the Footer section of the report
<texbox:string2> <textbox:expression3>
<textbox:string3> <textbox:expression4>
<textbox:string4> <textbox:expression5>
<textbox:expression6>
I can't find any explanation why is it string1 and string 2 of the footer section of my report displayed separately from the expression3 which is aligned on it and the rest of the object on the second page.
The expected design is that all Footer items should be displayed together of whether it is placed on the first page or on the last page.
As a workaround of this, I converted string 1 into an expression (Added = and enclosed the string with double quote).. As a result, all of the items in the Footer section are now placed together on the last page of the report.
I also remember one of the issue I encountered before where the Footer items where placed together on the first page and still have space at the bottom of the page, but then expression 6 is forced to display (alone) on the last page of my report.
I can't find any discussion related to this, I wish somebody could give me an idea why RS behaved like this.
Thanks in advance
View 1 Replies
View Related
Feb 14, 2008
Fit an intere table in same page without page break for save the excel export.
My table has a Group for order my dates.
I need to have the intere table in the same page, i don't care about blank space at the end of the page.
I can't use the page break beacuse i need an excel export in a unique sheet..
I have tested.. every page break..you'll have a different sheet in your excel export
I need something like this
page 1
Zone
1
2
3
4
5
6
7
7
8
9
..
page 2
Zone
1
2
3
4
5
6
7
7
8
9
..
but an unique sheet in the excel export
View 4 Replies
View Related
Jul 17, 2007
Hello,
If I have a report that includes a page header, the report viewer will render the report at the full width, but if I hide the page header and show only the body it will use the absolute width of the report.
I have a 7" wide report, with .75" borders set on each side.
Interactive & Print size are set to 8.5x11
Changing these sizes has no effect on the behavior of the viewer, which appears to ignore them.
When I view this report in the local viewer the contents fill the window if there is no page header.
If I enable the page header then the report is drawn at 8.5" wide, leaving a _big_ white border on the right side.
Any comments or workarounds that anyone knows? I know the local viewer is not a standard configuration (at least it seems) but it is what we need to use.Thanks,//Andrew
View 1 Replies
View Related
Sep 21, 2006
Hi, I wanted to know that can we access a webpagefrom a store procedure in sql server 2000 like we run a exe file from sql server. Bye.
View 1 Replies
View Related
Jul 20, 2007
Hi,
I issued this command on Tempdb but it doesnot shrink the file.
dbcc shrinkfile (tempdev_3,1)
go
Messages:
-----------------------------------------------------------------------------------------------------------
DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.
-----------------------------------------------------------------------------------------------------------------------------------------------
I have checked that there are no tables associated with any user in tempdb. Any help is appreciated.
Regards,
Razi
View 15 Replies
View Related
Apr 16, 2007
How can I print a field that is in the dataset on each page? I added a textbox in the Page Header and use =Fields!ProjectName.value in the value property. I got an error "Fields cannot used in page header and footer."
How can I have the table header shows on each page? Currently if the data goes to the second page, there is no table header.
Thanks.
DanYeung
View 8 Replies
View Related
May 26, 2008
Hi Team,
When i view the Report from SSRS Report preview Tab it's working fine, But when i deploy that and try to view in the IE
I am seeing the Body background color in between the image and page border of the page footer how to solve that?
View 1 Replies
View Related
May 16, 2008
Hi All,
In my SSRS report. I have a report which has only one page. In preview it is showing as only 1 page but when I am printing the report. I am getting two printouts with the second page as a blank.. Please help me in printing the page that contains report. Intially I used a Page header, at that it used to print the blank page with a header only. Now as I removed the header it is printing the page without header i.e Blank Page.. So please help me in prinitng a single page that has the report. It is urgent,..
Thanks
dotnetdev1
View 5 Replies
View Related
May 7, 2015
I have a report with multiple tables. I need to show each tables in different pages. When there is no data for tables/tables , it is coming with the next table which has data. I have given "Add a page break after" option in the tablix but still the tables are coming together when no data available. How can I show it in different page?
View 2 Replies
View Related
Mar 12, 2015
I have a report with tablix. when tablix returns no rows Footer is coming all the way up . How to display the footer at the bottom of the page all time.
View 0 Replies
View Related
Nov 11, 2015
How do I add a hard page break in the middle of a two page report? I use Microsoft reports for windows.
View 5 Replies
View Related
Apr 15, 2008
In SRSS 2005 (SP2) my page header seems to take up the same amount of space on the
1st page it would take if it were to print; I have PRINT ON FIRST PAGE set to
false - the header doesn't print - it just leaves the same amount of space.
How do you get the report to ignore that. I do have a report header built
into the body of my report. I have tested this by increasing the size of my
page header and it does move the report up or down on the 1st page by that
amount.
View 8 Replies
View Related
Jan 23, 2008
I'm hoping that someone can shed some light on this for me... I'm using SSRS SP2 and I have a basic report using a single list object which, at the moment, should print only two pages based on the results of the underlying query. When previewing the report, it shows the two pages. But when the report is printed or exported, there is a blank page before each report page.
What I've done so far:
1) Verified the properties of the list object and made sure that 'Insert a page break before this list' is not checked
2) Ensured that there are no hidden objects that could be causing this behavior
3) Ensured that the report size + margins are within the boudaries of an standard 8.5x11 paper size
Any suggestions on something that would solve this issue?
Sam
View 6 Replies
View Related
Sep 28, 2015
I am running a DBCC SHRINKFILE on "FILE1" of a database (it has fileid = 1)...intent is to remove 70GB of file space:
DBCC SHRINKFILE (N'FILE1' , 400000).
For the SPID that's doing the shrink, In activity monitor you can see:
Waittype: PAGEIOLATCH_EX on resource: 9:3:15411328
(the DB is dbid=9)
But why does it need a page from fileid=3? Are there page dependencies between files that prevent moving a page within a given file? Does it need that fileid3 page to come along?
Its just sitting there in the SUSPENDED state for the last hour....I am going to leave it another 5 hours or so before cancelling.
The dm_exec_requests has an estimated percent complete at 83% and holding....not sure if I can believe that.
View 6 Replies
View Related
Nov 13, 2007
Hi all
I have a problem which I am really struggling with. I have a report that normally spreads over three pages. We have a list setup so that for each customer it picks up fees and expenses and displays it in sections. We have a page break after FEES so that expenses start on a new page. FEES and expenses are tables.
We need to have a page footer set for the bottom of the report but to appear on the first page only per customer. I.e. we do not want it showing on the EXPENSE pages. We have played with the IIF command but can not seem to print htis per customer only by using global variables.
=IIf(Globals!PageNumber=1,"(Please note 30 day invoice period)
The example above however only prints on the first page of the entire report. So if three customers appear then this will only appear for the first customer and I have a feeling I may not be able to link this to list.
If I can not use a page break and enter this into the list then I have a problem with the text field moving up and down depending on the size of the FEE section. For example if 5 fees are brought back then the text field will be lower then a customer that has only 2 fees.
I after a solution that can either allow my page fotter to appear every time a new customer appears on a page and hiddern for the sub sheets. Or the ability to allow my text field to start at a fixed position on my report. Has anyone had a similar issue.
thank you
Michael
View 3 Replies
View Related
Jan 23, 2008
Hi:
I made a report that is 10 pages long. I like to show all the data in one page (after deployment). Any idea if this is possible?
View 8 Replies
View Related
Feb 27, 2008
Hi - I am pretty new to Reporting Services. I need to create a report where a single result row from the Select Statement populates an entire page of data. The regular grid or Matrix reports don't fit this need. Is there a simple way to do this?
Thanks - Dave
View 4 Replies
View Related
Apr 3, 2006
Is it possible to force the content of the page footer to always display at the bottom of a report? I have a report that shows customer orders. It has its interactive height set to 5 inches. There is one customer order per report page. Most of the reports don't require 5 vertical inches (but some do).
How can I make sure that the stuff in the page footer (date, page number, etc.) always gets rendered in the same position for each report? Currently, the page footer follows the last detail line so the footer information sometimes is only midway down the report page.
Thanks.
BCB
View 4 Replies
View Related
Jan 27, 2004
Hi
I would like to know if there is some way to find a row in a table by the RID that sp_lock returns :
for example
"SELECT * FROM Authors (UPDLOCK) WHERE name = 'John'"
sp_lock returns the locked row id :
2:328:11 (file#page#slot on page)
How do i get this row???
Thanks
PB
View 3 Replies
View Related
Mar 31, 2007
hi i am very concerned about this problem in my report.
to solve this problem i increased the height of page footer,blank page vanishes but the page footer is not printing on every page,it is only printing on 1 st page .
i am having probelm because the records from the dataset are more than the page limit , page break is there but no footer is printing on the second page only blank space is there.
can u please help me out from this problem??
View 1 Replies
View Related
Sep 14, 2007
can i use 'page number' and 'total pages' outside the page header and page footer?
View 1 Replies
View Related
Nov 26, 2007
I think I know the answer but I have a report that is supposed to print in Ledger. It has a header that has report information on the left and on the right has page count and date run. When the user resizes the page to letter, only the first part of the header shows (left piece with report information). Instead of resizing the header it seems it truncates it. Is there a way to resize it. If I move the right side over it looks centered on the Ledger size.
View 1 Replies
View Related