Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Friday, March 30, 2012

help- how to retrive image from sql server 2000 database

hi,
i m use asp.net 1.1.

i want to retrive image or picture from sql server 2000 database.

what should i do?

plz give "sample code" and solution.

it's urgent.

thanks in advanceone more thing,

i want to put that retrived image into asp.net's "image web control".

what should i do?
give solution.

thanks one's again.

Friday, March 23, 2012

Help creating a Transact SQL Insert Statement

Hi there can anyone help me to create a SQL Insert Statement. I dont know SQL at all.

To explain, I have two web pages. search.asp and results.asp.

search.asp has the following.

Form Name: searchForm
Set to: Post
Action: results.asp
Text Field: Keyword
Drop Down: CategoryTable
Drop Down: Location
UserName Session Variable: MM_UserName

results.asp has the following SQL which pulls all the results.

SELECT SupplierName, Location, ShortDescription, TimberSpecies, CategoryTitle, Country, CustomerType
FROM Query1
WHERE TimberSpecies LIKE '%MMColParam%' AND CategoryTitle LIKE '%MMColParam2%' AND Location LIKE '%MMColParam3%' AND CustomerType = 'Trade/Retail'
ORDER BY CategoryTitle, TimberSpecies ASC

The database & form I want to insert into.

tblSearcheResults
idSearch (AutoNumber)
location (Text) "Want to insert the 'Location' result here"
category (Text) "Want to insert the 'CategoryTable' result here"
user (Text) "Want to insert the UserName Session Variable result here"
result (Text) "Want to insert the 'Keyword' result here"

Please ask if u need more info.

Mally

Hi,

INSERT INTO tblSearchResults
(
location,
category,
user,
result
)
VALUES
(
Location, --should be due to the POST action in Request.Form("Location")
category, --should be due to the POST action in Request.Form("category")
user, --should be due to the POST action in Session("MM_UserName")
keyword, --should be due to the POST action in Request.Form("keyword")
)

Variable have to be read first and the query string to be constructed before sending it to SQL Server, keep in mind that you have to quote the string while composing the SQL String.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

Help connecting to SQLEXPRESS using asp.net

