Saturday, May 22, 2010

How to open popup with Post field

Do the following Things
1>First keep the code in the parent page
2>Keep the following javascript In the above code multi popup is open so dynamicaly change the target name.
Note:When we want to open multi popup at that moment we just dynamically change the sub window name.

How to open popup with Post field

Do the following Things

1>First keep the code in the parent page

2>Keep the following javascript
In the above code multi popup is open so dynamically change the target name.
Note:When we want to open multi popup at that moment we just dynamically change the sub window name.

Saturday, October 24, 2009

How to solve Unable to start Debug and xml parsing errror

Unable TO Start Debug Error

Whenever we run asp.net pages in our browser we may get an unable to start debug error

Just we need to udate the registry in the following way it will solve the error

XML Parsing Error: not well-formed

Whenever we access an asp.net page in our browser we may get an xml parsing error that says the XML is not well formed

Fix for ‘XML Parsing Error:
Click Start > Run, and type the following command depending on which ASP.NET framework is in use by the default web site in our IIS.
ASP.NET 3.5 Framework
%Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

ASP.NET 2.0 Framework
%Windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

ASP.NET 1.1 Framework
%Windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i

You should see a command window that is displayed briefly, that shows that ASP.NET is being installed. After the registration is successful, the window will be closed.

Now refresh the .aspx page that you got the XML Parser error for in the browser and your page should be rendered correctly.

Why did you get this error ?
I have seen this error happen to me in situations where I had installed IIS after the installing the .Net Framework. This make sense. If you install IIS after you install the .Net Framework, then the framework is not registered with IIS. So when a request for a .aspx page comes to IIS, it simply passes on the contents of the page as-is without processing it. So in effect, the browser receives the entire .aspx page’s code, tried to parse it as an XML file, encounters the parsing error at the second character in the page directive and stops.

Unable to start debugging on the web server.Check for one of the following things
If we install VS2010 after VS2008 and we want to run code from VS2008 then we get error.The error is generate because of as ASP.net Version debugging option is changed.We can solve this issues by doing the following things
1>For IIS 5.6
We need to navigate the IIS virtual directory properties path=>then ASP.Net tab=>after that we need to change the ASP.NET version.
1>For IIS 7.5
Nvigate to the Manage Application/Advanced Settings=>Then change the Application Pool

Friday, August 28, 2009

Create EXE or Setup File in .NET Windows Application

1>First create a project and make the application
2>Do unit testing so as to the application run correct.
After you have developed your windows apllication,now you want to make a exe.how can?
These steps are gives the guidance to you…
3>Go to file menu > click Add > new project >now "Add New Project" Dialog appear

4.Select "Other Project Types" and click "Setup and Deployment' projects,Choose "Setup Project" give name project name in name text box finally click OK.

5.New project appear in solution explorer,for example you give the name "TestAddition"..it will display with this name.
6.Right click the TestAddition > go View > click "File System"

7.You can see the "File System on TargetMachine" under three folders Application Folder, User’s Desktop, User’s Program Menu.

8.Select Application Folder and right click Add>Project Output>select Primary output

9.Select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE.Click on next >> same procedure follows the user’s program menu also
9.If you want to change the Manufactures name for exe,just right click the project go to properties change the properties as per you requirement

10>Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)

EXE available @ this location
To find your exe location go the project folder.there have one more folder created with the name of your exe.
Enter the folder there you find Debug folder.Now you found your exe or set up file.

When you want to install the EXE on the client machine,you should be installed .NET Framework on that mc because,Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs.

How To add windows service into the service list
1>First create a windows service application.
2>project/bin/debug folder exe will be created .
3>Open the visual studio command prompt
4>Navigate to the service exe path

5>Type Installutil SERVICENAME.exe
6>Enter

How To de register windows service from the service list
1>Go to command prompt and type
2>sc delete SERVICENAME

Sunday, August 16, 2009

How do I import Access Database into SQL Database(2000)

1.Right click on any database
2.Select ALL TASKS and then select IMPORT DATA after clicking
3.One dialog box will appear,click NEXT
4. And choose MICROSOFT ACCESS as DATA SOURCE, what displayed on the following picture.

Then BROWSE ur access file then click NEXT(keep username and password blank)
5.Chosse the DESTINATION[SQL native client].Click on properties

6.Chosse Data Source(localhost),select a specific username and password.
(With sa sa),Chosse Database from Initial Catalog.Click Ok.
7.Click Next.

8.Select copy tables and views from source database then click next
9.Select all tables,click Next.
10.Check run immediately,click Next.
11.Click finish.

Sunday, July 12, 2009

Write XML in c#

How to create xml

To create xml we need to do following steps=>

