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

Tuesday, March 27, 2012

A DOS question! (about aspnet_regsql.exe with paramaters)

I need to setup some asp security databases and I have seen several sets of instructions. Some say "Navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" and some say at the "asp command box". I do know that the directory & file exists on my machine. I have run aspnet_regsql.exe to configure my local server. I now need to run it to configure my web host SQL Server 2005 and that requires some paramaters like "aspnet_regsql.exe -S [DB Server Name] -U [DB login] -P [Password] -A all -d [Database name]". I am old and started before windows. I know DOS. But obviously not well enough.

How do you "Navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"?

If I say "CD\WINDOWS", it works.

When I am at the "C:\WINDOWS>" prompt and say "CD Microsoft.NET" it says "invalid directory"

When I am at the "C:\>" prompt and say "CD\WINDOWS\Microsoft.NET" it says "invalid directory"

When I am at the "C:\>" prompt and say "CD\WINDOWS\Micros~1" it says "invalid directory"

Thanks for your help. John Brown

Not much traffic on a DOS question! I figured out a work around.

I copied aspnet_regsql.exe to a directory with a short name (C:\trash) and then ran it from the command prompt. It worked!

John Brown

sql

A different question about SQL Server Access Denied

I have 2 development servers, both of which I need to use to run an ASP.NET app. The app connects to an external SQL Server with SQL Server authentication only. One of my servers connects properly, but the same exact app running on the second server generates the dreaded SQL Server Access Denied message. A traditional .asp file running on the second server does connect successfully to the database, so I have deduced that the problem is related either to the ASPNET account on the second server, or else to the structure of the server itself or IIS.

