It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process.

Problem :- 

It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process.

Solution :-



This Error Cause Because of your Diffrent Asp.Net  framework running on a same Application pool.
to resolve this error assign diffrent application pool to diffrent framework.
In past i uploaded my Site on Server with IIS 6.0 Version.there are around 15 application running on Framework 1.1.I have uploaded my Framework 2.0 application And I found that 1.1 framework application goes Down.then i show in Event viewer it's dispaly that "It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process"
Then i have create seperate application pool for my asp.net 2.0 application and All Issues are resolved.
  Enjoy !!!!!!!!!!!!



Prev Post                    All Post                           Next Post

Posted in | 6 comments

Error 103 property 'FullResourceName' cannot be declared 'Overrides' because it does not override a property in a base class.

Error :-

Error 103 property 'FullResourceName' cannot be declared 'Overrides' because it does not override a property in a base class.

Solution :-


Remove Overrides keyword in Property.

THis Cause Problem :-

  Public Overrides Property ResourceName() As String
        Get
            Return "rpt_offence_summary.rpt"
        End Get
        Set
            'Do nothing
        End Set
    End Property

Make Like :-


  Public Property ResourceName() As String
        Get
            Return "rpt_offence_summary.rpt"
        End Get
        Set
            'Do nothing
        End Set
    End Property

Posted in | 1 comments

Strong Encryption and Decryption Class For Asp.Net


Hello,
I Have Found Strong Encryption and Decryption Class For encrypt and Decrypt login and Password in .Net Application during googleing.
Strong Encryption and Decryption Class For Asp.Net

For Decryption

public string Decry(string TextToBeDecrypted)
{
RijndaelManaged RijndaelCipher = new RijndaelManaged();
string Password = "CSC";
string DecryptedData;
try
{
byte[] EncryptedData = Convert.FromBase64String(TextToBeDecrypted);
byte[] Salt = Encoding.ASCII.GetBytes(Password.Length.ToString());
//Making of the key for decryption
PasswordDeriveBytes SecretKey = new PasswordDeriveBytes(Password, Salt);
//Creates a symmetric Rijndael decryptor object.
ICryptoTransform Decryptor = RijndaelCipher.CreateDecryptor(SecretKey.GetBytes(32), SecretKey.GetBytes(16));
MemoryStream memoryStream = new MemoryStream(EncryptedData);
//Defines the cryptographics stream for decryption.THe stream contains decrpted data
CryptoStream cryptoStream = new CryptoStream(memoryStream, Decryptor, CryptoStreamMode.Read);
byte[] PlainText = new byte[EncryptedData.Length];
int DecryptedCount = cryptoStream.Read(PlainText, 0, PlainText.Length);
memoryStream.Close();
cryptoStream.Close();
//Converting to string
DecryptedData = Encoding.Unicode.GetString(PlainText, 0, DecryptedCount);
}
catch
{
DecryptedData = TextToBeDecrypted;
}
return DecryptedData;
}


For Encryption
public string Encry(string TextToBeEncrypted)
{
RijndaelManaged RijndaelCipher = new RijndaelManaged();
string Password = "CSC";
byte[] PlainText = System.Text.Encoding.Unicode.GetBytes(TextToBeEncrypted);
byte[] Salt = Encoding.ASCII.GetBytes(Password.Length.ToString());
PasswordDeriveBytes SecretKey = new PasswordDeriveBytes(Password, Salt);
//Creates a symmetric encryptor object.
ICryptoTransform Encryptor = RijndaelCipher.CreateEncryptor(SecretKey.GetBytes(32), SecretKey.GetBytes(16));
MemoryStream memoryStream = new MemoryStream();
//Defines a stream that links data streams to cryptographic transformations
CryptoStream cryptoStream = new CryptoStream(memoryStream, Encryptor, CryptoStreamMode.Write);
cryptoStream.Write(PlainText, 0, PlainText.Length);
//Writes the final state and clears the buffer
cryptoStream.FlushFinalBlock();
byte[] CipherBytes = memoryStream.ToArray();
memoryStream.Close();
cryptoStream.Close();
string EncryptedData = Convert.ToBase64String(CipherBytes);
return EncryptedData;
}



Prev Post                    All Post                           Next Post

Posted in | 3 comments

Unable to cast object of type 'ASP.type' to type 'ASP.type'. or Could not load file or assembly 'App_Web_xxxxxxxx, Version=0.0.0.0, Culture=neutral,

Problem :-
Unable to cast object of type 'ASP.type' to type 'ASP.type'.
or
Could not load file or assembly 'App_Web_xxxxxxxx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
 Solution :-
