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

C#

 
AnswerRe: Difference in showing forms Pin
Luc Pattyn18-Jan-07 3:22
sitebuilderLuc Pattyn18-Jan-07 3:22 
AnswerRe: Difference in showing forms Pin
Drew McGhie18-Jan-07 3:55
Drew McGhie18-Jan-07 3:55 
GeneralRe: Difference in showing forms Pin
Russell Jones18-Jan-07 4:39
Russell Jones18-Jan-07 4:39 
GeneralRe: Difference in showing forms Pin
Drew McGhie18-Jan-07 5:28
Drew McGhie18-Jan-07 5:28 
Questionform -> database [modified] Pin
pawcio_be18-Jan-07 2:55
pawcio_be18-Jan-07 2:55 
AnswerRe: form -> database Pin
V.18-Jan-07 3:30
professionalV.18-Jan-07 3:30 
GeneralRe: form -> database Pin
pawcio_be18-Jan-07 3:52
pawcio_be18-Jan-07 3:52 
GeneralRe: form -> database Pin
V.18-Jan-07 4:10
professionalV.18-Jan-07 4:10 
sql.ExecuteNonQuery() should not be commented.
Also make sure that the insert statement is correct and the connection openen correctly...

Here's an example of the insert method I use in my component:

	<br />
public int ExecuteInsert(string stmnt){<br />
	DB_STATUS dbstat = DB_STATUS.UNDEFINED;<br />
	try{<br />
		Sqlconn.Open();<br />
		dbstat = DB_STATUS.CONNECTION_OK;<br />
		try{<br />
			SqlCommand Sqlcmd = new SqlCommand(stmnt);<br />
			Sqlcmd.Connection = Sqlconn;<br />
			SetNrOfRowsAffected(Sqlcmd.ExecuteNonQuery());<br />
			dbstat = DB_STATUS.EXECUTE_OK;<br />
		}											//end try<br />
		catch(Exception e2){<br />
			errormessage = stmnt + " " + e2.Message;<br />
			dbstat = DB_STATUS.EXECUTE_FAILED;<br />
		}											//end catch<br />
		Sqlconn.Close();<br />
	}												//end try<br />
	catch(Exception e1){<br />
		errormessage = Sqlconn.ConnectionString + " " + e1.Message;<br />
		dbstat = DB_STATUS.CONNECTION_FAILED;<br />
	}												//end catch<br />
	return (int)dbstat;<br />
}													//end function ExecuteInsert<br />


hope this helps.

V.

Stop smoking so you can: Enjoy longer the money you save.
Moviereview Archive

GeneralRe: form -> database Pin
pawcio_be18-Jan-07 5:49
pawcio_be18-Jan-07 5:49 
GeneralRe: form -> database Pin
V.18-Jan-07 20:38
professionalV.18-Jan-07 20:38 
GeneralRe: form -> database Pin
Eytukan18-Jan-07 20:51
Eytukan18-Jan-07 20:51 
QuestionImage Processing - problem with copying data Pin
Michael O.18-Jan-07 2:51
Michael O.18-Jan-07 2:51 
AnswerRe: Image Processing - problem with copying data Pin
Luc Pattyn18-Jan-07 3:26
sitebuilderLuc Pattyn18-Jan-07 3:26 
Questiontrusted connection Pin
fmardani18-Jan-07 2:48
fmardani18-Jan-07 2:48 
AnswerRe: trusted connection Pin
BlaiseBraye18-Jan-07 2:50
BlaiseBraye18-Jan-07 2:50 
Questionhow to cancel the adding row process in DataGridView? Pin
BlaiseBraye18-Jan-07 2:46
BlaiseBraye18-Jan-07 2:46 
Questioninform app of changes in database content Pin
zt.Prog18-Jan-07 2:42
zt.Prog18-Jan-07 2:42 
AnswerRe: inform app of changes in database content Pin
BlaiseBraye18-Jan-07 2:48
BlaiseBraye18-Jan-07 2:48 
GeneralRe: inform app of changes in database content Pin
zt.Prog18-Jan-07 3:13
zt.Prog18-Jan-07 3:13 
GeneralRe: inform app of changes in database content Pin
BlaiseBraye18-Jan-07 3:29
BlaiseBraye18-Jan-07 3:29 
AnswerRe: inform app of changes in database content Pin
Rick van Woudenberg18-Jan-07 2:53
Rick van Woudenberg18-Jan-07 2:53 
AnswerRe: SqlTriggerContext? Pin
zt.Prog20-Jan-07 23:40
zt.Prog20-Jan-07 23:40 
Questionweb service Pin
michael_jhons18-Jan-07 2:16
michael_jhons18-Jan-07 2:16 
AnswerRe: web service Pin
Rick van Woudenberg18-Jan-07 2:33
Rick van Woudenberg18-Jan-07 2:33 
Questionlogin Pin
fmardani18-Jan-07 1:56
fmardani18-Jan-07 1:56 

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.