Click here to Skip to main content
15,909,242 members
Home / Discussions / Database
   

Database

 
AnswerRe: What is the disadvantage of using select * from table name?? Pin
Tim Carmichael18-Aug-08 6:33
Tim Carmichael18-Aug-08 6:33 
AnswerRe: What is the disadvantage of using select * from table name?? Pin
PIEBALDconsult18-Aug-08 13:00
mvePIEBALDconsult18-Aug-08 13:00 
AnswerRe: What is the disadvantage of using select * from table name?? Pin
supercat919-Aug-08 9:28
supercat919-Aug-08 9:28 
Questionhow to split a string in oracle Pin
lakshmichawala17-Aug-08 19:41
lakshmichawala17-Aug-08 19:41 
AnswerCross Post!! Pin
ChandraRam17-Aug-08 21:21
ChandraRam17-Aug-08 21:21 
AnswerRe: how to split a string in oracle Pin
DerekFL18-Aug-08 10:40
DerekFL18-Aug-08 10:40 
GeneralRe: how to split a string in oracle Pin
Wendelius19-Aug-08 10:55
mentorWendelius19-Aug-08 10:55 
QuestionProblem StoredProcedure for LINQ Pin
K V Sekhar17-Aug-08 18:33
K V Sekhar17-Aug-08 18:33 
Hi all,

I wrote a StoredProcedure which returns a dataset.
But when i drag that SP into .dbml file, the return type of SP is becomes int, not ISingleResultType<>. I dont know reason for this.

When i call that SP i got Error / Return vale 0
Plz Help me.
Here my SP:
ALTER PROCEDURE [dbo].[USP_GetAdNames](
@user varchar(50),
@specialization smallint = null,
@country smallint = null,
@state tinyint = null,
@city varchar(50)= null,
@from datetime = null,
@to datetime = null
)
AS
CREATE TABLE #TEMPADS
(
int_ID int,
str_Name varchar(50)
)

DECLARE @query nvarchar(1000)

BEGIN

SET @query = N'INSERT INTO #TEMPADS SELECT transAds.int_AdID,transAds.str_Name
FROM TRANS_ADS AS transAds
WHERE transAds.str_UserID = '''+@user+''''

if (@specialization != null OR @specialization != 0)
SET @query = @query + ' AND tansAds.smallint_Specialization = '+cast(@specialization as varchar(10))

if (@country != null OR @country != 0)
SET @query = @query + ' AND transAds.smallint_CountryCode = '+cast(@country as varchar(10))

if(@state != null OR @state != 0)
SET @query = @query + ' AND transAds.tinyint_FocusState = '+cast(@state as varchar(10))

if(Ltrim(Rtrim(@city)) != '' OR Ltrim(Rtrim(@city)) != null)
SET @query = @query + ' AND transAds.str_FocusCity = '''+@city +''''

if(@from IS NOT NULL)
SET @query = @query + ' AND transAds.dt_Modifiedon >='''+convert(varchar(25),@from,101)+''''

if(@to IS NOT NULL)
SET @query = @query + ' AND transAds.dt_Modifiedon <='''+convert(varchar(25),@to,101)+''''

print @query

EXECUTE sp_sqlexec @query

SELECT int_ID,str_Name FROM #TEMPADS

END

///// When i execute in SQl Management Studio iam getting records as dataset. But not in my program.


I am calling that sp like this:

var query = from temp in DataContext1.USP_GetAdNames("kvs",null,null,null,null,null,null) select temp;
.....................................................

I also tried creating a partial class in DataContextMapping.Designer.cs file but no use.

Please suggest me, what went wrong in my SP.
AnswerRe: Problem StoredProcedure for LINQ Pin
Syed Mehroz Alam18-Aug-08 7:04
Syed Mehroz Alam18-Aug-08 7:04 
NewsSQL Server 2008 Express edition released for download [modified] Pin
Wendelius17-Aug-08 2:40
mentorWendelius17-Aug-08 2:40 
GeneralRe: SQL Server 2008 Express edition released for download Pin
Colin Angus Mackay17-Aug-08 3:13
Colin Angus Mackay17-Aug-08 3:13 
GeneralRe: SQL Server 2008 Express edition released for download PinPopular
Wendelius17-Aug-08 3:17
mentorWendelius17-Aug-08 3:17 
QuestionStored Procedure help Pin
Vimalsoft(Pty) Ltd16-Aug-08 23:34
professionalVimalsoft(Pty) Ltd16-Aug-08 23:34 
AnswerRe: Stored Procedure help Pin
Wendelius16-Aug-08 23:47
mentorWendelius16-Aug-08 23:47 
GeneralRe: Stored Procedure help Pin
Colin Angus Mackay16-Aug-08 23:55
Colin Angus Mackay16-Aug-08 23:55 
GeneralRe: Stored Procedure help Pin
Wendelius17-Aug-08 1:59
mentorWendelius17-Aug-08 1:59 
AnswerRe: Stored Procedure help Pin
Colin Angus Mackay16-Aug-08 23:57
Colin Angus Mackay16-Aug-08 23:57 
GeneralRe: Stored Procedure help Pin
Vimalsoft(Pty) Ltd17-Aug-08 2:26
professionalVimalsoft(Pty) Ltd17-Aug-08 2:26 
QuestionUsing SQL Server 8.0 hashes to connect to SQL Server 9.0 Pin
jchalfant16-Aug-08 13:50
jchalfant16-Aug-08 13:50 
NewsRe: Using SQL Server 8.0 hashes to connect to SQL Server 9.0 Pin
jchalfant16-Aug-08 14:12
jchalfant16-Aug-08 14:12 
QuestionDebug Transact SQL in SQL 2005 Pin
Christiaan Laubscher16-Aug-08 2:57
Christiaan Laubscher16-Aug-08 2:57 
AnswerRe: Debug Transact SQL in SQL 2005 Pin
Wendelius16-Aug-08 7:02
mentorWendelius16-Aug-08 7:02 
GeneralMessage Removed Pin
18-Aug-08 1:02
Christiaan Laubscher18-Aug-08 1:02 
GeneralRe: Debug Transact SQL in SQL 2005 Pin
Wendelius18-Aug-08 4:50
mentorWendelius18-Aug-08 4:50 
Questionhow to check wherther a passed string contains a specified word or not . Pin
lakshmichawala16-Aug-08 1:52
lakshmichawala16-Aug-08 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.