Wednesday, November 12, 2014

Creating A Sample Table In Sql server



1.Right click on the tables and new table

2.Creating a sample database with the 3 column name,email id,password
Make a  first column as a unique so here we have make it as int and autoincrement
Expand the identity specification and make a no to yes in the (Is Identity)
This will set the column the start from 1 and increment by 1 so it will always create a new value automatically

3.Now comes to next column
Name,email,password there is various data types like so select the appropriate type as per your need 

4. then click on the save it will ask for a popup says table name and write the table name over there and click on save

How To Use UpdatePanel in Asp.net / How To Prevent PostBack Of Page Using Update Panel /How To Refresh The Particular Section Of The Page in Asp.net Using Update Panel



1 & 2 We will see the demo of the update panel
Try with this code
<form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="scriptmanager"></asp:ScriptManager>
    <div>
    <asp:Label ID="lbltime" runat="server"> </asp:Label>
    <asp:Timer ID="tmr" runat="server" Interval="1000" ontick="tmr_Tick"></asp:Timer>
    </div>
    </form>

  protected void tmr_Tick(object sender, EventArgs e)
    {
        lbltime.Text = DateTime.Now.ToString();
    }
Here we display the current time in the label and refreshing the page every time when you run this code you will see that page is refreshing automatically and whole control initialize again
So here we stop refreshing the page and only refresh the label without affecting the page

So we will use the update panel





3.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
//write here the code
    </ContentTemplate></asp:UpdatePanel>

Just doing this you can see that the page is not refreshing but only the control is refreshing itself

now run the page



How To Use UserControl in Asp.net



1.  Right click on project add new item

2.  Select web user control

3.  Place your code there here I have make a simple addition then Drag and drop the control in the page(in design view) and run the page

4.  Run the page in the browser