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

C#

 
QuestionRecord Not Insert Pin
mjawadkhatri15-Jul-09 21:31
mjawadkhatri15-Jul-09 21:31 
AnswerRe: Record Not Insert Pin
Mycroft Holmes15-Jul-09 22:06
professionalMycroft Holmes15-Jul-09 22:06 
GeneralRe: Record Not Insert Pin
mjawadkhatri15-Jul-09 22:21
mjawadkhatri15-Jul-09 22:21 
GeneralRe: Record Not Insert Pin
K030615-Jul-09 23:01
K030615-Jul-09 23:01 
GeneralRe: Record Not Insert Pin
mjawadkhatri15-Jul-09 23:21
mjawadkhatri15-Jul-09 23:21 
GeneralRe: Record Not Insert Pin
K030615-Jul-09 23:33
K030615-Jul-09 23:33 
AnswerRe: Record Not Insert Pin
Tom Deketelaere15-Jul-09 23:22
professionalTom Deketelaere15-Jul-09 23:22 
AnswerRe: Record Not Insert Pin
Pete O'Hanlon15-Jul-09 23:30
mvePete O'Hanlon15-Jul-09 23:30 
Where to start?

  1. Give your variables meaningful names. At a glance, what does textBox1 do?
  2. Your code is wide open to a SQL Injection attack. You need to look into using parameterised queries here.
  3. Your insert statement does nothing. You create the command text and then close the connection - you need to execute the command using cmd.ExecuteNonQuery();
  4. You have no exception handling. What happens if you can't connect the database, for instance?

If you had bothered to debug your code, you would have found the problem out in an instant. Learning to debug is one of the most valuable lessons you can master as a developer, and you should learn how to do it before too much longer.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



QuestionAccessing Serial Port Remotely Pin
Liya Kebede15-Jul-09 21:16
Liya Kebede15-Jul-09 21:16 
AnswerRe: Accessing Serial Port Remotely Pin
Garth J Lancaster16-Jul-09 0:38
professionalGarth J Lancaster16-Jul-09 0:38 
AnswerRe: Accessing Serial Port Remotely Pin
monstale16-Jul-09 0:52
monstale16-Jul-09 0:52 
GeneralRe: Accessing Serial Port Remotely Pin
Liya Kebede16-Jul-09 2:07
Liya Kebede16-Jul-09 2:07 
GeneralRe: Accessing Serial Port Remotely Pin
monstale16-Jul-09 2:36
monstale16-Jul-09 2:36 
GeneralRe: Accessing Serial Port Remotely Pin
Liya Kebede2-Nov-09 0:47
Liya Kebede2-Nov-09 0:47 
GeneralRe: Accessing Serial Port Remotely Pin
Member 1247082419-Apr-16 5:03
Member 1247082419-Apr-16 5:03 
Questioncall dll on client side Pin
Member 435374515-Jul-09 21:15
Member 435374515-Jul-09 21:15 
QuestionOwn Report Printer - How to print out Source Code (syntax highlighting) Pin
akamper15-Jul-09 21:09
akamper15-Jul-09 21:09 
Questionuse dataset with case statement Pin
Mamphekgo Bahula15-Jul-09 20:54
Mamphekgo Bahula15-Jul-09 20:54 
AnswerRe: use dataset with case statement Pin
Mycroft Holmes15-Jul-09 21:02
professionalMycroft Holmes15-Jul-09 21:02 
QuestionHow to use public int?!!?!!? windows form. Pin
dimo198215-Jul-09 20:39
dimo198215-Jul-09 20:39 
AnswerRe: How to use public int?!!?!!? windows form. Pin
ichiganboya15-Jul-09 20:44
ichiganboya15-Jul-09 20:44 
GeneralRe: How to use public int?!!?!!? windows form. Pin
dimo198216-Jul-09 6:42
dimo198216-Jul-09 6:42 
GeneralRe: How to use public int?!!?!!? windows form. Pin
Huxley Stronghead16-Jul-09 10:07
Huxley Stronghead16-Jul-09 10:07 
AnswerRe: How to use public int?!!?!!? windows form. Pin
Mycroft Holmes15-Jul-09 21:06
professionalMycroft Holmes15-Jul-09 21:06 
AnswerRe: How to use public int?!!?!!? windows form. Pin
Luc Pattyn15-Jul-09 23:58
sitebuilderLuc Pattyn15-Jul-09 23:58 

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.