Friday, December 16, 2011

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access

Solution: Type the followinf in Visual Studio Command Prompt (Start->All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools ->Visual Studio Command Prompt (2010)

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215>aspnet_regiis -ga "NT Authority\Network Service"


This solution works perfectly.

Tuesday, August 30, 2011

About Views

Which of the following statements is correct?

Ans1: CREATE VIEW dbo.vEmpSalTotal AS SELECT EmpId, SUM(EmpSal) FROM [Emp] GROUP BY EmpId
Ans2: CREATE VIEW dbo.vEmpSalTotal AS SELECT EmpId, SUM(EmpSal) as TotalSal FROM [Emp] GROUP BY EmpId
Ans3: The sp_HelpText system stored procedure reveals the code which created an object. For Example below code reveals the View text for the View : "viewGetDetails"

sp_HelpText viewGetDetails.

Ans4: You can Encrypt the view using the "WITH ENCRYPT" keyword in the Create View clause:

ALTER VIEW dbo.viewGetDetailsWITH ENCRYPTION
AS
SELECT
EmpID, SUM(EmpSal) AS TotalSalFROM [Emp]GROUP BY EmpID

Tips to keep updated in IT field.

Friday, August 26, 2011

update database using sqldataadapter


Following code demonstrates simple update to the database, using SqlDataAdapter

var nw = ConfigurationManager.ConnectionStrings["nw"];
var connection = new SqlConnection();
connection.ConnectionString = nw.ConnectionString;
var cmd = connection.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM Customers";
var da = new SqlDataAdapter(cmd);
var nwSet = new DataSet("nw");
var bldr = new SqlCommandBuilder(da);
da.Fill(nwSet, "Customers");
//Modify existing row
var customersTable = nwSet.Tables["Customers"];
var updRow = customersTable.Select("CustomerID='WOLZA'")[0];
updRow["CompanyName"] = "New Wolza Company";
//Add new row
customersTable.Rows.Add(
"AAAAA", "Five A Company");
//Delete a row, note that you cannot delete a
//customer who has orders
var delRow = customersTable.Select("CustomerID='PARIS'")[0];
delRow.Delete();
//send changes to database
da.Update(nwSet, "Customers");
dataGridView2.DataSource = nwSet;
dataGridView2.DataMember = "Customers";
MessageBox.Show("Update Complete");

Back up your data on Facebook,Linked In, Twitter by following simple steps


Back up your data on Facebook,Linked In, Twitter by following simple steps:

you can backup your data on facebook by going to Account at right top corner -> Account settings -> Click on link "Download a copy" above the facebook copyright ->Start my archive.

Export your Linked In contact by following these simple steps:

Go to Contacts Menu
My Connections
Click on Export Connections link at the bottom of the page.
You can select your choice to export to any of the file formats Microsoft Outlook
Outlook Express
Yahoo! Mail
Mac OS X Address Book (CSV file)
VCF file(vCard)
click on export

Back up you twitter data by using the services of any of the below sites:


https://tweetstreamapp.com/
tweetscan.com

Sunday, June 19, 2011

automatically detect the language set in the user's browser

Q. How can a asp.net page automatically detect the language set in the user's browser ?
Automatic detection of the language preference of the user as set in his browser
In your web.config file, you need to set the following globalization tag with the values that are presented below:
<system.web>
   <globalization
          uiCulture="auto"
          culture="auto"
          enableClientBasedCulture="true" />
</system.web>

New features in .Net 4.0

1. ASP.NET 4.0 comes with a new option for compressing the Session data with Out Process Session mode(mode=StateServer). To enable this functionality, we need to add “compressionEnabled=”true” attribute with the SessionMode in web.config.
image
When Compression mode is enabled in web.config, ASP.NET compresses the serialized session data and passes it to session storage and while retrieving same deserialization and decompression happens in the server side. ASP.NET 4.0 used System.IO.Compression.GZStream class to compress the session mode.

2. We can programmatically change Session State Behavior when required as below:


 //The Session State behaviour can be any of: Default,Disabled,ReadOnly,Required based on the requirement.

3.
HttpContext.Current.SetSessionStateBehavior( System.Web.SessionState.SessionStateBehavior.Default)