Thursday, September 30, 2010

select data from one database and insert into another table

insert into tblMonthMstselect * from EMPMain.[dbo].[tblMonthM...

Wednesday, September 29, 2010

Sql Server query Optimization

Optimization in Practice Example 1:I want to retrieve the name and salary of the employees of the R&D department. Original:Query : Select * From EmployeesIn Program : Add a filter on Dept or use command : if Dept = R&D-- Corrected :Select Name, Salary From Employees Where Dept = R&D-- In the corrected version, the DB filters data because...

Tuesday, September 28, 2010

A field or property with the name 'CountryName' was not found on the selected data source.

Sol: In grid you have field but in not tabl...

Saturday, September 18, 2010

GridView with checkbox

This article is very simple.Many time developer need to how develop Gridview with checkbox,so we can select single or multiple record to update.Javascript file <script language="javascript" type="text/javascript"> function SelectAllCheckboxes(spanChk) { var oItem = spanChk.children; var theBox=(spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];...

Friday, September 17, 2010

How to bind GridView with DataSet in ASP.Net and c#

How to bind GridView with DataSet in ASP.Net and c#. In this article I am using ASP.Net GridView control to display data from database.I am using Dataset to fill data and display in Grid. protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { bindGridView(); } }...

Sql Server Interview Questions

1.What are the blocks in stored procedure2. How do you handle exceptions. Give the syntax for it3. What is normalization and types of normalization4. When would you denormalize5. Difference between a query and strored procedure6. What is clustered and non-clustered indexes7. Types of joins8. How do you get all records from 2 tables. Which join do you...

Thursday, September 16, 2010

How to bind data to DropDownList in GridView in ASP.Net and C#

How to bind data to DropDownList in GridView in ASP.Net and C# In this article i am explaining how to bind data to DropDownList inside asp.net GridView control. protected void GridDegree_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddlDegreeType...

Wednesday, September 15, 2010

Create pdf from GridView control in asp.net with c#

Create pdf from GridView using asp.net with c# Here this article show full code for create the pdf file from asp.net GridView. Some time developer need how to do GridView to pdf .Here i have written the method according to my requirement.You can change according to your requirement and use this. public void ConvertDataInPdf(DataTable dtExportInPdf,...

Saturday, September 11, 2010

Bind dropdownlist default value

On RowDataBoundddlCountry.SelectedValue = Ds.Tables[0].Rows[e.Row.RowIndex]["CountryId"].ToString();On SelectedIndexChangedddlRGroup.SelectedValue = Ds.Tables[0].Rows[0]["RatingId"].ToString();if (!Page.IsPostBack)SqlDataReader dr = SqlHelper.ExecuteReader(connectionString, "tblFormula_Select", Convert.ToInt32(ViewState["CKFId"]), "S");ddlTemp.SelectedValue...

Friday, September 10, 2010

Javascript validation for Gridview footer textbox

Javascript validation for Gridview footer textbox Here gridview have footer row that cantain dropdownlist and two textbox.This javascript validate these fields while inserting record in database. function ValidateGrid() { ddlNewCountry = document.getElementById('<%=((DropDownList)gv.FooterRow.FindControl("ddlNewCountry")).ClientID%>');...

Javascript validation for Gridview in edit mode

Javascript validation for Gridview textbox in edit mode Clientside validation for Gridview textboxex while edting record. Here gridview have dropdownlist and two textbox.This javascript clientside code validate these fields while edting record. function ValidateGridEditMode() { var Gid = document.getElementById('ctl00_ContentPlaceHolder1_TabContaner_tabCustomer_gvCustomer').rows.length;...

Gridview control with Edit Delete and Update in ASP.NET using C#

Gridview control with Edit Delete and Update in ASP.NET Gridview Edit/Delete/Update using sqlhelper class and 3 layer architecture. In this article I have tried to make the simple Add , Edit, Update and Delete functions in ASP.Net GridView. Feature of this GridView 1.This example used three tier architecture. 2.Add new record using...

Onclick Gridview Select button fill all the data to textbox.

Onclick Gridview Select button fill all the data to textbox. All the textbox out of gridview. protected void ImgSelect_Click(object sender, ImageClickEventArgs e) { ImageButton aspSender = sender as ImageButton; Label Id = aspSender.FindControl("lblContId") as Label; hdnId.Value = Id.Text; DataSet dsContact...

Monday, September 6, 2010

Join Three Table

How to join three table SELECT e.emp_name, d.DeptNameFROM Emp e INNER JOIN DeptName d ON e.emp_id = d.emp_id JOIN Sal s ON d.dept_id = s.dept_idSELECT a.au_lname, a.au_fname, t.titleFROM authors a INNER JOIN titleauthor ta ON a.au_id = ta.au_id JOIN titles t ON ta.title_id = t.title_idselect r.recipe_name, i.ingredients_list, p.products_listfrom...

How to Store Multiple Value In Session using asp.net c#

How to Store Multiple Value In Session using asp.net c# We can add multiple values by using class entiry or hashtable or arralist: Here a we will use Hashtable for storing multiple value in session Hashtable htEmpInfo = new Hashtable(); htEmpInfo.Add("Name", "Santosh"); htEmpInfo.Add("Designation", "SE"); htEmpInfo.Add("Department",...

OnkeyPress attributes in TextBox using JavaScript

Here code shows how to use onkeypress in TextBox.When user write in textbox a Label show no. of charachter entered in TextBox function valid(txt,maxLen,lbl1) { lbl1.innerText=(txt.value.length+1); if(txt.value.length > (maxLen-1)) { alert("Entered Text reach at its maximum size..!"); return false;...

Sunday, September 5, 2010

Gridview RowCommand

If you hav any button inside Gridview you handle that button under RowCommand like here Gridview have a Insert button inside Grid. protected void gvStuDetails_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Insert")) { objStuCls.StuId = Convert.ToInt32(((DropDownList)gvStuDetails.FooterRow.FindControl("ddlNewStuId")).SelectedValue);...

Saturday, September 4, 2010

Insert Images to SqlServer in ASP .NET

Here I am explaining how insert images into database using asp.net. protected void Button1_Click(object sender, EventArgs e) { FileUpload fileUpload1 = ((FileUpload)(this.FindControl("fileUpload1"))); if (((fileUpload1.PostedFile == null) || (string.IsNullOrEmpty(fileUpload1.PostedFile.FileName) || (fileUpload1.PostedFile.InputStream...

Friday, September 3, 2010

Validation Groups in ASP.NET 2.0

Validation groups is a new feature of asp.net 2.0.Validation groups help you to group the controls in a page and you can have separate submit buttons for each group.When you submit a group of values from a group,the validation controls pertaining to that group alone is executed.Here is a example how to use validation group.On clicking of Save Button,it...

Thursday, September 2, 2010

asp.net and c# interview Questions and Answers

1. What is a static class? Ans.A static class is a class which can not be instantiated using the ‘new’ keyword. They also only contain static members,are sealed and have a private constructor. Static classes are classes that contain only static members.A static class is basically the same as a non-static class, but there is one difference:...

Wednesday, September 1, 2010

How to add comma in a int or decimal value

This code show how to add comma into int or decimal value.Suppose we have a value 33000 and want to display this 33,000.00. string FirstP = ""; string SecP = ""; string Finalstr = ""; int MyValue = Convert.ToInt32(Projected); string myStr = MyValue.ToString(); ...

ASP.NET Validation Controls with example

Learning Technique for freshers : R3C2 1.RequiredFieldValidation Control 2.RangeValidator Control 3.RegularExpressionValidator Control 4.CompareValidator Control 5.CustomValidator Control Properties of Validation Controls. ControlToValidate - Id of control Which you want to validate. ErrorMessage - Message that...

Free Download Software

Adobe acrobat reader (http://okular.kde.org/download.phd) Adobe pagemaker Scribus(http://www.scribus.net/) Adobe photoshop CinePaint (http://www.cinepaint.org/) Dream Weaver KompoZer (http://www.kompozer.org) Fhontografer FontForge (http://fontforge.sourceforge.net/)Microsoft FrontPage Quanta Plus (http://quanta.kdewebdev.org/) Microsoft Office OpenOffice...

General HR questions

1. Tell about yourself and job2. Tell about current project3. What are sequence diagrams, collaboration diagrams and difference between them4. What is your role in the current project and what kinds of responsibilites you are handling5. What is the team size and how do you ensure quality of code6. What is the S/W model used in the project. What are...

Project related questions

1.Tell about your current project2. Tell about your role3. What is the toughest situation you faced in the development4. How often you communicate with the client5. For what purposes, you communicate with the client6. What is the process followed7. Explain complete process followed for the development8. What is the life cycle model used for the development9....

The IListSource does not contain any data sources

Sol:parameter mismatch does not match from stored procedure which you passing from .n...

How to handle OnActiveTabChanged event of AJAX Tab control

This Articles explian how to handle ActiveTabChanged Event of AJAX TabControl in asp.net.ajaxtoolkit:tabcontainer id="tbcRatingMaster" runat="server" cssclass="ajax__tab_yuitabview-theme" ActiveTabIndex="0" BorderStyle="None" Width="742px" BorderWidth="0" OnActiveTabChanged="tbcRatingMaster_ActiveTabChanged" AutoPostBack="True">protected void...