Tuesday 25 September 2012

Stack Operation using C Language


Stack......
a stack is an area of memory that holds all local variables and parameters used by any function
One way of describing the stack is as a last in, first out (LIFO)
The push operation adds a new item to the top of the stack, or initializes the stack if it is empty
 If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state. The pop operation removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, but if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed)


Stack Operation Using Single Link List 

#include<stdio.h>
#include<conio.h>
typedef struct st_stack
{
int data;
struct st_stack *next;
}stack;
/* Function Prototype */
stack* create(int);
void push(stack**,int);
void pop(stack**);
void print(stack*);
void main()
{
stack *start=NULL;
int n,s,opt;

Monday 24 September 2012

Singal Link List Operation using C Language


In computer science, a linked listis a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any position in the sequence.
#include<stdio.h>
#include<conio.h>
typedef struct st_tag
{
int data;
struct st_tag *next;
}node;
/* Function Prototype */
node* create(int);
void addbegin(node**,int);
void addlast(node**,int);
void addbefore(node**,int,int);
void addafter(node**,int,int);
void del(int,node**);
void print(node*);
void main()
{
node *start=NULL;
int n,s,opt;

Saturday 22 September 2012

Database operation ASP.net using SQL Server 2000


The ADO.NET architecture is designed to make life easier for both the application developer and the database provider. To the developer, it presents a set of abstract classes that define a common set of methods and properties that can be used to access any data source. The data source is treated as an abstract entity, much like a drawing surface is to the GDI+ classes.


Controls :
  • Three Textbox
  • Three Button
  • One GridView
  • SqlDataSource




Setting Gridview : 
  • Add Gridview select auto format if you want to use available style for gridview select a style click ok
  • Choose data source select < New Data source.. >
  • Select Database from Configuration Wizard 
  • Click New Connection and change database type from Add Connection wizard
  • Choose SQL Server click ok
  • Enter Server name I have have used . for local client server
  • Select Database Click ok
  • Select check your connection string and click next
  • Select your table and fields which you want to show on Gridview
Coding :
 SqlConnection con;
    SqlCommand com;
    protected void Page_Load(object sender, EventArgs e)
    {
        con = new SqlConnection("initial catalog=bsw;data source=.;integrated security=true");
        com = com = new SqlCommand();
        com.Connection = con;
    }

Timer In ASP.Net Using AJAX

With the help of AJAX we can postback an specific  part of a web part.
Normally when we click on a control which has capability to postback its load entire
page which time and data consuming both.You can save your time and data cost both
With Ajax
Controls..

  • ScriptManager
  • UpdatePanel
  • Timer
  • Label
ASP Source code *.aspx


<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
            </asp:Timer>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
Server side code *.aspx.cs


public partial class _Default : System.Web.UI.Page
{
    static int i;
    
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        i++;
        Label1.Text = i.ToString();
    }
}