Both errors appear in ASP.NET application from time to time. There are some info about master pages, nested user controls related to this stuff. And hotfix from MS, usually. Not sure that hotifx helps, but you can try. Anyway, this error last till application automatic rebuild. So, you can just reupload/change some files of your project, and force rebuild. There are some notices that this error can occur weekly or even daily. Restart app every day is not looks good. Bad news. Avoid of master pages and user controls usage - is a bad idea. 
But immediate cause of this - incorrect automatic compiler work. So, to correct this error on production hosting, you can use precompiling.
The advantages of precompiling:


  1. You don't need to upload any source code on server. (Woo Hoo - hosting guys can't take your application)


  2. Above error not occurs, because source already compiled. (I recommend -fixednames option usage).


  3. Less delays because of recompiling.


  4. Small site size.
How to make your site precompiled (prepare for publish)? 
Let's start. First of all, locate this utility C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe (your path can be different because of windows directory). After that create a cmd-file with following content:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -fixednames -p d:\projects\web1\source\ -v / d:\projects\web1\build\
 
Some descriptions regarding this line:
     -p  sets physical path to your web site source
     -v  sets virtual directory where you want to publish your site ( / set the root of virtual directory, 99% that you don't need to change this )
     -fixednames binaries will be given fixed names
I'm suggest that this should be used only for production hosting, because in case of frequent updates... not very comfortable to work through build.

.


Prev Post                    All Post                           Next Post

Posted in | 2 comments

What is Store Procedure ? -- Store Procedure Advantages


What is Store Procedure?
Store Procedure is nothing but just a set of T-SQL statements combined to
Perform a single task of several tasks. It’s basically like a
Macro so when you invoke the Stored procedure, you actually
Run a set of statements.
In other Word We Can Say that Store Procedure is subprogram that performs a Specific task.
Advantages of Store Procedure
1.  Store Procedure are Faster because they eliminate the need of reparse
And reoptimize.
2.  Reduce Traffic.
3.  Store Procedure is Reusable Object.
4.  Performance and Easy of Maintain ace are to Good Point for Using Store Procedure
5.  They allow faster Execution because it’s in Pre-Compile Statement.
6.  We Can Execute SP in the SP.

PLEASE WRITE YOUR VIEW ON SP IN BELOW COMMENT BOX.


                 First page SP         Second Page SP         Third Page SP           Fourth Page SP

Posted in | 5 comments

Execute Store Procedure from Asp.net

Execute Store Procedure from Asp.net

In this Example I Show How to Set Parameter from Asp.Net application and execute Store Procedure from asp.net Application.
First Declare Private Variable for Store Procedure

private const string SP_USER_NEWDESG = "IDBadge_DesignationInsert";


Method to Set Parameter and Execute Store Procedure

public string Save_Designation(Desg desg_code)
    {
     
        // Execute SQL Command
        SqlCommand sqlCmd = new SqlCommand();
        AddParamToSQLCmd(sqlCmd, "@desg_code", SqlDbType.Int, 
256, ParameterDirection.Input, desg_code.desg_code);
        AddParamToSQLCmd(sqlCmd, "@desg_name", SqlDbType.NText,
256, ParameterDirection.Input, desg_code.desg_name);
        SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_USER_NEWDESG);
        return ExecuteScalarCmd(sqlCmd);
        
    }
  
