Tags » C-2

Get DataSet from XML File in ASP.Net C#.

DataSet ds = new DataSet();

ds.ReadXml(Server.MapPath(“~/Customers.xml”));

// You  can  use this  data Set as DataSouse  to bind Grid etc..

Asp.Net

Add MasterPage Dynamically from CodeBehind asp.net c#

protected void Page_PreInit(object sender, EventArgs e)
{
string masterPath = string.Empty;
string _userType = Request.QueryString["sType"].ToString();
switch (_userType)
{
case “User”:
masterPath = “~/User/Master/”;
Page.MasterPageFile = masterPath + “UserMaster.master”; 19 more words

Asp.Net

Get XML from DataSet and convert into html using xslt dynamuically

protected void UseXslt()
{
XmlDocument xDS = new XmlDocument();
DataSet ds = new DataSet();
// ds = // Get DataSet from  DataBase.
xDS.LoadXml(ds.GetXml());
string sType = string.Empty; 137 more words

Asp.Net

How to disable backspace and delete key in Textbox asp.net using javascript in ASP.NET

I wanted to disable the working of Backspace and Delete keys while typing text in Textbox on asp.net webpage. Below is the solution to disable these keys using java script as i typed some data in Textbox and tried to remove it: 87 more words

C#

Selection Sort :

<br />#include<iostream>
#include<conio.h>
using namespace std;
int smallest(int a[],int k,int n)
{
int pos=k,small=a[k],i;
for(i=k+1;i<n;i++)
{
if(a[i]<small)
{
small=a[i];
pos=i;
}
}
return pos;
}
void selection_sort(int a[],int n)
{
int k,pos,temp;
for(k=0;k<n;k++)
{
pos=smallest(a,k,n);
temp=a[k];
a[k]=a;
a=temp;
}
}
int main()
{
int a,n,i,j,k;
cout<<"Enter the size of the array:"<<endl;
cin>>n;
cout<<"Enter the elements:-"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];
}
selection_sort(a,n);
cout<<"The Sorted array is:-"<<endl;
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
cout<<endl;
cout<<endl<<"Thanks...@Myprogworld..!!"<<endl;
getch();
return 0;
}

corollary:-

Sorting

Selection Sort (Algo) :

Selection sort is a sorting algorithm that has quadratic running time complexity given as O(n^2) thereby making it inefficient to be used on large lists.Selection sort is generally the preferred choice for sorting files with very large objects and small keys. 192 more words

Algorithm