Click here to Skip to main content
15,887,776 members
Home / Discussions / C#
   

C#

 
GeneralRe: strings in DLL calls Pin
Gian27-May-04 21:40
Gian27-May-04 21:40 
GeneralChecking connection of some IP to the internet Pin
Den2Fly27-May-04 21:27
Den2Fly27-May-04 21:27 
Generalconformation Pin
sreejith ss nair27-May-04 20:59
sreejith ss nair27-May-04 20:59 
GeneralRe: conformation Pin
Dave Kreskowiak28-May-04 3:36
mveDave Kreskowiak28-May-04 3:36 
GeneralType.GetType Pin
Silly Boy27-May-04 18:53
Silly Boy27-May-04 18:53 
GeneralRe: Type.GetType Pin
ian mariano27-May-04 20:24
ian mariano27-May-04 20:24 
GeneralC# and SQL Autonumber Pin
Antonius_r327-May-04 18:06
Antonius_r327-May-04 18:06 
GeneralRe: C# and SQL Autonumber Pin
Grimolfr28-May-04 3:20
Grimolfr28-May-04 3:20 
Swap the last two lines, like so:

ALTER PROCEDURE programservice.insert_job
(
@JobID int output,
@CustomerID char(20),
@Date datetime
)
AS
SET NOCOUNT OFF
INSERT INTO dbo.table_job(CustomerID, Date) VALUES (@CustomerID, @Date);
SET @JobID = SCOPE_IDENTITY()
SELECT JobID, CustomerID, Date FROM dbo.tabel_job WHERE (JobID = @JobID)



It's also probably a good idea to SET NOCOUNT ON, instead of setting it off. With NOCOUNT OFF, SQL Server will send a message back to the client like "1 Rows affected." Some versions of ADO/MDAC will receive this message and generate a null recordset from it. This may be causing your NullReferenceException. Most likely, though, I think the NullReferenceException is happening because your original proc returns a 0-row recordset.


Grim
(aka Toby)
MCDBA, MCSD, MCP+SB

GeneralRe: C# and SQL Autonumber Pin
Dave Kreskowiak28-May-04 3:26
mveDave Kreskowiak28-May-04 3:26 
GeneralRe: C# and SQL Autonumber Pin
Antonius_r328-May-04 7:26
Antonius_r328-May-04 7:26 
GeneralRe: C# and SQL Autonumber Pin
Dave Kreskowiak28-May-04 7:54
mveDave Kreskowiak28-May-04 7:54 
GeneralRe: C# and SQL Autonumber Pin
Antonius_r329-May-04 3:48
Antonius_r329-May-04 3:48 
GeneralRe: C# and SQL Autonumber Pin
Dave Kreskowiak29-May-04 14:25
mveDave Kreskowiak29-May-04 14:25 
GeneralRe: C# and SQL Autonumber Pin
Antonius_r329-May-04 18:56
Antonius_r329-May-04 18:56 
GeneralRe: C# and SQL Autonumber Pin
Dave Kreskowiak30-May-04 3:22
mveDave Kreskowiak30-May-04 3:22 
GeneralRe: C# and SQL Autonumber Pin
Antonius_r331-May-04 13:02
Antonius_r331-May-04 13:02 
QuestionHow to make points well -distributed ? Pin
fu027-May-04 18:04
fu027-May-04 18:04 
AnswerRe: How to make points well -distributed ? Pin
Broken God28-May-04 20:17
Broken God28-May-04 20:17 
GeneralSNMP MIB : How to use it with C# Pin
youssef27-May-04 12:28
youssef27-May-04 12:28 
GeneralRe: SNMP MIB : How to use it with C# Pin
Dave Kreskowiak28-May-04 3:18
mveDave Kreskowiak28-May-04 3:18 
GeneralRe: SNMP MIB : How to use it with C# Pin
youssef28-May-04 3:42
youssef28-May-04 3:42 
GeneralRe: SNMP MIB : How to use it with C# Pin
Dave Kreskowiak28-May-04 3:48
mveDave Kreskowiak28-May-04 3:48 
GeneralRe: SNMP MIB : How to use it with C# Pin
youssef28-May-04 3:58
youssef28-May-04 3:58 
GeneralDock two forms Pin
Guinness4Strength27-May-04 11:41
Guinness4Strength27-May-04 11:41 
GeneralRe: Dock two forms Pin
Heath Stewart27-May-04 12:27
protectorHeath Stewart27-May-04 12:27 

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.