Click here to Skip to main content
15,881,803 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Barcode generation in Winforms Pin
elvaernle94316-Apr-12 21:11
elvaernle94316-Apr-12 21:11 
AnswerRe: Barcode generation in Winforms Pin
elvaernle94316-Apr-12 22:07
elvaernle94316-Apr-12 22:07 
GeneralRe: Barcode generation in Winforms Pin
Eddy Vluggen28-Aug-15 5:39
professionalEddy Vluggen28-Aug-15 5:39 
QuestionLeave event is not working. Pin
nitish_0715-Apr-12 8:16
nitish_0715-Apr-12 8:16 
AnswerRe: Leave event is not working. Pin
Luc Pattyn15-Apr-12 8:39
sitebuilderLuc Pattyn15-Apr-12 8:39 
GeneralRe: Leave event is not working. Pin
nitish_0715-Apr-12 9:45
nitish_0715-Apr-12 9:45 
QuestionNot able to call the procedure. Pin
nitish_0715-Apr-12 4:44
nitish_0715-Apr-12 4:44 
AnswerRe: Not able to call the procedure. Pin
phil.o15-Apr-12 5:46
professionalphil.o15-Apr-12 5:46 
If I were you, I would try to initialize my OdbcCommand object instead of just changing the command text :

OdbcCommand cmd;
string commandText;

try
{
   cn.Open();

   commandText = "use userdb";
   cmd = new OdbcCommand(commandText, cn);
   cmd.ExecuteNonQuery();

   commandText = "DROP PROCEDURE IF EXISTS add_emp";
   cmd = new OdbcCommand(commandText, cn);
   cmd.ExecuteNonQuery();

   commandText = "CREATE TABLE emp (empno INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(20), last_name VARCHAR(20), birthdate DATE)";
   cmd = new OdbcCommand(commandText, cn);
   cmd.ExecuteNonQuery();

   commandText = "CREATE PROCEDURE add_emp(" +
      "IN fname VARCHAR(20), IN lname VARCHAR(20), IN bday DATETIME) " +
      "BEGIN INSERT INTO emp(first_name, last_name, birthdate) " +
      "VALUES(fname, lname, DATE(bday));  END";
   cmd = new OdbcCommand(commandText, cn);
   cmd.ExecuteNonQuery();
}


... and so on in your second try block.

Everytime I tried to reuse a command object to do anything else than its original goal, I ran into troubles.
Initiliaze it with new and see what happens.
No memory stick has been harmed during establishment of this signature.

GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 6:31
nitish_0715-Apr-12 6:31 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 5:49
sitebuilderLuc Pattyn15-Apr-12 5:49 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 6:23
nitish_0715-Apr-12 6:23 
GeneralRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 6:26
sitebuilderLuc Pattyn15-Apr-12 6:26 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 6:30
nitish_0715-Apr-12 6:30 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 6:38
sitebuilderLuc Pattyn15-Apr-12 6:38 
AnswerRe: Not able to call the procedure. Pin
Wes Aday15-Apr-12 7:01
professionalWes Aday15-Apr-12 7:01 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 7:17
nitish_0715-Apr-12 7:17 
AnswerRe: Not able to call the procedure. Pin
Dave Kreskowiak15-Apr-12 7:50
mveDave Kreskowiak15-Apr-12 7:50 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 7:53
nitish_0715-Apr-12 7:53 
AnswerRe: Not able to call the procedure. Pin
Bernhard Hiller15-Apr-12 21:42
Bernhard Hiller15-Apr-12 21:42 
GeneralRe: Not able to call the procedure. Pin
nitish_0716-Apr-12 8:28
nitish_0716-Apr-12 8:28 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn16-Apr-12 8:55
sitebuilderLuc Pattyn16-Apr-12 8:55 
GeneralRe: Not able to call the procedure. Pin
nitish_0716-Apr-12 9:20
nitish_0716-Apr-12 9:20 
AnswerRe: Not able to call the procedure. Pin
karthiDebug25-Apr-12 19:11
karthiDebug25-Apr-12 19:11 
QuestionHow to create mysql stored function from c#.net Pin
nitish_0714-Apr-12 23:51
nitish_0714-Apr-12 23:51 
AnswerRe: How to create mysql stored function from c#.net Pin
Eddy Vluggen15-Apr-12 0:30
professionalEddy Vluggen15-Apr-12 0:30 

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.