Thursday, 18 July 2013

Display combobox values from database

hi friends in this section i cover read data from database and display it on combobox using ext.net.
if you dont know session statement read our session tuts.









The procedure shown in the below ie.
first insert combobox and SqlDataSource into the project

 <form id="form1" runat="server">
    <div>
             <ext:ComboBox ID="dreamtheweb" runat="server" AnchorHorizontal="100%" DisplayField="name"
                                         ValueField="id" FieldLabel="Country">
                                    <Store>
                                        <ext:Store ID="sestore1" runat="server" DataSourceID="SqlDataSource1">
                                            <Model>
                                                <ext:Model ID="Model1" runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="id" />
                                                        <ext:ModelField Name="name">
                                                        </ext:ModelField>
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                  
                                </ext:ComboBox>
       
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:testing %>"
            SelectCommand="SELECT * FROM [country] ">
        </asp:SqlDataSource>

    </form>
Insert connection string testing in web.config file
<connectionStrings>
        <add name="testing" connectionString="Data Source=jishnu\sqlexpress;Initial Catalog=gatikktechno;Integrated Security=True;Pooling=False"/>
    </connectionStrings>
Database definition
 id-integer type
name-varchar(50)

Asp.net Session With Example

Here i explain asp.net session using c#.
Session state is mainly used to transfer values from one page to other without storing/retrieving  values from database.
In this tutorial two files one is first.aspx and other is second.aspx.

first.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="first.aspx.cs" Inherits="dreamtheweb.first" %>

<!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 runat="server">
    <title>Untitled Page</title>
</head>
<body>
   <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server">Fname</asp:TextBox>
 <br />  <br />        <asp:TextBox ID="TextBox2" runat="server">lanme</asp:TextBox>
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
  <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_click" />        <br />
   </div>
    </form>
</body>
</html>
first.aspx.cs page
Add  session statement inside button click ie,
  protected void Button1_click(object sender, EventArgs e)
        {
            Session["fname"] = TextBox1.Text;
            Session["lname"] = TextBox2.Text;
            Response.Redirect("second.aspx");
        }

The second.aspx page 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="second.aspx.cs" Inherits="dreamtheweb.second" %>

<!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 runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>

For accept session values insert the below code in pageload section ie
protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = Session["fname"].ToString();
            Label2.Text = Session["lname"].ToString();
          
             
            }
If you enjoy and work this post please support this blog and visit again

Friday, 28 June 2013

Working with Adobe illustrator for beginners Part 3- Artboards



 1: Artboard Working Area.
 2. Artboard Control panel.
 3. Navigation Tools.
 4. It also a part of navigation tools .
 5. Artboard Tool.
 6. Artboard Preset .
 7. Artboard Name

Artboards is a region for creating graphics work . It can be created using 2 way , one is specify artboards in new document dialog box and the second one is using Artboard tools ( in fig, no 5 is Artboard Tool). in a tool panel . You can also created by using Artboard Pannel( in fig, no 2 is Artboard panel). If you select Artboard tools from tool box , Everything outside the Artboard working area appears dark and dashed lines appears on Artboard (see fig:) . Artboard control panel shows all Artboards you created ,if your Artboard panel is hidden you can access it through Window menu .You can do Show or hide artboard,resize ,delete and switch to specific Artboard etc operations in Artboard Panel. For viewing purpose either in Outline mode or preview mode it can be done by just click Ctrl+Y . My next post is creating ,selecting and modifying shapes using Tools, So dont forget to subscribe dreamtheweb.com and visit daily ... Thank you .......

Best 3 blogger templates top download 2013

1.Revolution Church

  • Template Designer-Brian Gardner
  • wordpress templates converted into blogger templates .
  • Developer -Bloganol
  • 486x60 Ads ready
  • SEO friendly templates.

>> Download this templates
>> View Demo

2. labnol


3.Estyle


create a simple program usig php variable

Hello friends yesterday I told about how to install Apach using XAMPP Server .You can easy access your files via http://localhost/phpmyadmin/programname.php   If your file is in PhpMyAdmin Directory.
Also you can access your file via http://localhost/phpmyadmin/foldername/programname.php  If your file is saved in Your own folder, The second method is very usefull for creating  a php based projects.
Let start to create a simple program usig php variable.
<html>
<head>
<title>My First Php Program</title>
</head>
<body>
<h2>Demonstrates using General H1 Tage</h2>
<div><h3>dreamtheweb.com </h3>
<h2>Demonstrates using a variable</h2>
<div>
<?php
$name= "dreamtheweb.com";
print "welcome to, $name";
?>
</div>
</body>
</html>
Save it as myphpprogram.php
out put

The line $name = “dreamtheweb.com”;  does two major  things. First it creates a new variable named
$name and the  second is it will assign the value “dreamtheweb.com”  to the variable. In PHP Language , all variables start  with a $ (dollar sign ) and the  The variable’s name is user defint one except some rools.  The assignment symbols (=) is generally used for assignment operations.
The next one is printing a variables value ,If you want to print the value of a variable, simply place the variable name in the text you want printed.
Ie  following line:
print “welcome to , $name”;
It actually produces the  output:
Welcome to, dreamtheweb.com  (Look  fig  ph1) That its.
The next section  we will discuss about displaying  word or text using somr other way …
So please  keep dreamtheweb.com daily …