...
Sunday, June 16, 2013
show or hide div in jquery with example
How to Show or Hide div's using jQuery
Show DIV in jquery
jQuery('div').show(); --- Displays all the div's
jQuery('#thisdiv').show(); ---- Displays a div having the id as thisdiv
jQuery('#thisdiv div').show(); ---- Displays all the div's inside the div having the id thisdiv
Hide DIV in jquery
jQuery('div').hide(); --- Hides all the div's
jQuery('#thisdiv').hide(); ----...
Monday, June 3, 2013
Get or Set Http Cookies in server side of C# on Asp.Net Website
Set and Get Cookies
Get Cookie
Sample Code
HttpCookie myCookie = new HttpCookie("sampleCookie");
SampleCookie= Request.Cookies["sampleCookie"];
// Read the cookie information and display it.
if (SampleCookie!= null){
string value= SampleCookie.Value;
string name=...
Saturday, June 1, 2013
static vs instance members in C Sharp
Static Versus Instance Members in C#
By
default, members are per instance
Each instance gets its own fields
Methods apply to a specific
instance
Static
members are per type
Static methods can’t access
instance data
No this
variable in static methods
Static methods
public class Area
{
private int side;
public Rectangle(int side)
{
this.side= side;
}
public void Area()
{
...
Friday, May 31, 2013
hasclass in jquery with example
JQuery hasClass() for single and multiple Class
The general syntax for hasClass is as follows
Check single Class
$("selector").hasClass("ClassName")
It will return true if the class is exists else return false
Check Multiple Classes
$("selector").hasClass("ClassName1 ClassName2 ClassName3")
<html>
<head>
</head>
<body>
<input class="found" type="button" value="Found" />
<input class="notfound" type="button" value="Not Found" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(".found").click(function(){
if($(this).hasClass("found"))
...
Thursday, April 25, 2013
How to create a data set
How to create a data set
Create your dataset and table adapter1. Create your frame 2. Drop a Data Grid View control3. Create a Dataset (xsd) File.4. Open your xsd file. 5. Drag the table that you want to work with from the server explorer. Your table and table adapter will be created.If
you click the Table Adapter and check its properties you will see that
the select, insert, update and delete command are automatically
generated....
Tuesday, April 16, 2013
Filter Data in DataSet using C#
How to filter Data in DataSet
DataView Class is used to filter and sorting of data in Data Set
Here I m giving an example of how we can filter and sort data in data set.
DataView: A DataView is used to create different views of the data stored in a DataSet of DataTable
I am using following sqlserver database table in my example. Create a table using this script
CREATE TABLE tbemp
(
eno int NULL ,
ename varchar (50) NULL,
eadd varchar (50) NULL,
...
Looping through DataSet in C#
To loop through DataTable, try this
if (datatable1 !=null)
{
foreach (DataRow dr i datatable1.Rows)
{
string text1 = dr["Column1Name"].ToString();
string text2 = dr["Column1Name"].ToString();
// and so on
//You can also set your Literal cotrol as
}...
Dataset Data set Dataset in C-sharp Dataset C-Sharp example Dataset in .net
DataSet
is a collection of DataTables.
We use the DataSet type to store many DataTables in a single collection.
Conceptually, the DataSet acts as a set of DataTable instances.
This simplifies programs that use many DataTables.
DataTable
Create
To effectively use the DataSet, you will need to have some DataTables handy.
In this program, we create two DataTables.
One stores two rows of patient information.
And the second stores two...
Convert DataSet to DataTable
A DataSet already contains DataTables. You can just use:
DataTable firstTable = dataSet.Tables[0];
or by name:
DataTable customerTable = dataSet.Tables["Customer"];
Note that you should have using statements for your SQL code, to ensure the connection is disposed properly:
using (SqlConnection conn = ...)
{
// Code here...
...
Sunday, April 7, 2013
dataset to excel c#
here is the solution for that.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
using Microsoft.Office.Interop;
private void btn_ETexcel_Click(object sender, EventArgs e)
{
Microsoft.Office.Interop.Excel.ApplicationClass ExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
ExcelApp.Application.Workbooks.Add(Type.Missing);
ExcelApp.Columns.ColumnWidth...