If you are getting "Unable to cast object of type 'System.Int32' to type "'System.String' error while using facebook.net from nikhil (http://www.nikhilk.net/FacebookNET.aspx) ,
to solve this error download source code for this dll and make a change in Framework\Service\Core\FacebookRequest.cs line 180 change
//userID = (string)result["uid"];
to userID = Convert.ToString(result["uid"]);
Monday, June 29, 2009
Unable to cast object of type 'System.Int32' to type 'System.String' :Error in Facebook Application
Labels:
facebook asp.net,
facebook error,
Facebook.net
Sunday, April 19, 2009
failed to enable constriants,One or more rows contain values violating non-null, unique
Error:asp.net/c#/typed data set,strong datasets,xsd files
"failed to enable constriants,One or more rows contain values violating non-null, unique"
If this is the error you get into your dataset/xsd files then there is a problem with the table u r using to fetch records.You might have altered the datatype/length of the column.
the best way to resolve it is to re create the dataset/xsd file or use a simple stored procedure to fetch records...
"failed to enable constriants,One or more rows contain values violating non-null, unique"
If this is the error you get into your dataset/xsd files then there is a problem with the table u r using to fetch records.You might have altered the datatype/length of the column.
the best way to resolve it is to re create the dataset/xsd file or use a simple stored procedure to fetch records...
Labels:
dataset,
error in xsd,
typed dataset
Wednesday, April 8, 2009
The SMTP server requires a secure connection or the client was not authenticated. The server response was: denied access
Error while sending email...asp.net 2.0
"The SMTP server requires a secure connection or the client was not authenticated. The server response was: denied access

you can resolve this error by setting
mailclient.UseDefaultCredentials = true; in the code you are using to send email. use this code
System.Net.Mail.SmtpClient mailclient = new System.Net.Mail.SmtpClient();
System.Net.NetworkCredential auth = new System.Net.NetworkCredential("support@abc.com", "123#");
mailclient.Host = "mail.abc.com";
mailclient.UseDefaultCredentials = true;
mailclient.Credentials = auth;
mailclient.Send(msg);
"The SMTP server requires a secure connection or the client was not authenticated. The server response was: denied access

you can resolve this error by setting
mailclient.UseDefaultCredentials = true; in the code you are using to send email. use this code
System.Net.Mail.SmtpClient mailclient = new System.Net.Mail.SmtpClient();
System.Net.NetworkCredential auth = new System.Net.NetworkCredential("support@abc.com", "123#");
mailclient.Host = "mail.abc.com";
mailclient.UseDefaultCredentials = true;
mailclient.Credentials = auth;
mailclient.Send(msg);
Sunday, December 14, 2008
Stored Procudre to Find next 5 records alphabetically
Stored procedure to find next 5 records alphabetically.Like next 5 records with alphabets starting from a will be b,c,d,e,f
----------

-------------
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[FindNext5RecordsByCharacter]
(
@CityCharacter char(1)
)
AS
BEGIN
declare @alpha varchar(1)
declare @alpha1 varchar(1)
declare @alpha2 varchar(1)
declare @alpha3 varchar(1)
declare @alpha4 varchar(1)
declare @alpha5 varchar(1)
if (@CityCharacter='y' or @CityCharacter='Y')
begin
set @CityCharacter='a'
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
else if(@CityCharacter<>'z' or @CityCharacter<>'Z' )
begin
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
else
begin
set @CityCharacter='a'
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
CREATE TABLE #Temp(
CityId int,
CityName char(30) )
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha1
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha2
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha3
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha4
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha5
select * from #temp
drop table #temp
END
----------

-------------
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[FindNext5RecordsByCharacter]
(
@CityCharacter char(1)
)
AS
BEGIN
declare @alpha varchar(1)
declare @alpha1 varchar(1)
declare @alpha2 varchar(1)
declare @alpha3 varchar(1)
declare @alpha4 varchar(1)
declare @alpha5 varchar(1)
if (@CityCharacter='y' or @CityCharacter='Y')
begin
set @CityCharacter='a'
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
else if(@CityCharacter<>'z' or @CityCharacter<>'Z' )
begin
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
else
begin
set @CityCharacter='a'
set @alpha=@CityCharacter
select @alpha1= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha order by CityName desc
--print @alpha1
select @alpha2= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha1 order by CityName desc
--print @alpha2
select @alpha3= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha2 order by CityName desc
--print @alpha3
select @alpha4= substring(CityName,1,1) from tbl_city where substring(CityName,1,1) > @alpha3 order by CityName desc
--print @alpha4
end
CREATE TABLE #Temp(
CityId int,
CityName char(30) )
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha1
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha2
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha3
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha4
INSERT INTO #Temp (CityId, CityName)
SELECT top 1 CityId, CityName
FROM tbl_city where substring(CityName,1,1) >@alpha5
select * from #temp
drop table #temp
END
Subscribe to:
Posts (Atom)
