May 31, 2013
Dec 15, 2011
How to restore database when database was suspect
Kalpesh Satasiya
5:12 PM
ahmedabad, cursor in sql server, software developer, software development, sql server database suspect, suspect database, web developer, web development
3 comments
ALTER DATABASE DataBaseName SET EMERGENCY
DBCC checkdb(DataBaseName)
ALTER DATABASE DataBaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (DataBaseName, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE DataBaseName SET MULTI_USER
Sep 22, 2011
How to call server side function using JQuery in Asp.net
Kalpesh Satasiya
3:04 PM
ahmedabad, asp.net, Call server side function using Jquery, jquery, software developer, software development, web developer, web development
No comments
-------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Call server side method using Jquery</title>
<!-- Add the jQuery Reference Library-->
<script src="Script/jquery-1.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$('#btnok').click(function() {
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="button" />
<span id="status"></span>
</div>
</form>
</body>
</html>
Code Behide file code (Default.aspx.cs)
-----------------------------------------
Aug 24, 2011
Sometimes Page load event not firing in asp.net
Kalpesh Satasiya
4:22 PM
ahmedabad, caching page, event not work, india, page load, page load event, software developer, software development, web developer, web development
No comments
The reason for the page executing doesn't affect the page cycle, the Load event always fires when the page is executed.
So, if the Page_Load doesn't run sometimes, it's because the page is cached and doesn't execute on the server. The page can be cached in the browser, in a router somewhere along the way, or on the server using server side page caching.
If you haven't enabled server side page caching for the page, it's cached in the browser or in the network. You can use cache settings to try to elliminate this:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Aug 4, 2011
Excel Data Reader - Read Excel files in .NET (Convert Excel data to DataTable using Asp.Net)
Kalpesh Satasiya
5:56 PM
ahmedabad, convert excel to datatable, import excel file, india, software developer, software development, web developer, web development
No comments
//1. Reading from a binary Excel file ('97-2003 format; *.xls)
IExcelDataReader excelReader =ExcelReaderFactory.CreateBinaryReader(stream);
//... //2. Reading from a OpenXml Excel file (2007 format; *.xlsx)
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
DataSet result = excelReader.AsDataSet();
//... //4. DataSet - Create column names from first row
excelReader.IsFirstRowAsColumnNames = true;
DataSet result = excelReader.AsDataSet();
//5. Data Reader methods
while (excelReader.Read()) { //excelReader.GetInt32(0); }
//6. Free resources (IExcelDataReader is IDisposable) excelReader.Close();
I hope help to you.