Showing posts with label notes. Show all posts
Showing posts with label notes. Show all posts

Friday, 1 February 2013

How to Bind Hyperlink control in asp.net


(1)Bind Image Control using SqlDataReader class
Database Table Design diagram:
ImageControl
Database Table Query Design:
ImageQuery
Record view of the Table
Table record

Step-1 : Drag and Drop Hyperlink control from ToolBox to Design window
hyperlink
Set property of the label control
Id= hypercontrol
Step-2: Open .CS file(code behind or logical file)
Add one namespace in your .cs
(a) using System.Data.SqlClient:
According to microsoft msdn network “The.NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space.”

namespace

Step-3 Make connection to the MSSqlServer using SqlConnection Class
//So first we need to create object of the SqlConnection class
SqlConnection con = new SqlConnection();
//Through this object , call ConnectionString property of SqlConnection class
//and assign connectionString which is contain four required parameter such as
//Servername,Databasename,userId,Password
con.ConnectionString = @"Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WebSite16-20130119213411;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WebSite16-20130119213411.mdf";
//here use “@” for single backslash if you want without “@” sign then use double backslash in your connection string
//After assign connection string to Sqlconnection object. Call Open() method of SqlConnection class
con.Open();
//Perform Your DQL(select method) Query using SqlCommand class so first we need to create object of this class
SqlCommand cmd = new SqlCommand();
//Write your Select query using where condition and Assign to CommandText Property of SqlCommand class
cmd.CommandText="select * from [Table_name] where sno=1";
//After that connect your command with Sqlconnection so assign con instance to command object
cmd.Connection=con;
//Take SqlDataReader class for reading Sql data
//Call ExecuteReader() method (only for DQL Queries) for SqlDataReader class
 rd = cmd.ExecuteReader();
//after that use read() method for reading all data and assign to image control
 while (rd.Read())
        {
           hypercontrol.NavigateUrl = rd["Photourl"].ToString()+"<br/>";
 
        }http://www.careersoft-technology.com/how-to-bind-hyperlink-control-in-asp-net/

Diffrence between static and dynamic hashing


STATIC  HASHING :                                                                                      DYNAMIC  HASHING:     
  • Numbers of buckets are fixed.                                                         Numbers of Buckets are not fixed.
  • As the file grows, performance decreases.                                 Performance donot degrade as the file grows.
  • Space overhead is more.                                                                     Minimum space lies overhead.
  • Here we donot use Bucket  Address table.                                   Bucket address table is used.
  • Open hashing and Closed hashing are  forms of it.                   Extendable hashing and Linear hashing are  forms of it.
  • No complex implementation.                                                            Implementation is comlex.
  • It is a less attractive technique.                                                         It is a highly attractive technique.
  • Here system directly accesses the Bucket.                                    Here the Bucket address table is accessed before accessing the Bucket.
  • Chaining used is overflow chaining.                                                 Overflow chaining is not used
Note:
BUCKET: It is similar to Disk Block. Several items are stored in it.
BUCKET OVERFLOW: This is a condition which arises due to lack of enough space in bucket at the time of insertion.
OVERFLOW CHAINING: It is used in static hashing.It is a method used to compensate the problem of bucket overflow.
BUCKET ADDRESS TABLE: It is the table that keeps the address of  buckets.