open visual studio command prompt and go to root directory and write this command and press enter. MyProxyClass.cs will be created in your root directory.
WseWsdl3 http://hostServer/WebServiceRoot/WebServiceName.asmx?WSDL /out:MyProxyClass.cs
Friday, July 8, 2011
How to generate proxy class from a web service in asp .net?
How to show sum at footer in Gridview.
Generally to show sum at footer in GridView we use. GridView's RowDataBound Event. We Create a variable(float/Int) outside of event.
and in RowDataBound Event we check row type. if row type is DataRow than we find the Cell's Text convert it into int and Add it to variable created outside of RowDataBound Event. and When RowType change from DataRow to Footer Row than we put that variable's value in footer.
But i want to tell you short and sweet method for it.
as all of you know generally we use DataTable as datasource in gridview.
than we should use it
and in RowDataBound Event we check row type. if row type is DataRow than we find the Cell's Text convert it into int and Add it to variable created outside of RowDataBound Event. and When RowType change from DataRow to Footer Row than we put that variable's value in footer.
But i want to tell you short and sweet method for it.
as all of you know generally we use DataTable as datasource in gridview.
than we should use it
string str = dt.Compute("sum(sGrandTotal)", "").ToString();now just find the Footer of gridview and put str variable in the cell. like this
grdReport.FooterRow.Cells[7].Text = "Total" + float.Parse(str).ToString( "N2");
How to delete duplicate records from a table ?
delete t1 from tblTable t1, tblTable t2 where t1.sName = t2.sName and t1.uniqueField > t2.uniqueFieldwhere t1.uniqueFiled should be int
Sunday, June 12, 2011
How to Enable Service Broker on SQL Server 2005 ?
You can check to see whether the Service Broker is enabled on your server by executing the following SQL syntax:
SELECT name, is_broker_enabled FROM sys.databases where name='YourDBName'To enable the Service Broker on your database, you must execute the ALTER DATABASE command. The following SQL command will enable the Service Broker service on the your database:
ALTER DATABASE YourDBName SET ENABLE_BROKER
Labels:
SQL
Tuesday, June 7, 2011
Add Hindi or Phonetic Typing to your web page
hi friends generally we use google translate to type hindi or other language
in textboxes or other text editor tool.
by using this code we can directly type in engish which automatically converted to hindi or any language which we set in java script code.
google.elements.transliteration.LanguageCode.NEPALI,
google.elements.transliteration.LanguageCode.BENGALI,
google.elements.transliteration.LanguageCode.TELUGU,
google.elements.transliteration.LanguageCode.TAMIL
or other language which google support.
in textboxes or other text editor tool.
by using this code we can directly type in engish which automatically converted to hindi or any language which we set in java script code.
change destinationLanguage to google.elements.transliteration.LanguageCode.HINDI,
google.elements.transliteration.LanguageCode.NEPALI,
google.elements.transliteration.LanguageCode.BENGALI,
google.elements.transliteration.LanguageCode.TELUGU,
google.elements.transliteration.LanguageCode.TAMIL
or other language which google support.
Tuesday, April 26, 2011
Sql Function to Split a string and return a table
create ALTER FUNCTION [dbo].[Split] ( @RowData nvarchar(2000), @SplitOn nvarchar(5) ) RETURNS @RtnValue table ( Id int identity(1,1), Data nvarchar(100) ) AS BEGIN Declare @Cnt int Set @Cnt = 1 While (Charindex(@SplitOn,@RowData)>0) Begin Insert Into @RtnValue (data) Select Data = ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1))) Set @RowData = Substring(@RowData,Charindex(@SplitOn,@RowData)+1,len(@RowData)) Set @Cnt = @Cnt + 1 End Insert Into @RtnValue (data) Select Data = ltrim(rtrim(@RowData)) Return END
use it like this:
select * from dbo.Split('a,b,c,d,e,f,g',',')
Tuesday, November 2, 2010
how to select records of particular date from a sql table if time is also there?
query for select all records.
query for select record for particular date
now if you want to record from a particular date not including time use this query
select * from tbltable
query for select record for particular date
select * from tblTable where dDate='10/29/2010'but because of time there is no record retrieved in result
now if you want to record from a particular date not including time use this query
select * from tbltable where DateAdd(day, datediff(day,0, dDate), 0)=DateAdd(day, datediff(day,0, '10-29-2010'), 0)
Subscribe to:
Posts (Atom)