Click here to Skip to main content
15,921,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: Call User Control load event... Pin
Kasic Slobodan9-Apr-06 7:24
Kasic Slobodan9-Apr-06 7:24 
QuestionDetecting if a printer is connected using C# Pin
jzelma7-Apr-06 6:21
jzelma7-Apr-06 6:21 
AnswerRe: Detecting if a printer is connected using C# Pin
Braulio Dez7-Apr-06 10:07
Braulio Dez7-Apr-06 10:07 
QuestionHow to avoid displaying the Printer setting dialog when printing from Crystal Report Pin
jzelma7-Apr-06 6:15
jzelma7-Apr-06 6:15 
QuestionSMS for PDA Pin
sedso7-Apr-06 5:52
sedso7-Apr-06 5:52 
QuestionList of .NET Framwork versions installed. Pin
T John7-Apr-06 5:46
T John7-Apr-06 5:46 
AnswerRe: List of .NET Framwork versions installed. Pin
Eric Dahlvang7-Apr-06 6:52
Eric Dahlvang7-Apr-06 6:52 
QuestionSqlException, but now SQL problem Pin
eggsovereasy7-Apr-06 5:18
eggsovereasy7-Apr-06 5:18 
At least I'm pretty sure there isn't a sql problem, the stored procedure works fine in query analyzer, but when I attempt to use it in my program it throws a SqlException:

Line 1: Incorrect syntax near 'NIDB_NIDBArticle_Search'.

Here is the SP:

<br />
CREATE PROCEDURE dbo.NIDB_NIDBArticle_Search<br />
(<br />
	@term varchar(100)<br />
)<br />
AS<br />
SELECT<br />
	a.article_id AS [ID],<br />
	a.main_entry AS MainEntry,<br />
	auth.last_name + ', ' + auth.first_name AS Author,<br />
	ed.last_name + ', ' + ed.first_name AS Editor,<br />
	a.assigned_word_count AS AssignedWordCount,<br />
	s.status AS CurrentStatus		<br />
FROM<br />
	ARTICLE a<br />
	JOIN [USER] auth ON a.author_id = auth.user_id<br />
	JOIN [USER] ed ON a.editor_id = ed.user_id<br />
	JOIN ASSIGNMENT m ON a.article_id = m.article_id<br />
	JOIN LK_STATUS s ON m.status_id = s.status_id<br />
WHERE<br />
	a.main_entry LIKE '%' + @term + '%'<br />


And here is the method, throws the exception when it attempts to fill the DataTable

<br />
public static DataTable Search(string term)<br />
        {<br />
            SqlCommand cmd = new SqlCommand("NIDB_NIDBArticle_Search", conn);<br />
            SqlParameter parm = new SqlParameter("@parm", SqlDbType.VarChar);<br />
            parm.Value = term;<br />
            cmd.Parameters.Add(parm);<br />
            SqlDataAdapter ad = new SqlDataAdapter();<br />
            ad.SelectCommand = cmd;<br />
            DataTable dt = new DataTable();<br />
            ad.Fill(dt);<br />
            conn.Close();<br />
<br />
            return dt;<br />
        }<br />


Any suggestions? I usually use Enterprise Library but for some reason I kept getting an infinite loop when I try to use it in this Windows form.
AnswerRe: SqlException, but now SQL problem Pin
Guffa7-Apr-06 8:39
Guffa7-Apr-06 8:39 
GeneralRe: SqlException, but now SQL problem Pin
eggsovereasy7-Apr-06 10:37
eggsovereasy7-Apr-06 10:37 
QuestionWMEncoder Voice Level Detection Pin
Shajeel7-Apr-06 3:30
Shajeel7-Apr-06 3:30 
QuestionTree Control - Paged/On Demand population Pin
AJ1237-Apr-06 3:01
AJ1237-Apr-06 3:01 
AnswerRe: Tree Control - Paged/On Demand population Pin
Josh Smith7-Apr-06 3:55
Josh Smith7-Apr-06 3:55 
QuestionWhats wrong with this? Pin
livez7-Apr-06 2:19
livez7-Apr-06 2:19 
AnswerRe: Whats wrong with this? Pin
Colin Angus Mackay7-Apr-06 2:25
Colin Angus Mackay7-Apr-06 2:25 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 2:28
livez7-Apr-06 2:28 
GeneralRe: Whats wrong with this? Pin
Jon Hulatt7-Apr-06 3:17
Jon Hulatt7-Apr-06 3:17 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:25
livez7-Apr-06 3:25 
GeneralRe: Whats wrong with this? Pin
Guffa7-Apr-06 2:45
Guffa7-Apr-06 2:45 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:04
livez7-Apr-06 3:04 
GeneralRe: Whats wrong with this? Pin
Jon Hulatt7-Apr-06 3:28
Jon Hulatt7-Apr-06 3:28 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:49
livez7-Apr-06 3:49 
AnswerRe: Whats wrong with this? Pin
Judah Gabriel Himango7-Apr-06 4:05
sponsorJudah Gabriel Himango7-Apr-06 4:05 
QuestionC# and MS Word? Pin
kbalias7-Apr-06 1:59
kbalias7-Apr-06 1:59 
AnswerRe: C# and MS Word? Pin
scoroop7-Apr-06 2:07
scoroop7-Apr-06 2:07 

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.