WE have just upgraded our database from sql 2000 to sql express.
Nowthe asp.net code doesn't work. I tried many different things, no
luck. Please help! thanks very much.
Here is the connection code:
conn = New SqlConnection( "Server=xxx.xxx.net,1433; UID=User;
PWD=lxxx2007;Database=mssql3" )
strSelect = " Select * from dbo.New_Broker_Table INNER JOIN
dbo.UserList ON dbo.New_Broker_Table.Broker_ID = dbo.UserList.Broker_ID WHERE dbo.UserList.User_ID =@.userID "
cmdSelect = New SqlCommand( strSelect, conn )
cmdSelect.Parameters.Add( "@.userID", session("userid") )
conn.Open()
dtrEmployee = cmdSelect.ExecuteReader( CommandBehavior.SingleRow )
i keep getting the SQL Server does not exist or access denied error.If you are trying to connect remotely, then the problem could be that SQL
Server Express installs by default with disabled remote connections. Here is
an article that outlines the steps to allow remote connections, as well as
setting up exception in the firewall and starting the SQL Server Browser
service, which could be the problem too:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
Next is to check the correct server instance. By default SQL Server Express
installs under a named instance SQLEXPRESS, so you may need to add that to
the Server parameter in your connection string. You can also remove the hard
coded port number in the connection string.
If all that fails then you can see some good connectivity troubleshooting
steps here:
http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||Addition to Plamen's msg.
You receive a "SQL Server does not exist or access denied" error message
when you try to connect to a SQL Server named instance in a cluster by using
TCP/IP sockets:
http://support.microsoft.com/kb/888228/en-us
--
Ekrem Önsoy
http://www.ekremonsoy.net , http://ekremonsoy.blogspot.com
MCBDA, MCITP:DBA, MCSD.Net, MCSE, MCBMSP, MCT
<lytung@.gmail.com> wrote in message
news:1193969000.898641.140040@.e9g2000prf.googlegroups.com...
> WE have just upgraded our database from sql 2000 to sql express.
> Nowthe asp.net code doesn't work. I tried many different things, no
> luck. Please help! thanks very much.
> Here is the connection code:
> conn = New SqlConnection( "Server=xxx.xxx.net,1433; UID=User;
> PWD=lxxx2007;Database=mssql3" )
> strSelect = " Select * from dbo.New_Broker_Table INNER JOIN
> dbo.UserList ON dbo.New_Broker_Table.Broker_ID => dbo.UserList.Broker_ID WHERE dbo.UserList.User_ID =@.userID "
> cmdSelect = New SqlCommand( strSelect, conn )
> cmdSelect.Parameters.Add( "@.userID", session("userid") )
> conn.Open()
> dtrEmployee = cmdSelect.ExecuteReader( CommandBehavior.SingleRow )
> i keep getting the SQL Server does not exist or access denied error.
>

Help connecting pages which has Database connection.

I am a completely new asp.net / SQL server user.
I've been only working with PHP + MYSQL server before which is very different.

There are databases which come with the SQLserver, such as "master"
and there are databases which i create by my own.

When using "master" database, everything works fine.
here's a screenshot.
http://img528.imageshack.us/img528/57/d1if7.jpg

but when using database which i created by my own, i get an error
whether i use ip or localhost.
http://img513.imageshack.us/img513/4598/d2iz7.jpg

only when i use the debugger, it gives me some port, then i am able to connect but only using localhost... therefore i can't give the adress to anyone else.
http://img528.imageshack.us/img528/3394/d3jn6.jpg

What's the difference between the Built in databases and those i create?
how can i make that i could access pages which has database connection to databases i created by my own??

Sorry for my English, i know it's not really understandable.Anyone? it seems like something which everyone who uses asp.net with sql server for a while should know.
ty.

Help configuring database to work as intended

Hello everyone, I have created my web application in VS 2005 using asp.net 2.0 and the built in sql .mdf database creater that comes with visual studio. After I developed my website, I then wanted to move it to one of our servers on the network, which I did without a problem. The website works fine but here is my challange. I need users to be able to connect to the database via login script and the script inserts computer data into the database. So I figured I need to attach the Database to SQL Server 2005. When I try to do this it gives me this database is in use. So I stop the website in IIS, and it allows me to add the database into the SQL Server. Once I do this, and start the website again, the website no longer works and I get a bunch of database errors, that do not get fixed untill I re-copy the website to the server.

Is there a way to just connect to a .mdf file on the network that is not attached to a sql server, through a connection string in a login script? Maybe there is something else I need to do to the database before copying to the server? Or should I re-programm the website with a newly created database in SQL Server, and use that as the datasource?

There is no need to stop the webserver to copy or attach the database. to attach the database bring the particular database to offline and copy the mdf and ldf as per u r required location.

Thank u

Baba

Please remember to click "Mark as Answer" on this post if it helped you.

|||

Ok but then why, when I attach the database to a SQL Server, and try to run the website again, it no longer works? It gives me a bunch of database errors that basiaclly come down to, the database is already open.

|||

Hi,

using asp.net 2.0 and the built in sql .mdf datab

From your description, it seems that you want to move the mdf file in SQLExpress to SQLServer2005, right?

If so, I suggest that you can use aspnet_regsql tool to achieve that. The ASP.NET SQL Server Registration tool is used to create a Microsoft SQL Server database for use by the SQL Server providers in ASP.NET, or to add or remove options from an existing database. The Aspnet_regsql.exe file is located in the [drive:]\%windir%\Microsoft.NET\Framework\version folder on your Web server.

You can give the option '-d' to specify the name of the database to create or modify for use with application services. If the database is not specified, the default database name of "aspnetdb" is used.

For details, see:http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx

Thanks.

sql

Help calling DTS package.

I'm new to using DTS packages and I'm running into a problem. Hopefully someone can help me out. I have an ASP.NET page that needs to call a DTS package. Everything seems to be working right up until I call opkg.Execute. The package seems to run but nothing happens. After further investigation I have found what looks like a permissions issue. this is the message I'm getting"
Error Number:
-2147467259 {Integer}

Error Description:
"The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data." {String}

This is obviously a permissions issue. I'm just not sure who the DTS package is running as and where to set the permissions.

Any ideas??

ThanksAfter a few modifications I'm getting a different error now. But it still is obviously a permissions problem. Everything I've read says set Impersonation equal to true. Unfortunately it already is. Any suggestions from you SQL Server gurus?

"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."

Thankssql

Monday, March 19, 2012

Help : ASP var at SQL line

Hi,

I try to insert the date parameter on SQL line.
The date parameter is on ASP var declares.

I'm working with the page that have listbox, and gridview bound to msaccess.
when the user select thelistbox with other value, the page will reload.
while the page reload on server, it carry the variable that should insert on sql line,
for displaying the difference gridview records result.
So I have dynamic gridview records base on my listbox.

But, ... the page doesn't load well from the beginning. Doesn't work at all !!

I declare this at the page load.

Dim StartProjectAsString ="1/1/1996"

Sub ProjectListBox_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs EventArgs)Handles PYear.SelectedIndexChanged
StartProject = PYear.SelectedValue.ToString
EndSub

The object "Pyear" is listbox :

<asp:ListBoxID="PYear"runat="server"Rows="12"CssClass="tb01"SelectionMode="Single"AutoPostBack="True">
<asp:ListItemValue="1/1/1991">1991-1995</asp:ListItem>
<asp:ListItemValue="1/1/1996"Selected="True">1996-2000</asp:ListItem>
<asp:ListItemValue="1/1/2001">2001-2005</asp:ListItem>
<asp:ListItemValue="1/1/2006">2006-2010</asp:ListItem>
<asp:ListItemValue="1/1/2011">2011-2015</asp:ListItem>
</asp:ListBox>

And the datasource for bound to gridview is

<asp:AccessDataSourceID="AccessDataSource1"runat="server"DataFile="~/App_Data/general.mdb"
SelectCommand='SELECT TBL_PROJECT.NAMEPROJECT AS Name, TBL_PROJECT.STARTPROJECT AS Start, TBL_PROJECT.ENDPROJECT AS Finish, TBL_PROJECT.JOBNO AS JobNo, TBL_PROJECT.CLIENT AS Client, TBL_PROJECT.BUILDING AS Building, TBL_PROJECT.CODEPROJECT AS Code, TBL_PROJECT.IDPROJECT AS IDPROJECT FROM TBL_PROJECT WHERE TBL_PROJECT.STARTPROJECT >= DateValue("<%=StartProject%>") And TBL_PROJECT.STARTPROJECT < DateValue("1/1/2001");'>
</asp:AccessDataSource>

It will return the error page regarding the ASP : StartProject.
If I change the variable with the string "1/1/1996" :

'SELECT TBL_PROJECT.NAMEPROJECT AS Name, TBL_PROJECT.STARTPROJECT AS Start, TBL_PROJECT.ENDPROJECT AS Finish, TBL_PROJECT.JOBNO AS JobNo, TBL_PROJECT.CLIENT AS Client, TBL_PROJECT.BUILDING AS Building, TBL_PROJECT.CODEPROJECT AS Code, TBL_PROJECT.IDPROJECT AS IDPROJECT FROM TBL_PROJECT WHERE TBL_PROJECT.STARTPROJECT >= DateValue("1/1/1996") And TBL_PROJECT.STARTPROJECT < DateValue("1/1/2001");

it will work fine, but I will miss my dynamic gridview, right ?

So, please ... help me ...

Thank you ...

The answer :

http://forums.asp.net/t/1110547.aspx

Monday, March 12, 2012

HELP ! Login failed for user MachineName\ASPNET

Hi,

I am new to ASP.NET and have an ever approaching deadline to develop a database driven web application. Having read a lot of articles on the Internet I decided on Visual Studio 2003, MSSQL Server 2000 Developer Edition, all running off Windowns XP Pro.

I cannot get the ASP to access the database, I keep getting the following message

System.Data.SqlClient.SqlException: Login failed for user 'MachineName\ASPNET'

I do not know what to do to sort this problem and I cannot test anything I have developed as a result. I am very desperate for help as I have been trying to sort this out for the last 5 days.

Somebody please please please help me!!!!!!!!!

Thank you if you can.

RW#1
install Connector/ODBC - MySQL ODBC driver
http://dev.mysql.com/downloads/

#2
check out Connector/ODBC Programmer's Reference Manual
http://www.mysql.com/search/?q=myodbc

#3
Here is my code to populate a datagrid from a mySQL database.

IN GLOBAL.ASAX
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
'Create Database Connection String
Dim globalConnStr As String
globalConnStr = "driver={MySQL ODBC 3.51 Driver};"
globalConnStr = globalConnStr + "server=localhost;"
globalConnStr = globalConnStr + "port=3306;"
globalConnStr = globalConnStr + "Stmt=;"
globalConnStr = globalConnStr + "uid=root;"
globalConnStr = globalConnStr + "pwd=;"
globalConnStr = globalConnStr + "database=smfr_wildland;"
globalConnStr = globalConnStr + "Option=3;"

'Assign Database Connection String To
'global connection object
Application("globalConnStr") = globalConnStr
End Sub

in your code behind page that contains a datagrid...It should look KINDA like this.

Dim strSQL As New System.Text.StringBuilder
strSQL.Append("SELECT users.*,smfr_shifts.shift_name")
strSQL.Append(" FROM users")
strSQL.Append(" INNER JOIN smfr_shifts ON users.user_shift_id = smfr_shifts.shift_id")
strSQL.Append(" WHERE users.user_deploymentYN = " & x)
strSQL.Append(" ORDER BY users.user_deploymentYN DESC , users.user_sort;")

Dim DBConn As System.Data.Odbc.OdbcConnection
Dim DBCommand As System.Data.Odbc.OdbcDataAdapter

Dim DSPageData As New DataSet
DBConn = New System.Data.Odbc.OdbcConnection(Application.Item("globalConnStr"))
DBCommand = New System.Data.Odbc.OdbcDataAdapter(strSQL.ToString, DBConn)

DBCommand.Fill(DSPageData, "users")

dgTeam.DataSource = DSPageData.Tables("users").DefaultView

dgTeam.DataBind()

'Close and Clean-Up
DBConn.Close()
DBConn.Dispose()
DBConn = Nothing

DBCommand.Dispose()
DBCommand = Nothing

DSPageData.Dispose()
DSPageData.Clear()
DSPageData = Nothing

-------
NO System.Data.SqlClient
USE System.Data.Odbc

Hope this helps?

Tom|||Ralph,

If you are indeed using Microsoft SQL Server, then your code should be OK. You've posted in the MySQL section.

What you need to do is add the MACHINENAME\ASPNET user as a Login in your database, and give that user rights to the database objects it needs.

When an ASP.NET application trys to access your SQL Server database, it does so by using that account.

[now moved from MySQL forum to SQL Server forum]|||A few important remarks:
1. ASPNET will only work on W2K and Windows XP, not on Windows Server 2003 where the identity of the application pool will be used instead (network service account).
2. Even if yo'ure on W2K, the ASPNET user can be bypassed if you're using (Windows authentication with) impersonation or you've changed the processModel section; in that case, use that user account on SQL Server instead to give permissions to.
3. However, a big fat remark: if you grant ASPNET or NETWORK SERVICE rights to the database, every other service/application running in that identity's context will have rights on the database as well. On a hosted environment where others can upload code to the machine as well, this is a big big security leak since others can write code to mess up your database. If you still need to do this, consider to give the user only read rights on the database!
4. It would be better from this side of the picture to use SQL authentication instead, although the password is not encrypted then when it's sent to the server. This is a less "heavy" issue if SQL Server is running on the same box as the web server (definitely not a scalable solution, but still it's out there in many places) or when the server environment is heavy controlled (a switched network between the servers).
5. Another approach is to impersonate as a certain identity from within the code whenever you want to talk to the database and to undo that impersonation afterward, as shown on my blog intip 7.

In any case, try to lock down the number of users that can access the database as much as you can by creating separate users on the level of the database for each database (which has only rights on that database). Never ever connect in a lazy way (e.g. using a sysadmin user).|||I did not read the posting close enough...it was in the mySQL group when I read it and replied.

MONITOR...you may delete/remove my two post for this discussion...SORRY

Tom|||Put this into a text file called grantpermission.sql. Change the 'MachineName\ASPNET' to your computer name and change Use dbname to your database name. Then use SQL Query Analyzer and execute the code to add the user and grant permissions. ASPNET will become owner as you can see in the code. This assumes that you have everything installed correctly. I have the almost the exact same setup. Although I'm also using WebMatrix. SQL Desktop Edition on Win XP Pro.

-- Begin --
DECLARE @.username sysname
SELECT @.username = 'MachineName\ASPNET'

USE master
EXEC sp_grantlogin @.username

USE dbname
EXEC sp_grantdbaccess @.username
EXEC sp_addrolemember N'db_owner', @.username
-- End --

Friday, March 9, 2012

Help - Simple DataGrid Problem in Vis. Studio 2003

Hi,
As a relative newbie to SQL Server/ASP.NET I'm hoping someone here
can help with my problem. I'm developing a timesheet application in
ASP.NET C# using Visual Studio 2003 with a database built in MSDE.
One of my forms needs to return a simple list of resources from my
database. I have followed the guide on the MSDN libraries, but for
some reason I continuously get the same error message.
What I've done so far is Create the database, tables, and populate
with some sample data using using Server Explorer in Visual Studio. I
have
connected to the database (using integrated security) and I am
trying to get the contents of the Resource table to appear on my
form. I have then created a DataAdapter (tested the connection, set
the SQL as a simple SELECT * from Resource, etc), which also generates
an sqlConnection for me. To test this I have previewed the generated
data, and it returns what I want, so I
have chosen to generate a DataSet of this. I am then trying to get
this data into a simple DataGrid. On the properties of the DataGrid
I have changed the DataSource to point at my Dataset. As I
understand it, I then have to add the following to my Page Load
section of my code.
sqlConnection1.Open();
this.sqlDataAdapter1.Fill(this.dsResource);
sqlConnection1.Close();
The form builds fine, but when I browse to the particular form I get
the following error for the sqlConnection1.Open(); line
Exception Details: System.Data.SqlClient.SqlException: Cannot open
database requested in login 'SCMS'. Login fails. Login failed for
user 'AL-NOTEPAD\ASPNET'.
To me this is an error with my connection string. My database
instance is actually 'AL-NOTEPAD\VSDOTNET'. However the properties
for sqlConnection1 are pointing to the correct datasource. I do not
know why the application is looking for user 'AL-NOTEPAD\ASPNET'. It
does not exist, to my knowledge.
Any help with this would be greatly appreciated, as I get the same
error with my code for forms-based login...
Thanks in advance..thebison (alex.sinclair3@.btinternet.com) writes:
> The form builds fine, but when I browse to the particular form I get
> the following error for the sqlConnection1.Open(); line
> Exception Details: System.Data.SqlClient.SqlException: Cannot open
> database requested in login 'SCMS'. Login fails. Login failed for
> user 'AL-NOTEPAD\ASPNET'.
> To me this is an error with my connection string. My database
> instance is actually 'AL-NOTEPAD\VSDOTNET'. However the properties
> for sqlConnection1 are pointing to the correct datasource. I do not
> know why the application is looking for user 'AL-NOTEPAD\ASPNET'. It
> does not exist, to my knowledge.
I guess that's why the login fails. :-)
I believe this has to do with that IIS runs the in a context of a pre-
defined user, and IIS the tries to log in with integrated security,
but the ASPNET user have not been granted access to the database.
But you are probably better off asking in a newsgroup about ASP .Net.
At least I know very little about ASP .Net.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, February 27, 2012

