Friday, August 30, 2013

DataBinding in windows Forms in using

Title:Data binding for windows form using C#

Data Binding is the concept if providing address of memory location to a control for presenting data.This will reduce coding burden on developer and makes development faster.Below image can give the brief idea on it
Each window for will maintain binding context component.Binding context component will manage currency manager components,Currency manager will maintain record pointer to data-set table,it supports navigation and manipulations,It will place data into Bound Control.
Here the currency manager acts like mediator  between  bound control and memory block

There are two type of data binding con concepts,
1.Simple data binding
2.Complex data binding

Using Simple data binding,control can be bind to only single element.Complex data binding can be bind to more than single element

Tuesday, August 27, 2013

How to use For loop in

In this articles i will show how to use looping statement in this examples A program to add to textBox at run time. Here i placed one button to perform click event.
code for button click
int x=30;
for(int i=1;i<=10;i++)
{TextBox txt=New TextBox();
txt.Location=New Point(100,x);
In the above code i created 10 text box using for loop condition.The for loop condition takes maximum iteration up to 10 which i was given at condition

Wednesday, August 14, 2013

Datasource Controls in

The data source controls are available from 2.0(Not bound controls).Using this controls we can automate the task of creating data object.Normally we have to prepare data object programatically(using code).Whenever use these controls we may get some question regarding wizard approach features then one programmatic object will be created most importantly these controls provide complete customization options.The following data source controls are available in

1.SQL Data source control
2.LINQ Data source control
3.Object Data source control
4.XML Data source control entity framework Data source control

1.Sql Data source control:
it is used to prepare data object from any SQL supported database Oracle,SqlServer,Access,My Sql,SYSbase,Informix,Ingres etc

The DS controls supports caching features . Data source controls does not Cache any data.with enable cache property of it we can add caching support.The reason to cache data is to avoid DB trips for every request.If data is cached then we retrieve data from they cache only by avoiding db.This will improve performance like anything.Different property for caching are also supported for maintaining time ,dependency etc
Conflict Detection(Concurrency control)
Using Data source controls when we manipulate data there is every possibility of occurring concurrency problems because web is for all and also our form can be accessed many users . DS controls provide conflict detection with 2 option

i)Override changes
ii)Compare all values

Wednesday, August 7, 2013

How to create and consume usercontrol without

Title:How to access user control in

Description:The use controls can be used when we require a control which can be working as per our requirement.Now i would like to explain how to access this into our web application
1.Use notepad or some other editor and write all aspx/js/html code in it.Save it with .ascx extension
2.Add the created .ascx to the current project i:e copy it into current project folder
3.Go to the page where we want to consume this control and add <%@Register--%> directive
<%@Register Tagprefix="Nit" TagName="RichBanner" src="banner.ascx"%>
4.In the same page now create controls using markup
<Nit:RichBanner ID="rbl" runat="server"/>
5.To Create a control; at run time we cannot use normal syntax for use defined control.We must use load method of page to create it

Ex:-Banner a=page.Load("Banner.ascx")
similarly unload(--) to remove the controls form  form
Remember we must add it to some container after creating it
6.Every control once designed can be placed onto an assembly
7.Only ascx with a dll will be prepared and given to user(publish required)
8.<%@ control--%> directive is used instead of <%@ page--%> and contains will be placed inside a page which contains all HTML content

Tuesday, August 6, 2013

Bind data to text box using dropdownlist in jquery

Title: JQuery set text box value in

In recent articles we known how to implement the  Data binding concept on data  controls like grid view,Data list,list etc.Here i would like to explain how to bind data to text box while leave the focus on Drop Down List using JQuery blur function.The blur function will fire when the previous controls has lost focus.

<html xmlns="">
<title>Bind data to text box using DropDownList in jquery</title>
<script type="text/javascript" src="~/jquery.min.js" ></script>
$(document).ready(function() {
var SalesOrderText = $("#ddlSalesOrder option:selected").text();
$("#<%= txtOrderTotalAmt.ClientID %>".val(SalesOrderText); 
Amount: <asp:DropDownList ID="ddlSalesOrder" runat="server">
TotalAmount:<asp:TextBox ID="txtOrderTotalAmt" runat="server"></asp:TextBox>
As you can see there is alert to confirmation for drop down selected value will come when the blur event occurs.Whenever we are using JQuery ,we should add JQuery library reference to our application.
In the above example we have taken one drop down list and text box to display the amount order .When the amount Drop down list has lost the focus ,the total Amount will be populate automatically.