I have verified on both machines that IIS uses the ASPNET account for anonymous access. The only difference I can find is that the working server is using NTFS (and the VS_Developers account has full permission on my application's directory), while the problem server is using FAT. Does anyone know if it the FAT file system could be my problem? If so, should I convert to NTFS, or is there another solution? What else could I look at on the problem server? Any help would be greatly appreciated. Thanks.If you are using SQL Server authentication then using IIS anonymous accounts and ASP.Net accounts are not involved in the authentication. What is the exact message that appears? Login failed for user [...] ?

If you are using SQL server with SQL server authentication then in the connection string you should be providing the UID and Password of a SQL Server Login and there should be no "integrated security" clause in the connection string.|||Thanks for the reply. The error message is: "SQL Server does not exist or access is denied". There is no login failure error occurring.

Here is my connection string:
"Data Source=mySQLIPhere,1433;Network Library=DBMSSOCN;Initial Catalog=myDBName;User ID=mySQLUser;Password=mySQLPw;"

As I mentioned, this connection string works fine from one of the 2 development servers as well as from the production web server, so I don't think the connection string is the problem.|||Seems ok to me; if you are willing to do some experiments try these in order.

Verify that you can access mySQLIPhere machine from the machine causing the problem. e.g. by trying to open \\mySQLIPhere or by pinging.

Use query analyzer to connect to SQL Server from the machine causing problem. In "connect to SQL Server" dialog box provide mySQLIPhere as Sql Server name, select Sql Sever Auth, loginname and password. If this works you may experiment rewriting your connection string bit by bit e.g.:
"Data Source=mySQLIPhere; User ID=mySQLUser; Password=mySQLPw;"
"Data Source=mySQLIPhere,1433; User ID=mySQLUser; Password=mySQLPw;"
"Data Source=mySQLIPhere;Initial Catalog=myDBName; User ID=mySQLUser; Password=mySQLPw;"

It is most probably the SQL Server not exist (not found) part that looks true, rather than the access denied part.

Sunday, March 25, 2012

A couple of, I hope Basic Questions RE SqlDataSources and scripting

Greetings!

I am writing a proof of concept ASP.net application for my employer and I have run into a couple perplexing issues. First off, In my Page_Load event I have the following code.

txOTHrs.Attributes[

"onBlur"] ="return calculateTotal(this)";

The onblur event handler is coded as follows

function calculateTotal(tb)

{

var regHrs = document.getElementById ("txRegHrs").value; var otHrs = document.getElementById("txOtHrs").value; var rate = document.getElementById("txRate").value; var regAmt = rate * regHrs; var otAmt= rate * ( otHrs * 1.5 ); var total = otAmt + regAmt;

document.getElementById(

"txTotal").value = total;

}

Everything seems to work fine. The onBlur event is handled and, as I expect the value in the txTotal text box is updated correctly. The problem occurs when I try to access that value in the codebehind page. When ever I look at txTotal.Text in the debugger it is always blank. This has left me scratching my head as I can clearly see a value on the web page. Have I missed some step where I have to notify the server that a value in the control has changed ?

My second question is, I hope a very easy one to answer. In WinForms when I have a dataset I can access the individual rows ( in an untyped dataset ) by speficying dataset.tables["tableName"].Rows[index]. Is there any similar mechanism for accessing the individual rows, and fields in the SqlDataSource object in ASP.net ?

Any help anyone can provide is greatly appreciated!!

If you are comming from a "Windows Forms" world, then there are a few key concepts that you are going to need to understand... most especially is the "Page Lifecycle" which I will mention further down... but to answer your questions quickly:

sabrecat:

Have I missed some step where I have to notify the server that a value in the control has changed ?

- Yes... you need to "PostBack" to the server at any time that you want to reflect changes.

sabrecat:

In WinForms when I have a dataset I can access the individual rows ( in an untyped dataset ) by speficying dataset.tables["tableName"].Rows[index]. Is there any similar mechanism for accessing the individual rows, and fields in the SqlDataSource object in ASP.net ?

- Again, Yes... here is a small example:

DataView myDataView = (DataView)this.MarketDataSource.Select(DataSourceSelectArguments.Empty);

foreach (DataRow rowin myDataView.Table.Rows)
{
// do something here :)
}

// Or you can do...

string firstPersonsLastName = (string)myDataView.Table.Rows[0]["LastName"];

Here is the "Page Lifecycle" that I mentioned earlier:
http://msdn2.microsoft.com/en-us/library/ms178472.aspx
http://www.eggheadcafe.com/articles/o_aspNet_Page_LifeCycle.jpg

Read the MSDN article, save that picture to your desktop and look at it often :)

I hope this helps.

Peace,

|||

Thank you very much for the reply! You have been tremendously helpful!

I thought that the data that I was putting into the control wasnt getting back to the serve. I wasnt sure what mechanism to use however to get it into the server. To actually perform thepostback I would use the __doPostBack function that ASP.Net puts into the page right ? I mean in my script I'd do somthing like

function calculateTotal(e, tb)
{
var regHrs = document.getElementById ("txRegHrs").value;
var otHrs = document.getElementById("txOtHrs").value;
var rate = document.getElementById("txRate").value;
var regAmt = rate * regHrs;
var otAmt= rate * ( otHrs * 1.5 );
var total = otAmt + regAmt;
document.getElementById("txTotal").value = total;
__doPostBack(tb,e);
}

Since my calulateTotal function right now only has the one argument (tb) I assume then that I would have to change my codebehind page to look somthing like

txOTHrs.Attributes[

"onBlur"] ="return calculateTotal(event, this)";

instead of

txOTHrs.Attributes["onBlur"] ="return calculateTotal(this)";

Regarding the SqlDataSource. Does the argument DataSourceSelectArguments.Empty make the invocation of the Select method NOT go out to the database again ? If this is not the case and the database is hit again then I would want to get the data into a DataView at the time that I do my initial select on the database and then put that object into the session to make it persistant between page reloads ?

Again thank you very much for all the insights and the links to some really good data.

Sunday, March 11, 2012

80004005 ODBC SQL Server Driver shared memory or TCP/IP sockets er