Help - how to open Report in new browser window?

Hello...
I am struggling with this...but I am getting close.
I am trying to use the Web Service programming interface from my ASP.Net
application. What I am trying to accomplish...is to allow the user to set
some report parameters (date ranges, zip codes, etc). When the user presses
the Run button on my ASP.Net page, I would like to render the report in a new
browser window/page, and with the Toolbar so the user could export to
whatever format that they want. Is this possible?
Thanks for any help...
- DW
The code I am using now is the following..
Dim rptIRIS As Byte() = Nothing
Dim rsIRIS As Secure_SQLRS.ReportingService = New
Secure_SQLRS.ReportingService
rsIRIS.Credentials = New System.Net.NetworkCredential("ME", "Pwd",
"Domain")
rsIRIS.PreAuthenticate = True
Dim rptPath As String = "/WebReports/UserLabels"
Dim rptFormat As String = "HTML4.0"
Dim rptViewerInfo As String = "<DeviceInfo>" & _
"<Toolbar>true</Toolbar>" & _
"<Parameters>false</Parameters>" & _
"<DocMap>true</DocMap>" & _
"<Zoom>100</Zoom>" & _
"</DeviceInfo>"
Dim rptParams(1) As Secure_SQLRS.ParameterValue
Dim paramValue As Secure_SQLRS.ParameterValue = New
Secure_SQLRS.ParameterValue
paramValue.Name = "ProductID"
paramValue.Value = "102"
rptParams(0) = paramValue
paramValue = New Secure_SQLRS.ParameterValue
paramValue.Name = "ZipCode"
paramValue.Value = "12345"
rptParams(1) = paramValue
Dim rptHistoryID As String = Nothing
Dim credentials() As Secure_SQLRS.DataSourceCredentials = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings() As Secure_SQLRS.Warning = Nothing
Dim rptHistoryParams() As Secure_SQLRS.ParameterValue = Nothing
Dim streamIDs() As String = Nothing
Dim rptSessionHdr As Secure_SQLRS.SessionHeader = New
Secure_SQLRS.SessionHeader
rsIRIS.SessionHeaderValue = rptSessionHdr
Try
' execute the report
rptIRIS = rsIRIS.Render(rptPath, rptFormat, rptHistoryID,
rptViewerInfo, rptParams, credentials, _
showHideToggle, encoding, mimeType, rptHistoryParams,
warnings, streamIDs)
rptSessionHdr.SessionId = rsIRIS.SessionHeaderValue.SessionId
Response.Clear()
' set the http headers for the PDF response
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
HttpContext.Current.Response.AppendHeader("Content-Disposition", _
"filename=""AddressLabels.HTM""")
' send the byte array containing the report as a binary response
HttpContext.Current.Response.BinaryWrite(rptIRIS)
HttpContext.Current.Response.End()
Catch ex As Exception
Finally
End TryYou won't be able to accomplish this with straight SOAP interfaces. You will
have to use a combination of Web service calls to list the reports in the
namespace and then a URL request to the server that includes the
parameterized URL for the report. You can certainly open it in a new browser
window under those conditions.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"dw" <dw@.discussions.microsoft.com> wrote in message
news:08CC0691-B2A2-4F4C-A1DA-7DAB23E67F20@.microsoft.com...
> Hello...
> I am struggling with this...but I am getting close.
> I am trying to use the Web Service programming interface from my ASP.Net
> application. What I am trying to accomplish...is to allow the user to set
> some report parameters (date ranges, zip codes, etc). When the user
presses
> the Run button on my ASP.Net page, I would like to render the report in a
new
> browser window/page, and with the Toolbar so the user could export to
> whatever format that they want. Is this possible?
> Thanks for any help...
> - DW
> The code I am using now is the following..
> Dim rptIRIS As Byte() = Nothing
> Dim rsIRIS As Secure_SQLRS.ReportingService = New
> Secure_SQLRS.ReportingService
> rsIRIS.Credentials = New System.Net.NetworkCredential("ME", "Pwd",
> "Domain")
> rsIRIS.PreAuthenticate = True
> Dim rptPath As String = "/WebReports/UserLabels"
> Dim rptFormat As String = "HTML4.0"
> Dim rptViewerInfo As String = "<DeviceInfo>" & _
> "<Toolbar>true</Toolbar>" & _
> "<Parameters>false</Parameters>" & _
> "<DocMap>true</DocMap>" & _
> "<Zoom>100</Zoom>" & _
> "</DeviceInfo>"
>
> Dim rptParams(1) As Secure_SQLRS.ParameterValue
> Dim paramValue As Secure_SQLRS.ParameterValue = New
> Secure_SQLRS.ParameterValue
> paramValue.Name = "ProductID"
> paramValue.Value = "102"
> rptParams(0) = paramValue
> paramValue = New Secure_SQLRS.ParameterValue
> paramValue.Name = "ZipCode"
> paramValue.Value = "12345"
> rptParams(1) = paramValue
> Dim rptHistoryID As String = Nothing
> Dim credentials() As Secure_SQLRS.DataSourceCredentials = Nothing
> Dim showHideToggle As String = Nothing
> Dim encoding As String
> Dim mimeType As String
> Dim warnings() As Secure_SQLRS.Warning = Nothing
> Dim rptHistoryParams() As Secure_SQLRS.ParameterValue = Nothing
> Dim streamIDs() As String = Nothing
> Dim rptSessionHdr As Secure_SQLRS.SessionHeader = New
> Secure_SQLRS.SessionHeader
> rsIRIS.SessionHeaderValue = rptSessionHdr
> Try
> ' execute the report
> rptIRIS = rsIRIS.Render(rptPath, rptFormat, rptHistoryID,
> rptViewerInfo, rptParams, credentials, _
> showHideToggle, encoding, mimeType, rptHistoryParams,
> warnings, streamIDs)
> rptSessionHdr.SessionId = rsIRIS.SessionHeaderValue.SessionId
> Response.Clear()
> ' set the http headers for the PDF response
> HttpContext.Current.Response.ClearHeaders()
> HttpContext.Current.Response.ClearContent()
> HttpContext.Current.Response.ContentType = "text/html"
> HttpContext.Current.Response.AppendHeader("Content-Disposition", _
> "filename=""AddressLabels.HTM""")
> ' send the byte array containing the report as a binary response
> HttpContext.Current.Response.BinaryWrite(rptIRIS)
> HttpContext.Current.Response.End()
> Catch ex As Exception
> Finally
> End Try