1)First include the name i)System.Xml ii)System.IO iii)System.Text.

2)create writer object

>XmlTextWriter writer = new XmlTextWriter(Server.MapPath("xml/userInfo.xml"), Encoding.UTF8);
In Server.MapPath we specify the path where we would like to create xml file.
statr to write by writer.WriteStartDocument();
writer.WriteStartElement("userInfo"); this specify strat element with element userInfo
writer.WriteElementString("urlReferrer", "none");this specify sub element with element urlReferrer and value none
writer.WriteAttributeString("timeVisited", DateTime.Now.ToString());this specify a element attribute with timeVisited
writer.WriteEndElement(); this specify end of a element
writer.WriteEndDocument(); this specify end of a document.
writer.Close(); this specify close of a document.

Saturday, December 6, 2008

Using Triggers In SQL Server /Implementing Trigger In SQL Server

Using Triggers In SQL Server /Implementing Trigger In SQL Server


A trigger is used to execute a bach of sql code when a specific event is fired. There are two types of trigger


1>AFTER TRIGGER.


2>INSTEAD TRIGGER.


AFTER TRIGGER is used after a specific event fired.An AFTER trigger is a trigger that gets executed automatically before the transaction is committed or rolled back.


A trigger which gets executed automatically in place of triggering actions i.e., INSERT, DELETE and UPDATE is called an INSTEAD OF trigger.INSTEAD OFtriggers gets executed automatically before the Primary Key and the Foreign Key constraints are checked, whereas the traditional AFTER triggers gets executed automatically after these constraints are checked.


 


How to execute TRIGGER


First Open the Enterprice manager


1)Start -> Programs -> Microsoft SQL Server -> Enterprise Manager.


2)Expand Sql Server Group->Expand Database->Click on Tables .

























3)Right click on the table and choose All Tasks -> Manage Triggers.This will open the trigger properties window, which allows us to create a new trigger:





















The syntaxt of the Create Trigger is shown bellow.


1)An example of fire TRIGGER After an INSERT


CREATE TRIGGER [rndTrigger_insert] ON [dbo].[rnd_store_procedure]


FOR INSERT

AS


DECLARE @FName VARCHAR(255)

DECLARE @LName VARCHAR(255)

DECLARE @Address VARCHAR(255)

DECLARE @StoredID BIGINT


SELECT @StoredID = (SELECT PKID FROM Inserted)

SELECT @FName = (SELECT FName FROM Inserted)

SELECT @LName = (SELECT LName FROM Inserted)

SELECT @Address = (SELECT Address FROM Inserted)


INSERT INTO rnd_trigger (StoredID,FName,LName,Address) VALUES (@StoredID,@FName,@LName,@Address)


In the above example it is shown rndTrigger object is created and it is fired when data inserted into table rnd_store_procedure.


When the TRIGGER is fired data also inserted into table rnd_trigger.


2) An example of fire TRIGGER After an DELETE.


CREATE TRIGGER [rndTrigger_delete] ON [dbo].[rnd_store_procedure]


FOR DELETE

AS


DECLARE @PKID BIGINT

DECLARE @Status BIT


SELECT @PKID = (SELECT PKID FROM Deleted)

SELECT @Status = (SELECT Status FROM Deleted)


if(@Status = 1)

BEGIN

RETURN

END


DELETE FROM rnd_trigger WHERE StoredID = @PKID


In the above example it is shown rndTrigger object is created and it is fired when data deleted from table rnd_store_procedure.


When the TRIGGER is fired it is checked the deleted record status is true or false.


If deleted record status is false then corresponding record also deleted from rnd_trigger.


3) An example of fire TRIGGER After an UPDATE.


CREATE TRIGGER [rndTrigger_update] ON [dbo].[rnd_store_procedure]

FOR UPDATE

AS


DECLARE @PKID BIGINT

DECLARE @FName VARCHAR(255)

DECLARE @LName VARCHAR(255)

DECLARE @Address VARCHAR(255)


IF NOT UPDATE(FName) AND NOT UPDATE(LName)

BEGIN

RETURN

END


SELECT @PKID = (SELECT PKID FROM Inserted)

SELECT @FName = (SELECT FName FROM Inserted)

SELECT @LName = (SELECT LName FROM Inserted)

SELECT @Address = (SELECT Address FROM Inserted)


 


UPDATE rnd_trigger set FName = @FName,LName = @LName,Address = @Address

WHERE StoredID = @PKID


In the above example it is shown rndTrigger object is created and it is fired when rnd_store_procedure is updated.


When the TRIGGER is fired it is checked the FName AND LName from record weather being modified or not.If record is being modified then record from table rnd_trigger also modified.