Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
GeneralDisabling a network card Pin
easander20-Jun-05 4:06
easander20-Jun-05 4:06 
Generalmissing disable property of all input controls Pin
fracalifa20-Jun-05 4:03
fracalifa20-Jun-05 4:03 
GeneralRe: missing disable property of all input controls Pin
Robert Rohde20-Jun-05 7:17
Robert Rohde20-Jun-05 7:17 
QuestionDllImport a class…? Pin
anderslundsgard20-Jun-05 3:48
anderslundsgard20-Jun-05 3:48 
GeneralDatabinding Pin
chukkykzn20-Jun-05 1:45
chukkykzn20-Jun-05 1:45 
GeneralRe: Databinding Pin
Marc Clifton20-Jun-05 3:41
mvaMarc Clifton20-Jun-05 3:41 
GeneralSQL INSERT.. Please Help.. Pin
fire8520-Jun-05 0:02
fire8520-Jun-05 0:02 
GeneralRe: SQL INSERT.. Please Help.. Pin
Mattias Olgerfelt20-Jun-05 0:33
Mattias Olgerfelt20-Jun-05 0:33 
Hi.
To make an update you do not need the data adapter.

Write like this and you will be happy:
<br />
SqlConnection con = ...<br />
try {<br />
  using (SqlCommand cmd = new SqlCommand("INSERT ...", con)) {<br />
    // cmd.CommandType = CommandType.Text; Default is text, ut if you change to something else you should change this here.<br />
   cmd.ExecuteNonQuery();<br />
  }<br />
catch (SqlException ex) {<br />
   // Do stuff...<br />
}<br />
if (con != null) {<br />
   con.Dispose();<br />
   con = null;<br />
}<br />


By the way, using is nice, it runs Dispose() on your command-object automatically. Smile | :)


/M
GeneralRe: SQL INSERT.. Please Help.. Pin
fire8520-Jun-05 18:09
fire8520-Jun-05 18:09 
GeneralRe: SQL INSERT.. Please Help.. Pin
Luis Alonso Ramos20-Jun-05 17:56
Luis Alonso Ramos20-Jun-05 17:56 
GeneralRe: SQL INSERT.. Please Help.. Pin
fire8521-Jun-05 23:59
fire8521-Jun-05 23:59 
GeneralRe: SQL INSERT.. Please Help.. Pin
Luis Alonso Ramos22-Jun-05 5:08
Luis Alonso Ramos22-Jun-05 5:08 
GeneralRe: SQL INSERT.. Please Help.. Pin
fire8522-Jun-05 16:16
fire8522-Jun-05 16:16 
GeneralRe: SQL INSERT.. Please Help.. Pin
Luis Alonso Ramos22-Jun-05 17:23
Luis Alonso Ramos22-Jun-05 17:23 
GeneralTypeName function from VB6 and ActiveX control Pin
Mading19-Jun-05 23:45
Mading19-Jun-05 23:45 
GeneralTAPI using .NET Pin
Andre Trollip19-Jun-05 23:40
Andre Trollip19-Jun-05 23:40 
GeneralRe: TAPI using .NET Pin
Michael P Butler20-Jun-05 2:35
Michael P Butler20-Jun-05 2:35 
GeneralFind LastUser for Word File Pin
YomYom19-Jun-05 22:12
YomYom19-Jun-05 22:12 
GeneralRe: Find LastUser for Word File Pin
ekynox20-Jun-05 11:55
ekynox20-Jun-05 11:55 
GeneralUsing Context Free Grammers Pin
fordge19-Jun-05 22:09
fordge19-Jun-05 22:09 
GeneralRe: Using Context Free Grammers Pin
Roger Alsing19-Jun-05 22:31
Roger Alsing19-Jun-05 22:31 
Questionhow to locate an accurate position in the vectorgraph in C# Pin
greatsft19-Jun-05 22:06
greatsft19-Jun-05 22:06 
GeneralC# remoting Pin
khoadang19-Jun-05 21:37
khoadang19-Jun-05 21:37 
GeneralRe: C# remoting Pin
S. Senthil Kumar19-Jun-05 21:56
S. Senthil Kumar19-Jun-05 21:56 
GeneralSearch file that contains text Pin
wolfganggoldner19-Jun-05 21:02
wolfganggoldner19-Jun-05 21:02 

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.