Help - Error: Unable to open the physical file

Hi, I've just finished creating my first ASP.NET website. I created it on my laptop and it works perfectly, but I'm having some problems deploying it to my web server (PC).
The site works ok, but when I try to log in to my client area, I get this error:

"Unable to open the physical file "c:\inetpub\wwwroot\ONeillStrata\App_Data\aspnetdb.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file c:\inetpub\wwwroot\ONeillStrata\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

I've searched far and wide for a solution and have read many articles, but none seem to be able to fix my problem. I've tried using that SEUtil tool, but that didn't work, I've made sure the App_Data directory on the web server isn't read only (the read-only checkbox isn't ticked, but it DOES have that little green square which I can't get rid of), I've assigned the ASPNET user as a db owner and that didn't work and I've manually attached the database to the web server's instance of SQL Express 2005.
When I launch the solution in VS2005 on the web server, I can browse through the database and see the tables and data etc, but when I try to run the application, I get that message above...

Surely it shouldn't be this hard to get it going?
Any help would be massively appreciated.

Hi,

It seems that the physical file location of the aspnetdb.mdf is wrong.

Please open your IIS, right click on your default web site,and click on the properties, change to the ASP.NET tab, edit configurations.Then you can see the LocalSqlServer string listed there, change the string into the following:data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true.