Hi all,
I have been getting these errors on simple ASP code on my web site:
|80004005|[Microsoft][ODBC_SQL_Server_Driver][TCP/IP_Sockets]ConnectionWrite_(send()).
|80004005|[Microsoft][ODBC_SQL_Server_Driver]Timeout_expired
|80004005|[Microsoft][ODBC_SQL_Server_Driver][Shared_Memory]SQL_Server_does_not_exist_or_access_denied.
|80004005|[Microsoft][ODBC_SQL_Server_Driver][TCP/IP_Sockets]SQL_Server_does_not_exist_or_access_denied.
|80004005|[Microsoft][ODBC_SQL_Server_Driver]Timeout_expired
The SQL 2000 is Standard Edition, SP3 and OS is Windows 2003 Standard edition.
Previously I never faced this problem before. These errors come
intermittently, at no specific time. It appears randomly at any time.
The only thing I have to do is reboot the server to solve this issue.
please tell me if there's anything to solve this issue.
reboot?
"tapman" wrote:

> Hi all,
> I have been getting these errors on simple ASP code on my web site:
> |80004005|[Microsoft][ODBC_SQL_Server_Driver][TCP/IP_Sockets]ConnectionWrite_(send()).
> |80004005|[Microsoft][ODBC_SQL_Server_Driver]Timeout_expired
> |80004005|[Microsoft][ODBC_SQL_Server_Driver][Shared_Memory]SQL_Server_does_not_exist_or_access_denied.
>
> |80004005|[Microsoft][ODBC_SQL_Server_Driver][TCP/IP_Sockets]SQL_Server_does_not_exist_or_access_denied.
> |80004005|[Microsoft][ODBC_SQL_Server_Driver]Timeout_expired
> The SQL 2000 is Standard Edition, SP3 and OS is Windows 2003 Standard edition.
> Previously I never faced this problem before. These errors come
> intermittently, at no specific time. It appears randomly at any time.
> The only thing I have to do is reboot the server to solve this issue.
> please tell me if there's anything to solve this issue.
>

Saturday, February 25, 2012

64 Bit Set up

I"m trying to install the enterprise version of SQL 2005, 64-bit and keep getting the following error...

- ASP.Net Version Registration Requirement (Warning)

Messages

ASP.Net Version Registration Requirement

32-bit ASP.Net is Registered. Required 64-bit ASP.Net to install Microsoft Reporting Services 2005(64-bit).

I've uninstalled the 32-bit framework, or I think I have but I keep getting the same error message and our primary need for this latest upgrade is for the SRS capabilities. I want the Reports server to be on the same server and this is our first step into 64-bit so I have nothing to compare to. Please any suggestions or comments or anything would be greatly greatly appreciated!!

Thanks!!

J

Hi,

you must install the 64-bit version of ASP.NET for Reporting Services (64-bit)!

1Setup does not configure load-balancing and single-URL addressing for multiple nodes in a Report Server scale-out deployment. To complete a scale-out deployment, you must use Windows Server, Microsoft Application Center, or third-party cluster management software. For more information about setting up Web farm deployment, see Configuring a Report Server Scale-Out Deployment.

2Reporting Services is not available if Internet Information Services (IIS) 5.0 or higher is not installed. Microsoft Internet Explorer 6.0 Service Pack (SP) 1 is required for the Report Designer component of Reporting Services.

3For Reporting Services (64-bit) installations on 64-bit servers, the 64-bit version of ASP.NET must be installed. For Reporting Services (32-bit) installations on 32-bit systems, and on the 32-bit subsystem (WOW64) of a 64-bit server, the 32-bit version of ASP.NET must be installed.

4Reporting Services is not supported in side-by-side configurations on the 64-bit platform and on the 32-bit subsystem (WOW64) of a 64-bit server at the same time.

plz read BOL Components to Install

CU

tosc

InsideSQL.de