Click here to Skip to main content
15,908,673 members
Home / Discussions / C#
   

C#

 
Generalremote object Pin
Silly Boy28-May-04 4:15
Silly Boy28-May-04 4:15 
GeneralRe: remote object Pin
Dave Kreskowiak28-May-04 4:29
mveDave Kreskowiak28-May-04 4:29 
GeneralPassing 'Int32' array to COM Pin
kskris28-May-04 2:35
kskris28-May-04 2:35 
GeneralTyped Collection Utility Pin
Colin Angus Mackay28-May-04 2:30
Colin Angus Mackay28-May-04 2:30 
GeneralRe: Typed Collection Utility Pin
Colin Angus Mackay28-May-04 2:48
Colin Angus Mackay28-May-04 2:48 
Generalnice of you Pin
Hesham Amin28-May-04 4:05
Hesham Amin28-May-04 4:05 
GeneralRe: nice of you Pin
Colin Angus Mackay28-May-04 5:00
Colin Angus Mackay28-May-04 5:00 
Generaldeploying application Pin
Ammar Ben Hadj Amor27-May-04 23:25
professionalAmmar Ben Hadj Amor27-May-04 23:25 
QuestionHow to programmitically extract zip file in C# Pin
vinod jadhav27-May-04 22:47
vinod jadhav27-May-04 22:47 
AnswerRe: How to programmitically extract zip file in C# Pin
netclectic27-May-04 23:43
netclectic27-May-04 23:43 
GeneralRemoting Questions Pin
James Simpson27-May-04 22:36
James Simpson27-May-04 22:36 
Generalstrings in DLL calls Pin
Gian27-May-04 21:37
Gian27-May-04 21:37 
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 
Hi,

I am a newbie in C# and SQL programming, and I have questions regarding autonumber for one of my table coloumn. Please kindly guide me.

I have this one table consisting of JobID, CustomerID, and Date.
On the coloumn JobID, I like to put autonumber there, since JobID coloumn is also my primary key for the table, so null is not allowed.

I first build the Data Adapter, by using design view, and make new stored procedure for that table.
I also changed the property on the column by setting the Identity to YES, Identity Seed to 1, and Identity Increment to 1.

I did run the SQL stored procedure, it gave me the autonumber on coloumn JobID, but when I tried to put the command in my windows form, it game me error: "An unhandled exception of type 'System.NullReferenceException' Occured"

These following are the codes that I put on my windows form.

				<br />
                                jobDA.Fill(jobDS, "table_job");<br />
<br />
				DataRow job = jobDS.Tables["table_job"].NewRow();<br />
				job["CustomerID"] = cmb_cust.ValueMember;<br />
				job["Date"] = date.Value;<br />
				tandaterimaDS.Tables["table_job"].Rows.Add(job);<br />
				jobDA.Update(jobDS, "table_job");<br />


and these are the store procedure that I have:
<br />
ALTER PROCEDURE programservice.insert_job<br />
(<br />
	@JobID int output,<br />
	@CustomerID char(20),<br />
	@Date datetime<br />
)<br />
AS<br />
	SET NOCOUNT OFF;<br />
INSERT INTO dbo.table_job(CustomerID, Date) VALUES (@CustomerID, @Date);<br />
	SELECT JobID, CustomerID, Date FROM dbo.tabel_job WHERE (JobID = @JobID)<br />
	SET @JobID = SCOPE_IDENTITY()<br />

Please kindly help me with this problem. I've been stuck here for several days.

Thank you very much in advance.
GeneralRe: C# and SQL Autonumber Pin
Grimolfr28-May-04 3:20
Grimolfr28-May-04 3:20 
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 

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.