How can get multiple coumn value in single column with camman separeted using sql. like
I have table test2 and column name id and value like this
Id
1
2
3
4
5
6
..
and I want result like this 1,2,3,4,5,6,....
solution:
declare @a varchar(500)
set @a = ' '
select @a = @a + cast(id as varchar(20)) + ',' from test2
if len(@a)>1
set @a= left(@a,len(@a)-1)
select case @a when ' ' then '0' else @a end as id
Sunday, January 11, 2009
Spacebar Check in TextBox Using Javascript
Trim Function using java script.Validation for text box if there only space using java script.validation for space in text box using java script.
Solution:
Create A textbox with id txtname and a button id btntest and wite this function inside script tag.
function trim(string)
{
var a = string.replace(/^\s+/, '');
return a.replace(/\s+$/, '')
}
function TestTrim()
{
x = window.document.getElementById("txtname");
str="Please Enter User Name";
if (trim(x.value)=="")
{
alert(str);
x.select();
x.focus();
return false ;
}
}
And then call the function on c#(code behind page)
btntest.Attributes.Add("onclick", "return TestTrim();");
Solution:
Create A textbox with id txtname and a button id btntest and wite this function inside script tag.
function trim(string)
{
var a = string.replace(/^\s+/, '');
return a.replace(/\s+$/, '')
}
function TestTrim()
{
x = window.document.getElementById("txtname");
str="Please Enter User Name";
if (trim(x.value)=="")
{
alert(str);
x.select();
x.focus();
return false ;
}
}
And then call the function on c#(code behind page)
btntest.Attributes.Add("onclick", "return TestTrim();");
Wednesday, January 7, 2009
How can search column in database using sql
How can search column in database using sql.
solution:-
use databasename
select it and execute and then write this query and execute it . it will give all the table in wich there will be the column name like you search.
select * from information_schema.columns where column_name like '%abc%'
solution:-
use databasename
select it and execute and then write this query and execute it . it will give all the table in wich there will be the column name like you search.
select * from information_schema.columns where column_name like '%abc%'
Search the table from database using sql
How can search the table name from the existing database if there are table exist but I forgot the full name of table in sql
Solution:- select * from information_schema.tables where table_name like '%abc%'
where abc is table name
Solution:- select * from information_schema.tables where table_name like '%abc%'
where abc is table name
Thursday, October 16, 2008
Convert Asp.net to Asp.net Ajax enabled website in Asp.net 2.0
How can I convert the asp.net website to Ajax enabled website in asp.net 2.0
This quation was very difficult for me change the simple website to Ajax enable website. Simply if we want to make ajax enabled website then select the Ajaxenabledwebsite from the Dashboard when click on file new and website. but if I din't this then I faced problem to convert this asp.net website to Ajax enabled website. its very simple
step1: add the ajaxcontrolltoolkit.dll in your application bin folder by add refrence.
step2: add the some line of code in web.config inside the
This quation was very difficult for me change the simple website to Ajax enable website. Simply if we want to make ajax enabled website then select the Ajaxenabledwebsite from the Dashboard when click on file new and website. but if I din't this then I faced problem to convert this asp.net website to Ajax enabled website. its very simple
step1: add the ajaxcontrolltoolkit.dll in your application bin folder by add refrence.
step2: add the some line of code in web.config inside the
Subscribe to:
Posts (Atom)
