Click here to Skip to main content
15,925,602 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Query Problems Pin
teejayem6-Jul-06 15:08
teejayem6-Jul-06 15:08 
QuestionTyped DataRow and query with more then 1 table Pin
SlavaFromUkraine6-Jul-06 12:09
SlavaFromUkraine6-Jul-06 12:09 
QuestionNo of Databases Pin
Uma Kameswari6-Jul-06 1:25
Uma Kameswari6-Jul-06 1:25 
AnswerRe: No of Databases Pin
mr_lasseter6-Jul-06 16:42
mr_lasseter6-Jul-06 16:42 
Questionhow to resolve nesting level error in SQL Pin
karimkamal5-Jul-06 17:43
karimkamal5-Jul-06 17:43 
AnswerRe: how to resolve nesting level error in SQL Pin
Colin Angus Mackay5-Jul-06 20:34
Colin Angus Mackay5-Jul-06 20:34 
GeneralRe: how to resolve nesting level error in SQL Pin
karimkamal5-Jul-06 20:45
karimkamal5-Jul-06 20:45 
GeneralRe: how to resolve nesting level error in SQL Pin
Colin Angus Mackay5-Jul-06 22:50
Colin Angus Mackay5-Jul-06 22:50 
Your code:
CREATE PROCEDURE SelectRecipient
AS
DECLARE @mail nvarchar(4000)
Select Mail FROM Member
select Mail from Member
exec @mail = SelectRecipient
select @mail
GO


I'm not sure what you are trying to do. It looks like you only want one value, but you are not passing in any parameters so there is nothing to filter the result set.

Suggested change:
CREATE PROCEDURE SelectRecipient
AS
SELECT Mail from Member
GO


From C#
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandTypeStoredProcedure;
cmd.CommandText = "SelectRecipient";
cmd.Connection = myConnection;
SqlReader reader = cmd.ExecuteReader()
while(reader.Read())
{
    string mail = reader.GetString(0);
    // Do something with the result
}

The above will retrieve all mail in the table. (Which I don't think is what you want - but it is the best I can help you with given the information you have supplied)


Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?

My: Website | Blog
GeneralRe: how to resolve nesting level error in SQL Pin
karimkamal6-Jul-06 5:22
karimkamal6-Jul-06 5:22 
AnswerRe: how to resolve nesting level error in SQL Pin
Frank Kerrigan5-Jul-06 22:48
Frank Kerrigan5-Jul-06 22:48 
GeneralRe: how to resolve nesting level error in SQL Pin
Colin Angus Mackay5-Jul-06 23:06
Colin Angus Mackay5-Jul-06 23:06 
GeneralRe: how to resolve nesting level error in SQL Pin
Frank Kerrigan6-Jul-06 1:47
Frank Kerrigan6-Jul-06 1:47 
QuestionCLR Stored Procedures and Deploying them to a Client [modified] Pin
Drew McGhie5-Jul-06 7:56
Drew McGhie5-Jul-06 7:56 
AnswerRe: CLR Stored Procedures and Deploying them to a Client Pin
Drew McGhie5-Jul-06 8:56
Drew McGhie5-Jul-06 8:56 
Questionsql Pin
Tara145-Jul-06 4:22
Tara145-Jul-06 4:22 
AnswerRe: sql Pin
Colin Angus Mackay5-Jul-06 5:10
Colin Angus Mackay5-Jul-06 5:10 
AnswerRe: sql Pin
Frank Kerrigan5-Jul-06 5:56
Frank Kerrigan5-Jul-06 5:56 
GeneralRe: sql Pin
Tara145-Jul-06 6:56
Tara145-Jul-06 6:56 
GeneralRe: sql [modified] Pin
Colin Angus Mackay5-Jul-06 9:29
Colin Angus Mackay5-Jul-06 9:29 
GeneralRe: sql Pin
Tara145-Jul-06 10:36
Tara145-Jul-06 10:36 
GeneralRe: sql Pin
Colin Angus Mackay5-Jul-06 12:17
Colin Angus Mackay5-Jul-06 12:17 
GeneralRe: sql Pin
Tara145-Jul-06 20:34
Tara145-Jul-06 20:34 
QuestionDropDownList Pin
Gowri.M5-Jul-06 0:52
Gowri.M5-Jul-06 0:52 
AnswerRe: DropDownList Pin
Frank Kerrigan5-Jul-06 1:50
Frank Kerrigan5-Jul-06 1:50 
GeneralRe: DropDownList Pin
Jerry Hammond6-Jul-06 18:11
Jerry Hammond6-Jul-06 18:11 

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.