Showing posts with label upgrade. Show all posts
Showing posts with label upgrade. Show all posts

Wednesday, March 28, 2012

Web Server Upgrade

hi all,
I installed Visual Studio .NET 2003 and I updated my Windows.
When I tried to open a new project I get an error pop-up saying "Visual Studio .NET 2003 has detected that the specified Web Server is not running ASP.NET v1.1"..
What should I do ?
Do I have to upgrade my web server ?.If so how ?

VarunI had the exact same problem when I started with this. It took a while, but I finally found a place that told me how to fix this. So, I'll be nice and tell you right here:

Admistrative Tool -> Internet Information Services
open local computer then web sites then right click on default web site and select properties
Under the Home Directory tab at the bottom there is a button called Configuration (click that)
The path should be:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
not:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll

if any of them are the second path, change it to the first one.
If that first path is not there, then you don't have the v1.1 framework installed (but I doubt that)

Hope that helps.

--Bryan
Thanks a lot for the reply.
But when I opened IIS I saw a strange thing !.
Under the default web site I am not able to find any .aspx files.
But I have installed Visual Studio.NET (as I checked for the file "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll"
It is there)
.But IIS does not show any .aspx files' presence at all.
Do you think that my IIS is not properly configured or what do I have to do ?

Varun
Ok, that happened to me as well. You need to install the .NET Framework AFTER IIS. So this just means you need to run the install file for .NET framework again. This will configure IIS to work correctly.

Here is a link:
http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe

--Bryan

Saturday, March 24, 2012

Web Service for Sql Connections

I want to have a function available to multiple apps that creates connections to our sql server 7 database (they do not want to upgrade to 2000 or 2005 yet). My questions are:

Is it safe to put functions that connect to the db in a web service?

Should I have any additional security measures in place?

Here is a sample of one I converted to be potentially used:

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
Inherits System.Web.Services.WebService
Public globConnection As SqlConnection
Public gstrDBName As String
Public gstrSwitchboardPath As String
Public gstrHelpPath As String

<WebMethod()> _

'This Module is the ONLY access to the SQL Server
'It is using NT Authentication to permit access
'If the user is not a Valid NT user access is Denied
'If the user has not been granted permission to the SQL server access will be Denied

Public Function ConnectToDB() As Boolean

Dim BoolState As Boolean
Dim strConnection As String

gstrDBName = "DBNAME"

strConnection = "Provider=SQLOLEDB.1;" & _
"Data Source= SERVERNAME;Initial Catalog= " & gstrDBName & ";" & _
"Integrated Security=SSPI "
On Error Resume Next

If globConnection Is Nothing Then
globConnection = New SqlConnection
End If

If globConnection.State = Data.ConnectionState.Open Then
BoolState = True
Else
globConnection = New SqlConnection
globConnection.ConnectionString = strConnection
globConnection.Open()
If globConnection.State = Data.ConnectionState.Open Then
BoolState = True
Else
BoolState = False
End If
End If
ConnectToDB = BoolState
End Function 'ConnectToDB

End Class

Any input, suggestions, etc would be greatly appreciated.its fine so long as the public methods you expose through your webservice don't open the door for someone to send in malicious code..

for example, if your webservice exposed a routine that allowed you to pass a SQL string to it and run that against your DB, that would be a bad risk, because someone could easily pass a string to delete all your tables.

You may also want to disallow public access to your service or have authentication of some sort for the users of the service.
We use all stored procedures, no hard coding SQL into any of our code. Our VB 6.0 security Model looks something like this currently:

Database
Stored Procedure
Class
Module
Application

I am trying to figure out how to implement similar security layers in ASP 2.0 and be able to use alot of the newer functionality, improve scalability (they want to roll this stuff out to multiple US and International - eventually - clients) without having to install cumbersome applications that require local support when users hose them up entirely or have to worry about how much memory, etc they have. Connectivity is not an issue because if they lose connectivity to us it does not matter what they use. I have been studying this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetch03.asp
If there are any other decent articles out there, can I get links to them?

Thank you very much.
hows about this one

http://msdn2.microsoft.com/en-us/library/w67h0dw7.aspx
Ok, I have security squared away...I think hehe. Now I run into a bigger problem - connecting a gridview to SQL Server 7.0. I know that it cannot be done directly and I have to use a dataset, however I cannot seem to figure out the right configuration of parameters and/or syntax to make it happen. Any help? Here is what I have so far that is not utterly ridiculous:

Public globConnection As SqlConnection
Public globDS As SqlDataSource

Public Function ConnectToDS() As SqlDataSource
Dim strConnection As String
gstrDBName = "DBNAME"

strConnection = "Provider=SQLOLEDB.1;" & _
"Data Source= ServerName;Initial Catalog= " & gstrDBName & ";" & _
"Integrated Security=SSPI "

If globConnection Is Nothing Then
globConnection = New SqlConnection
End If

globDS.ConnectionString = strConnection

ConnectToDS = globDS
End Function

I have been and continue to look on the web. The only thing I have found a reference to is caching...not alot of detail just reference. Again, any suggestions, pointers and guidance is muchly appreciated.
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx