Click here to Skip to main content
16,004,828 members
Home / Discussions / Database
   

Database

 
AnswerRe: DISTINCT values of Datatable columns??? Pin
S Sansanwal23-Aug-04 12:24
S Sansanwal23-Aug-04 12:24 
GeneralRe: DISTINCT values of Datatable columns??? Pin
mittalpa24-Aug-04 3:23
mittalpa24-Aug-04 3:23 
GeneralSmallDateTime and changing to DateTime Pin
Paul Watson23-Aug-04 7:37
sitebuilderPaul Watson23-Aug-04 7:37 
GeneralRe: SmallDateTime and changing to DateTime Pin
Colin Angus Mackay23-Aug-04 9:57
Colin Angus Mackay23-Aug-04 9:57 
GeneralRe: SmallDateTime and changing to DateTime Pin
Steven Campbell23-Aug-04 10:16
Steven Campbell23-Aug-04 10:16 
QuestionHow to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 5:57
Chodici Mrkev23-Aug-04 5:57 
AnswerRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 6:15
Colin Angus Mackay23-Aug-04 6:15 
GeneralRe: How to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 8:55
Chodici Mrkev23-Aug-04 8:55 
Thank you for your answer, you saved me for the second time Smile | :) When you help me with stored procedure last time, I decided to make more user-friendly interface - I decided to add possibility of editing of existing records - My idea was to make a function ReadUserData, which will be called in two cases: 1)During the editing 2)After successful registration to show all data again. So I created data structure that will be used to save of the data of edited user.
Private Structure UserData<br />
        Dim strRecordID As Integer<br />
        Dim strAllowed As Integer<br />
        Dim strName As String<br />
        Dim strSurname As String<br />
        Dim strClass As String<br />
        Dim strEmail As String<br />
        Dim strUsername As String<br />
        Dim strPassword As String<br />
        Dim strSkin As String<br />
        Dim strImagePath As String<br />
End Structure


What I want is to get the data from db to this structure, then I need to update it. I haven't a clue how to do it so I decided to try to make a function:
ALTER FUNCTION dbo.Function1<br />
	(<br />
		@Username   varchar(50)<br />
	)<br />
RETURNS TABLE<br />
AS<br />
	RETURN ( SELECT * FROM Users WHERE Username = @Username)


Although I don't know how to retrieve data from db, so I was thinking about something like:
Dim cmd As New SqlClient.SqlCommand("RegisterUser", vilemConn)<br />
       cmd.CommandType = CommandType.StoredProcedure<br />
       cmd.Parameters.Add("@Username", txtUsername.Text)<br />
       cmd.Parameters.Add("@Password", inputPassword1.Value)
but in the other way - to get the values of these parameters.
Thanks a lot
GeneralRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 9:54
Colin Angus Mackay23-Aug-04 9:54 
GeneralRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 11:09
Colin Angus Mackay23-Aug-04 11:09 
GeneralRe: How to retrieve data from stored function? Pin
Chodici Mrkev23-Aug-04 11:28
Chodici Mrkev23-Aug-04 11:28 
GeneralThanks Pin
Colin Angus Mackay23-Aug-04 11:45
Colin Angus Mackay23-Aug-04 11:45 
GeneralHandling of Fetched Records Pin
pry50422-Aug-04 21:47
pry50422-Aug-04 21:47 
GeneralRe: Handling of Fetched Records Pin
David Salter23-Aug-04 3:03
David Salter23-Aug-04 3:03 
GeneralRe: Handling of Fetched Records Pin
pry50423-Aug-04 4:38
pry50423-Aug-04 4:38 
GeneralCompiler Error Pin
#realJSOP22-Aug-04 12:33
professional#realJSOP22-Aug-04 12:33 
GeneralRe: Compiler Error Pin
S Sansanwal22-Aug-04 13:41
S Sansanwal22-Aug-04 13:41 
GeneralRe: Compiler Error Pin
#realJSOP22-Aug-04 23:33
professional#realJSOP22-Aug-04 23:33 
GeneralDatagrid data refresh problem Pin
lkreuzer22-Aug-04 7:17
lkreuzer22-Aug-04 7:17 
GeneralDataColumn question Pin
blankg22-Aug-04 6:47
blankg22-Aug-04 6:47 
GeneralADO + SQL statements Pin
#realJSOP22-Aug-04 6:01
professional#realJSOP22-Aug-04 6:01 
GeneralRe: ADO + SQL statements Pin
Christian Graus22-Aug-04 15:19
protectorChristian Graus22-Aug-04 15:19 
GeneralRe: ADO + SQL statements Pin
#realJSOP22-Aug-04 23:35
professional#realJSOP22-Aug-04 23:35 
GeneralRe: ADO + SQL statements Pin
Christian Graus23-Aug-04 10:23
protectorChristian Graus23-Aug-04 10:23 
GeneralRe: ADO + SQL statements Pin
Ryan Roberts23-Aug-04 4:44
Ryan Roberts23-Aug-04 4:44 

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.