Click here to Skip to main content
15,793,175 members
Home / Discussions / Database
   

Database

 
QuestionDISTINCT values of Datatable columns??? Pin
mittalpa23-Aug-04 11:43
mittalpa23-Aug-04 11:43 
AnswerRe: DISTINCT values of Datatable columns??? Pin
S Sansanwal23-Aug-04 13:24
S Sansanwal23-Aug-04 13:24 
GeneralRe: DISTINCT values of Datatable columns??? Pin
mittalpa24-Aug-04 4:23
mittalpa24-Aug-04 4:23 
GeneralSmallDateTime and changing to DateTime Pin
Paul Watson23-Aug-04 8:37
sitebuilderPaul Watson23-Aug-04 8:37 
GeneralRe: SmallDateTime and changing to DateTime Pin
Colin Angus Mackay23-Aug-04 10:57
Colin Angus Mackay23-Aug-04 10:57 
GeneralRe: SmallDateTime and changing to DateTime Pin
Steven Campbell23-Aug-04 11:16
Steven Campbell23-Aug-04 11:16 
QuestionHow to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 6:57
Chodici Mrkev23-Aug-04 6:57 
AnswerRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 7:15
Colin Angus Mackay23-Aug-04 7:15 
Be careful of the differences between a "User Defined Function" (what you have here) and a "Stored Procedure". (There is no such thing as a "Stored Function")

User Defined Functions (UDF) are more restrictive and can only use deterministic statements and functions. They cannot change the state of the database either. However they can still be useful as they can be inserted into complex SELECT statements to reduce the complexity and make them easier to read. But there is a performance penalty for this as the query optimiser cannot optimise what is in the UDF with the rest of the SELECT statement.

If you want to use a UDF from .NET code you need to wrap it up in a SELECT like this:
SELECT * FROM dbo.Function1(@UserName)


As to your questions. The .NET code you've provided does not match with the SQL code above it, so I don't really know how to answer.


chodicimrkev wrote:
How can I get data from the database? (I want to save them to the structure.)

Also, I am not sure what you mean by "the structure". What structure? Do you want to read the data into a dataset, or your own objects or what?




"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!


GeneralRe: How to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 9:55
Chodici Mrkev23-Aug-04 9:55 
GeneralRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 10:54
Colin Angus Mackay23-Aug-04 10:54 
GeneralRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 12:09
Colin Angus Mackay23-Aug-04 12:09 
GeneralRe: How to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 12:28
Chodici Mrkev23-Aug-04 12:28 
GeneralThanks Pin
Colin Angus Mackay23-Aug-04 12:45
Colin Angus Mackay23-Aug-04 12:45 
GeneralHandling of Fetched Records Pin
pry50422-Aug-04 22:47
pry50422-Aug-04 22:47 
GeneralRe: Handling of Fetched Records Pin
David Salter23-Aug-04 4:03
David Salter23-Aug-04 4:03 
GeneralRe: Handling of Fetched Records Pin
pry50423-Aug-04 5:38
pry50423-Aug-04 5:38 
GeneralCompiler Error Pin
#realJSOP22-Aug-04 13:33
mve#realJSOP22-Aug-04 13:33 
GeneralRe: Compiler Error Pin
S Sansanwal22-Aug-04 14:41
S Sansanwal22-Aug-04 14:41 
GeneralRe: Compiler Error Pin
#realJSOP23-Aug-04 0:33
mve#realJSOP23-Aug-04 0:33 
GeneralDatagrid data refresh problem Pin
lkreuzer22-Aug-04 8:17
lkreuzer22-Aug-04 8:17 
GeneralDataColumn question Pin
blankg22-Aug-04 7:47
blankg22-Aug-04 7:47 
GeneralADO + SQL statements Pin
#realJSOP22-Aug-04 7:01
mve#realJSOP22-Aug-04 7:01 
GeneralRe: ADO + SQL statements Pin
Christian Graus22-Aug-04 16:19
protectorChristian Graus22-Aug-04 16:19 
GeneralRe: ADO + SQL statements Pin
#realJSOP23-Aug-04 0:35
mve#realJSOP23-Aug-04 0:35 
GeneralRe: ADO + SQL statements Pin
Christian Graus23-Aug-04 11:23
protectorChristian Graus23-Aug-04 11:23 

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.