How to check if the current User has been Authenticated?
VB.NET If User.Identity.IsAuthenticated Then ’Your code End If C# if (User.Identity.IsAuthenticated ) { //Your code }
Why do I get error message ‘Login failed for user DOMAIN\USERNAME’
You’ll have to create an account in SQL Server for the aspnet user. Start enterprise manager-> expand the server-> select security->Right-click in the right view and select new login, enter the DOMAIN\USERNAME and select your database as the default database of the user at the bottom of the page, Select last tab Database Access -> select your database, and add the db_datareader and db_datawriter policies to your user.
How can I to get the path to the system area that holds temporary files?
Use System.IO namespace VB.NET Dim filePath As String = Path.GetTempPath() Dim fileName As String = Path.GetTempFileName() Response.Write((filePath + ‘ ‘)) Response.Write(fileName) C# string filePath =Path.GetTempPath (); string fileName = Path.GetTempFileName(); Response.Write (filePath + ‘ ‘ ); Response.Write (fileName );
ASP pages that worked perfectly on Windows 2000 Server and IIS 5.0 do not work on Windows 2003 Server with IIS 6.0. ASP.NET pages work fine. Why?
Start -> Settings -> Control Panel -> Administrative Tools -> and double clicking IIS Manager. Go to the Web Service Extensions tab, click Active Server Pages, then press the ‘Allow’ button on the left
How to format a Telephone number in the xxx-xxx-xxxx format
VB.NET Dim Telno As Double = Double.Parse(ds.Tables(0).Rows(0)(‘TelNo’).ToString()) Response.Write(Telno.ToString(‘###-###-####’)) C# double Telno= double.Parse(ds.Tables[0].Rows[0][‘TelNo’].ToString()); Response.Write(Telno.ToString(‘###-###-####’));