private void AddParamToSQLCmd(SqlCommand sqlCmd, string paramId, SqlDbType sqlType, 
int paramSize, ParameterDirection paramDirection, object paramvalue)
    {
        // Validate Parameter Properties
        if (sqlCmd == null)
            throw (new ArgumentNullException("sqlCmd"));
        if (paramId == string.Empty)
            throw (new ArgumentOutOfRangeException("paramId"));

        // Add Parameter
        SqlParameter newSqlParam = new SqlParameter();
        newSqlParam.ParameterName = paramId;
        newSqlParam.SqlDbType = sqlType;
        newSqlParam.Direction = paramDirection;

        if (paramSize > 0)
            newSqlParam.Size = paramSize;

        if (paramvalue != null)
            newSqlParam.Value = paramvalue;

        sqlCmd.Parameters.Add(newSqlParam);
    }
  private string ExecuteScalarCmd(SqlCommand sqlCmd)
    {
        string result = "";
        using (SqlConnection cn = new SqlConnection(this.ConnectionString))
        {
            try
            {
                cn.Open();
                sqlCmd.Connection = cn;
                result = Convert.ToString(sqlCmd.ExecuteScalar());
                return result;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }
        
    } 
 
 
PLEASE WRITE YOUR VIEW ON SP IN BELOW COMMENT BOX.
 
 
  
 
 First page SP   Second Page SP   Third Page SP      Fourth Page SP 




Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Store Procedure Example (Select Statement with Passed Query as Parameter)


Store Procedure Example (Select Statement with Passed Query as Parameter)
In this Example I Show how to Write Store Procedure for Search Engine. in @query parameter you need to pass full Filter Section. Below Shown Simple example.
CREATE PROCEDURE IDBadge_RptEmployeePointSummaryReport
@query varchar(200)
AS
declare @filter nvarchar(1000)
select @filter = '
select count(ep.uid) as tot,p.point_type_name
from
employee_point as ep,
point_type_master as p
where p.point_type_code = ep.point_type_code
and  0=0 ' + @query
+' group by point_type_name'
exec (@filter)
GO
                                              
This Store Procedure return Datatable So in Programming Side you Need to handle that Datatable.


PLEASE WRITE YOUR VIEW ON SP IN BELOW COMMENT BOX.



                 First page SP         Second Page SP         Third Page SP           Fourth Page SP

Posted in | 0 comments

Store Procedure Example (How to Write Simple Store Procedure)

Store Procedure Example (How to Write Simple Store Procedure)

Here I Show How to Write Simple Store Procedure. Support there is table name with print_queue
Which has a column name badge_id and print_given_date.
Now you want to insert badge_id and print_given_date in table. Following Example Show how to Write Simple Insert Store Procedure.


CREATE PROCEDURE IDBadge_Insert_PrintQueue
@badge_id varchar(8),
@print_given_date datetime

AS
                  insert into print_queue
                          ( 
                          badge_id,
                          print_given_date
                           )
                         values
                          (
                         @badge_id,
                        @print_given_date
                         )

GO

In this Example you need to pass badge_id and Given_date value 
your Programming. 
 
 
PLEASE WRITE YOUR VIEW ON SP IN BELOW COMMENT BOX.
  
 
 
  First page SP      Second Page SP      Third Page SP      Fourth Page SP


Posted in | 0 comments

GridView Row Color

GridView Row Color :-

There is often required to changed display color of gridview.For Example some time it required’s that in Product detail we need to display Expired product row by red Color.It Can be possible in Gridview by RowDataCommand Event.
Here Example Shown in Which if Product is Active then LightGreen Color Shown Else Normally Color Display Which We Select in Gridview
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.BackColor = System.Drawing.Color.White;
// determine the value of the UnitsInStock field
LinkButton link_active = (LinkButton)e.Row.FindControl("link_active");
if (link_active.Text == "")
{
e.Row.BackColor = System.Drawing.Color.LightGreen;
}
}











Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Why do I get the error message "Server Application Unavailable The web application you are attempting to access on this web server is currently ....

Why do I get the error message "Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request."?

By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) to provide a more secure environment. On a domain controller or on a backup domain controller, all user accounts are domain accounts and are not local machine accounts. Therefore, Aspnet_wp.exe fails to start because it cannot find a local account named "localmachinename\ASPNET". To provide a valid user account on the domain controller, you must specify an explicit account in the section of the Machine.config file, or you must use the SYSTEM account.

Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Not Use Try Catch More

There are Lot's of Try Catch Used by Developer When developing a Site.
developer's inefficiently to Use more Try Catch on the Web site.
Instead Of Try Catch use Using Blog.
By Using Instead of try Catch Objects are directly Dispose.So you Not Need to
Separately Dispose all objects.

What are you Saying ??



Prev Post                                                      All Post                                                           Next Post


Posted in | 1 comments

Submit form when user press enter key on dropdownlist box

Submit form when user press enter key on dropdownlist box


This function will help to submit form when user press enter key at dropdownlist box.


//if enter key pressed at DropDownList

function onEnterpress(e)
{
//define any varible
var KeyPress
//if which property of event object is supported
if(e && e.which)
{
e = e
//character code is contained in NN4's which property
KeyPress = e.which
}
else
{
e = event
KeyPress = e.keyCode
}
//13 is the key code of enter key
if(KeyPress == 13)
{
//frmLogin is the name of form
document.frmLogin.submit()
return false
}
else
{
return true
}
}

After this just add the event in your code file at pageLoad like is:

Your code file may be in VB.NET or C# so you may add even like this.


ddlDropDownList.Attributes.Add("onKeyPress", "javascript:onEnterpress(event);")
Event is the name of event pressed by user at keyBoard Key.
ddlDropDownList is the name of dropdown on which we want to add event.

Prev Post                                                      All Post                                                           Next Post



Posted in | 1 comments

