Posts

Randomly Sort Sql server Table

You can sort a Table Randomly with a single keyword. the newsid() is the keyword which generates a random number in sql server. Here is small ex. 1)Create a database 2)Create Table Master 3)Create Fields Code nvarchar(50), Name Nvarchar(50) 4)Enter some data into table 5)Now open new query window 6)Write sql 7) Select * from Master Order by newid() Now, run this code it will return data in random format. You can also use newid() to generate a unique number or a number like verification code etc. for ex. Select newid()

Sort Datatable randomly

This is not possible to Sort a Datatable directly. In order to randomize the rows in a DataTable, do the following: 1) Add a random number DataColumn to the DataTable 2) For each row, generate a random number and store it to the new column 3) Create a DataView and sort by the random number DataColumn Test this by simple ex. DataTable dt = GetData(); dt.Columns.Add(new DataColumn("RandomNum", Type.GetType("System.Int32"))); Random random = new Random(); for (int i = 0; i { dt.Rows[i]["RandNum"] = random.Next(1000); } DataView dv = new DataView(dt); dv.Sort = "RandomNum";

How to use Hindi fonts on Website

Now in current world the importance of multi lingual websites has increased. People demands for sites in different languages for different uses. I have a site on which I have to show data in Hindi. This had become a major issue while development. I had searched the internet and found a solution named Microsoft WEFT. I was very happy to find a solution. I start working on the basis of this software. But after successful launch of website the use had found an major issue. The .eot files are only supported on IE browsers. Now, this is the time to work like a machine to search for a true solution. I have searched many sites. But, finally god give me the solution by giving me the concept of UNICODE fonts Here is the example how to use UNICODE fonts. use these sites to make entry in hindi http://utopianvision.co.uk/hindi/write/ http://www.geocities.com/matthewblackwell/hindiEditor.html You can make entry in hindi for ex. on this http://utopianvision.co.uk/hindi/write/ in second text box ente...

aspnet_merge.exe exited with code '1'

This is a major problem which will normally faced by new users of .net. The main reason behind the problem is the duplicate "Inherits" name of pages. You can easily resolve this problem by renaming the duplicate inherit names of Pages. Let me describe this by giving an simple ex. steps :- 1) Make a new c# website. 2) By default an page default.aspx will appear. 3 Copy default.aspx and paste 4) Rename copy of default to "Default2.aspx" 5) Then try to make build. 6) It will show errors Here, is the solution 1) Open default.aspx 2) Check Inherits attribute of page in page directive. it is "_Default" by default 3) Open default2 4) Check Inherits attribute of default2 in page directive. it is "_Default" 5) Change Inherits attribute of default2 to "_Default2" 6) Build application Now build successfully. This is the solution which I have explained with the help of small ex. For any help please mail on narendersinghkahlon@gmail.com

How to change Mouse Pointer onmouseover using Javascript

JavaScript is a strong tool to work with Web Technology. You can complete all the tasks using JavaScript. For ex. I have a task to chnage mouse pointer on mouse hover. The answer is too simple use CSS.No, my css is not working due to some un avoidable reasons. Finally I come to the conclusion i.e Make a global.js contains function set_mouse_pointer(obj) { obj.style.cursor='pointer'; } Then implement this function like Steps: 1) Put an HTML button of the page 2) Then on onmouseover event write code "onmouseover="set_mouse_pointer(this);" 3) View that page in browser. You will see the effect. This is a simple example of JavaScript. What you can do with JavaScript. Please let me know if you have any major issues related to JavaScript

Set Left,Top at different screen resolution by JavaScript

I have a task to dispaly a div starts from the left position of some other control. I had searched on so many sites but, unfortunately I have not found any good solution. But, finally I found a solution, as I know the default left on 1024 x 768 is "251" so I use this as a gift of god. Following is the code how to do that:- var obj=document.getElementById("a1"); var int_left=screen.width; // get Pixel size of screen if (int_left>1024) { int_left=int_left-1024; // get width other then 1024 int_left=int_left/2; get the first half of width int_left=int_left+251; add first half to the width } else { int_left=253; } obj.style.left=int_left; If you have any doubts please let me know.

Browser compatible Javascript.

If you want to navigate form one window to another use window.location='pagename.htm' This is a browser compaitable script. I will continue to post more browser compaitable scripts as I will come to know more issue or get request from someone