Thanks.

HELP - Designing a Subscripion System for a Group of Reports

We're developing an ASP.NET 2.0 (C#) application that will act as a
front-end to SQL Server 2005 Reporting Services. We have an interesting
requirement that [we believe] can't be solved using RS out-of-the-box. So,
I'm writing today to get some ideas on possible solutions.
The requirement is that the app. needs to support, what we're calling, a
report group. A report group is simply a group of similar reports that can
be executed as a single unit (instead of having to execute each report
individually). This was not too bad to solve. We simply created our own
database tables that track which report group contains which reports.
The tricky part is that we now have to figure out a way to create a
subscription that executes the report group (thereby executing each
individual report in the report group automatically). Creating a
subscription for a single report is fairly straightforward, but it appears
this concept of a report group is not a part of RS.
Does anyone out there have any good ideas/suggestions on how we can
implement such functionality?
The best thought we have so far is to write another application that manages
the execution of each report in a report group. So, the SQL Server 2005 job
would call this additional little application, this additional app. would
lookup which reports are in the report group, and then it would loop through
all the reports and execute them one-by-one. But, this has some issues-like
how do we handle the output type (PDF, Excel, etc.) and how do we handle the
destination (e-mail, printer, etc.) of each report. Plus, it seems like we
would be somewhat reinventing the wheel as far as subscriptions go.
Thanks.Why aren't you using one master report with all the other reports as
sub-reports?
Tom Bizannes
oiduts wrote:
> We're developing an ASP.NET 2.0 (C#) application that will act as a
> front-end to SQL Server 2005 Reporting Services. We have an interesting
> requirement that [we believe] can't be solved using RS out-of-the-box. So,
> I'm writing today to get some ideas on possible solutions.
> The requirement is that the app. needs to support, what we're calling, a
> report group. A report group is simply a group of similar reports that can
> be executed as a single unit (instead of having to execute each report
> individually). This was not too bad to solve. We simply created our own
> database tables that track which report group contains which reports.
> The tricky part is that we now have to figure out a way to create a
> subscription that executes the report group (thereby executing each
> individual report in the report group automatically). Creating a
> subscription for a single report is fairly straightforward, but it appears
> this concept of a report group is not a part of RS.
> Does anyone out there have any good ideas/suggestions on how we can
> implement such functionality?
> The best thought we have so far is to write another application that manages
> the execution of each report in a report group. So, the SQL Server 2005 job
> would call this additional little application, this additional app. would
> lookup which reports are in the report group, and then it would loop through
> all the reports and execute them one-by-one. But, this has some issues-like
> how do we handle the output type (PDF, Excel, etc.) and how do we handle the
> destination (e-mail, printer, etc.) of each report. Plus, it seems like we
> would be somewhat reinventing the wheel as far as subscriptions go.
> Thanks.|||You could try setting up a shared schedule. It would still require
individual subscriptions for each report but they would all start
firing at the same scheduled time.