Connection String SQL Server 2005 With Various Data Provider




The following is a list of database connection strings to use with various Sql Server data providers. Cut and paste the connection string to use within your application. For connection strings that require a servername, username and password.



·    ODBC: 
  • Driver={SQL Server}; Server=your Server name; Database=DBname; Uid=’your uid’; Pwd='your password';  
  • OLE DB, OleDbConnection (.NET):
  • Provider=sqloledb; Data Source= your Server name; Initial Catalog= DBname; User ID=’your uid’; Password='your password';
  • SqlConnection (.NET):
  • Data Source=your server name; Initial Catalog=DB name; User ID=’your uid’; Password='your password';

Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Flash Embeded In Asp.Net (Flash Movies In Asp.Net)



Flash Embedded in Asp.Net :-

After creating a Flash movie you choose File -> Save As from the top menu to save your movie. Save the file as "Somefilename.fla".
To embed the Flash movie you just made into an Asp.Net page, you should go back to your Flash program and do the following steps:
Step 1
Choose File > Open. Open a Flash movie you have created.
Step 2
Choose File > Export Movie.
Step 3
Name the file "somefilename.swf". Choose the location where the file is to be stored (in your Web folder). Click OK.
Step 4
Open the ASPX Code Page where you want to insert your Flash movie. Insert this code:


<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">

</embed>
</object>


Note: This is the minimum code you need to embed a Flash movie in a browser. A broken icon will appear on the Web page if the user does not have the Flash plug-in installed.
 

Step 5
Type in the address of the HTML file in your browser and look at your first Flash movie.


Prev Post                                                      All Post                                                           Next Post




Posted in | 2 comments

ASP.NET Regular Expression for date format

In ASP.Net Many times required to Validate Date Fromat Enter in Control.
in Regular Expression Following RE used to Validate Date Format.


dd/mm/yyyy Format In regular Expression    (optional mm,optional dd)
([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$


mm/dd/yyyy   (optional mm,optional dd)
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9]|3[01])[- /.][0-9]{4}$

mm/dd/yyyy  (Exact Format)
^([01]\d)/([0-3]\d)/(\d{4})$


Prev Post                                                      All Post                                                           Next Post

Posted in | 3 comments

Invalid postback or callback argument,Asp.Net 2.0

Problem :-

Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.


Solution :-


It’s Common Problem With Asp.Net 2.0 (Microsoft Professional Edition,Beta Version Not Give an Error.) To Solve This Problem What You Have to Do Just Write Following Code in Web.Config.
<system.web>
<
pages enableEventValidation="false"/>
system.web>
Doing this One It’s Solve Your Problem But It’s Effect On Your Site Security. Basically EnableeventValidation of asp.Net pages are ture.Wich Prevent Injection Attack.Make it’s False Involve This Injection Attack.

Prev Post                                                      All Post                                                           Next Post

Posted in | 2 comments

GridView

->  The Gridview Is Very Power full Server Control to Display Data From Data Source.

-> DataGrid is Very easy to use and Flexible Control.

-> You Can Use Inbulit format which Provide by GridView Or you Can Also dispaly Gridview as You Likes.

-> You Can Perform Any Action With Gridview Data (edit,Delete,Add ,ect ...)

-> You Can Use Itemtemplet To dispaly Data In formated Manner.Or Used Any Control in Gridview.

-> Gridview is easy to used and Provide many Facility Like PageIndexchannging Which Difficult in DataList but Gridview make it's easy.

-> You Can make Any Good Formating in Header and Footer Or also Can Add Custom 2-3 Header By making code in ItemCreated Events.

-> Simple Exmaple to Bind a Gridview

    con.Open();
        DataSet data = new DataSet();
        SqlDataAdapter sda = new SqlDataAdapter("select * from tbale_name", con);
        sda.Fill(data);
        dl_saved_can.DataSource = data;
        dl_saved_can.DataBind();
        con.Close();
 
PageIndexChanging Event
 
 
        grd_forward_you.PageIndex = e.NewPageIndex;
        Bind_Grid(); //Bind Data


This Is Just simple example How Ever you can do anything with gridview data And also 
Dispaly data In Professional Style.


What you Say About Gridview ??

Prev Post                                                      All Post                                                           Next Post




Posted in | 2 comments

What IS IL ??

Intermediate Language is also known as MSIL (Microsoft Intermediate Language) Or CIL (Common Intermediate language).All .Net Source Code is Complied to Intermediate Language, This IL is then converted to machine code at the point where the Software is installed or at run-time by a just-In_time Comiler

(From .Net Interview Question  - Koirala)


