Click here to Skip to main content
15,798,673 members
Home / Discussions / Database
   

Database

 
AnswerRe: Update database from a XML dataset file ? Pin
mikasa25-Aug-04 12:27
mikasa25-Aug-04 12:27 
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 
Hi,
I tried to create my first stored function in SQL: I wrote this:
CREATE FUNCTION dbo.Function1<br />
	(<br />
		@Username   varchar(50)<br />
	)<br />
RETURNS TABLE<br />
AS<br />
	RETURN ( SELECT * FROM Users WHERE Username = @Username)


and I wanted to retrieve all data from record in the database about this user.
I am absolute newbie in this, and I have this code to save data to the database:
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)


My question is: How can I get data from the database? (I want to save them to the structure.)
And the second question: When I tried this with Run inline function in VS.NET and when I set the value of @Username="blablabla" it got the result, but when I set this value to NULL it said
No rows affected.
No more results.
(0 row(s) returned), despite I have there (for testing purposes only, there will never be any NULL UsernameSmile | :) ) few NULL values?
AnswerRe: How to retrieve data from stored function? Pin
Colin Angus Mackay23-Aug-04 7:15
Colin Angus Mackay23-Aug-04 7:15 
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 

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.