Thursday, March 8, 2012

ASP.net File Uploader Unknown Server error: Resolved

In Asp.net file uploder(synchronous ,asynchronous) we normally set the

<httpRuntime executionTimeout="600" maxRequestLength="512000">

maxRequestLength = my max file size (KB)
but When I upload the file bigger than 30 MB then I got flowing error


reason is IIS 7.5 by default not allow uploading file bigger than 30MB .
so you have to override the flowing IIS setting in <system.webServer  section

<security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000" />
      requestFiltering>
security>
 

524288000 ==my max file size. (KB)

Entity Framwork - Insert Object


VB

Imports System.Data.Objects

 1)Dim context As New Entities
 2)Dim educationName As String = "English"
 3)Dim insertingObject As Education =
 4)context.Educations.FirstOrDefault(Function(c) c.EducationName = educationName)

 5) If insertingObject Is Nothing Then
 6)   Dim newEducation As New Education
 7)   newEducation.EducationName = "English"

 8)   newEducation.EducationDescription ="English Decription"        
 9)   context.Educations.AddObject(newEducation)
10)   Dim result = context.SaveChanges()
    End If


let see what abve code

Let’s say you want to insert new education into education table
Fist create object form current context
3,4 check the inserting object already exists  if not insert the object to Educations collections.
context.SaveChanges() means save modification to the data base permanently
Result >0 means no error successfully inserted.




C#

using System.Data.Objects


string educationName = "English";
Entities context = new Entities();

Education insertingObject = context.Educations.FirstOrDefault(c => c.EducationName == educationName);

if (insertingObject == null) {
 Education newEducation = new Education();
 newEducation.EducationName = "English";
 newEducation.EducationDescription = "English Decription";
 context.Educations.AddObject(newEducation);
 dynamic result = context.SaveChanges();
}

Sort List


Sort the list (T) according to the value in (T)

Dim mygrdeList As List(Of MyGrade) = item.Value    ' assing the value to list
                mygrdeList.Sort(Function(x, y) String.Compare(x.GradeModule, y.GradeModule))














 This article is about the type of website. For other uses, see Wiki (disambiguation).
Ward Cunningham, the developer of the first wiki software, WikiWikiWeb
A wiki (Listeni/ˈwɪki/ WIK-ee) is a website whose users can add, modify, or delete its content via a web browser using a simplified markup language or a rich-text editor.[1][2][3] Wikis are typically powered by wiki software and are often created collaboratively by multiple users. Examples include community websites, corporate intranets, knowledge management systems, and notetaking.
Wikis may serve many different purposes. Some permit control over different functions (levels of access). For example, editing rights may permit changing, adding or removing material. Others may permit access without enforcing access control. Other rules may also be imposed for organizing content.
Ward Cunningham, the developer of the first wiki software, WikiWikiWeb, originally described it as "the simplest online database that could possibly work."[4] "Wiki" (pronounced [ˈwiti] or [ˈviti]) is a Hawaiian word meaning "fast" or "quick".[5]