MSIL Is the lowest level human readable Programming language in common Language Infrastructure and in .net framwrok.

What you Say About IL ??

Prev Post                                                      All Post                                                           Next Post

Posted in | 0 comments

Custom Error Handling in ASP.Net

Custom Error Handling in ASP.Net

There are often Required to Handle Error (Not Try Catch Handling) 
Which Mostly Genertaed by Server and Need to give
Custom Message on Page.And you Can Save This Error in EventView 
or You can Send mail to Administrator About
this Erorr Generated on Server.


In ASP.net 2.0 This Can be Done by making Small Changes in Web.Config,
Global.Aspx and One Error Page.



First Generate One Error Page Which Give User Friendly Message like


              We are very sorry for the inconvenience 
caused to you...

Second in Global.Aspx in Application_Error Section Generate One Event Log
Or you Can Mail Error 
to Administrator.

 void Application_Error(object sender, EventArgs e) 
    {
            // Code that runs when an unhandled error occurs
            Exception ex = Server.GetLastError();
            String errordescription = Server.GetLastError().ToString();
            string eventlogname = "Software_Error";
            if (EventLog.SourceExists(eventlogname) == false)
            {
                EventLog.CreateEventSource(eventlogname, eventlogname);
            }
            EventLog Log = new EventLog();

            Log.Source = eventlogname;
            Log.Clear();
            Log.WriteEntry(errordescription, EventLogEntryType.Error);

            //Here you Can Write Mail Message Coding Also
    }



In Web.Config Change CustomError mode on And ErrorPages to Your Error Page

< customErrors defaultRedirect="error.aspx" mode="On" / >


Prev Post                                                      All Post                                                           Next Post



Posted in | 1 comments

Upload File On A Server. (Code For File Upload On A Server ASP.net)

Upload File on Server.

 public void upload_cv()
    {
        if ((Resume_Upload.ToString().Trim() != ""))
        {
            string UploadPath = "";
            string encry_path = "";
            string file_name = "";
            string file_extension = "";
            file_name = Resume_Upload.PostedFile.FileName.ToString();
            file_name = file_name.Substring(file_name.LastIndexOf(@"\") + 1);
            file_extension = file_name.Substring(file_name.LastIndexOf(".") + 1);
     if ((file_extension.ToString().ToUpper() != "DOC") 
|| (file_extension.ToString().ToUpper() != "PDF") || 
(file_extension.ToString().ToUpper() != "RTF") ||                  
     (file_extension.ToString().ToUpper() != "TXT"))
            {
          
                try
                {
         //Upload file on A Specific folder.

    UploadPath = Server.MapPath(Request.ApplicationPath + @"\upload\");
     
     Resume_Upload.PostedFile.SaveAs(UploadPath + file_name + "." + file_extension);
                        }
                    
               catch (Exception ex)
                    {
                        lbl_error.Text = ex.ToString();

                    }
             }
        else
        {
            lbl_error.Text = "Please Upload MS Word file(.doc) only";


        }
    }}




Just Call Above Function.On Some Event.HowEver You Can Also Make Security tricks to protect your file From hacker For that you Can Make File name Encrypted.


Enjoy !!!!!!!!!1

Prev Post                                                      All Post                                                           Next Post



Posted in | 0 comments

Site Map







Invalid post back or callback argument,Asp.Net 2.0

 

Grid view


What is IL ?

 

Custom Error Handling in ASP.Net
 
Upload File on Server. (Code for File upload  in ASP.Net)
 
Connection String :- Asp.net Application with MS Access
 
Dynamic change URL of Web Service
 
ASP.Net Problems and Solution :-
 
            invalid parameter accessor: 1 BADBINDINFO.
                  CrystalReport 10.0 Dynamic Image Display Problem 
 
Date Time Format In SQL Server and MS Access.
 
Encrypting and Decrypting Configuration Sections in   web.config
 
Encryption and Descryption class in Asp.Net
 
Treeview Example in Asp.Net 2.0
 
Tab control in Asp.net Without third Party control 
 
Open child Window From Parent Window using Java script and on closing refresh.
 
Maintain Check box State in Grid view While Paging in Asp.net
 
Desktop Application run from Web Application on Server and Pass Arguments.
 
Sending email using Asp.Net 2.0
 
Merge Cell In grid view Header in Asp.net 2.0 
 
Highlighting the current menu item From Collection of menu  Items
 
Coding to Populate State and city According to State Selection Without Postback
 
Convert Image to byte array and  byte array to image in Asp.net
 
Bookmark in Asp.Net
 
Submit you Idea
 
Ask Your Question 
 
Share Good Documents


 

Posted in | 0 comments