Friday, February 24, 2012

Help

I've just learned an asp.net 2.0 web app with vs 2005 and am using a SQL Server 2005. But after running programme the error occur.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

please help me! Fix it

Enable remote connections at the SQL Server. http://www.sqlserver2005.de/SharedFiles/remoteconnection.jpg

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||

I have finished the remote connection but my program not running. it still inform error:

Server Error in '/TipcGiaLai' Application.


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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

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: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 11: conPubs = New SqlConnection( "Server=localhost;UID=;PWD=;Database=Pubs" )

Line 12: cmdSelect = New SqlCommand( "Select * From Authors", conPubs )

Line 13: conPubs.Open()

Line 14: dtrAuthors = cmdSelect.ExecuteReader()

Line 15:

please help me ! Thanks

Help

I've just learned an asp.net 2.0 web app with vs 2005 and am using a SQL Server 2005. But after running programme the error occur.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

please help me! Fix it

Enable remote connections at the SQL Server. http://www.sqlserver2005.de/SharedFiles/remoteconnection.jpg

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||

I have finished the remote connection but my program not running. it still inform error:

Server Error in '/TipcGiaLai' Application.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

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: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 11: conPubs = New SqlConnection( "Server=localhost;UID=;PWD=;Database=Pubs" ) Line 12: cmdSelect = New SqlCommand( "Select * From Authors", conPubs ) Line 13: conPubs.Open() Line 14: dtrAuthors = cmdSelect.ExecuteReader() Line 15:

please help me ! Thanks