query = "update dbo_personaldat a set name='" + txtName.Text + "',[date]=#" + lblDate.Text + "#,gender='" + gender + "',father_name= '" + txtFather.Text + "',date_of_birt h=#" + datDate.Text + "#,nationality= '" + txtNationality. Text + "',address='" + txtMailAddress. Text + "',city='" + txtCity.Text + "',state='" + txtState.Text + "',postal_code= '" + txtPostal.Text + "',mobile_no='" + txtMobile.Text + "',category='" + txtCategory.Tex t + "',email='" + txtEmail.Text + "',state_of_dom icile='" + txtDomicile.Tex t + "'where id=" + id;
Friday, February 18, 2011
Wednesday, February 16, 2011
Download Teamviwer Link
The provided link directly download Team Viewer
http://www.teamviewer.com/download/version_5x/TeamViewer_Setup.exe
http://www.teamviewer.com/download/version_5x/TeamViewer_Setup.exe
Tuesday, February 15, 2011
Repeater Control in Asp.net
Hello,
Repeater control in asp.net like Grid View.
Most of the company use repeater control for data dispaly like.
Default.aspx page
<form id="form1" runat="server">
<div>
<asp:Repeater ID="RepeatInformation" runat="server">
<HeaderTemplate>
<table class="tblcolor">
<tr>
<b>
<td>
Roll No
</td>
<td>
Student Name
</td>
<td>
Total Fees
</td>
</b>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="tblrowcolor">
<td>
<%#DataBinder.Eval(Container,"DataItem.RollNo")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Fees")%>
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td>
<hr />
</td>
<td>
<hr />
</td>
<td>
<hr />
</td>
</tr>
</SeparatorTemplate>
<AlternatingItemTemplate>
<tr>
<td>
<%#DataBinder.Eval(Container,"DataItem.RollNo")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Fees")%>
</td>
</tr>
</AlternatingItemTemplate>
<SeparatorTemplate>
<tr>
<td>
<hr />
</td>
<td>
<hr />
</td>
<td>
<hr />
</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
<tr>
<td>
School Records displayed
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</form>
Or on page of .cs file Default.aspx.cs page like
<div>
<asp:Repeater ID="RepeatInformation" runat="server">
<HeaderTemplate>
<table class="tblcolor">
<tr>
<b>
<td>
Roll No
</td>
<td>
Student Name
</td>
<td>
Total Fees
</td>
</b>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="tblrowcolor">
<td>
<%#DataBinder.Eval(Container,"DataItem.RollNo")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Fees")%>
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td>
<hr />
</td>
<td>
<hr />
</td>
<td>
<hr />
</td>
</tr>
</SeparatorTemplate>
<AlternatingItemTemplate>
<tr>
<td>
<%#DataBinder.Eval(Container,"DataItem.RollNo")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Name")%>
</td>
<td>
<%#DataBinder.Eval(Container,"DataItem.Fees")%>
</td>
</tr>
</AlternatingItemTemplate>
<SeparatorTemplate>
<tr>
<td>
<hr />
</td>
<td>
<hr />
</td>
<td>
<hr />
</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
<tr>
<td>
School Records displayed
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</form>
Or on page of .cs file Default.aspx.cs page like
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con;
SqlCommand cmd = new SqlCommand();
con = new SqlConnection(ConfigurationManager.ConnectionStrings["abc"].ConnectionString);
cmd.Connection = con;
cmd.CommandText = "select * from employee";
con.Open();
RepeatInformation.DataSource = cmd.ExecuteReader();
RepeatInformation.DataBind();
con.Close();
}
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con;
SqlCommand cmd = new SqlCommand();
con = new SqlConnection(ConfigurationManager.ConnectionStrings["abc"].ConnectionString);
cmd.Connection = con;
cmd.CommandText = "select * from employee";
con.Open();
RepeatInformation.DataSource = cmd.ExecuteReader();
RepeatInformation.DataBind();
con.Close();
}
Here the example show data binding through Ado.net We can also Linq to Sql for Binding.
Thankx
Subscribe to:
Posts (Atom)