Click here to Skip to main content
15,171,873 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Barcode generation in Winforms Pin
elvaernle94316-Apr-12 22:11
Memberelvaernle94316-Apr-12 22:11 
AnswerRe: Barcode generation in Winforms Pin
elvaernle94316-Apr-12 23:07
Memberelvaernle94316-Apr-12 23:07 
GeneralRe: Barcode generation in Winforms Pin
Eddy Vluggen28-Aug-15 6:39
professionalEddy Vluggen28-Aug-15 6:39 
QuestionLeave event is not working. Pin
nitish_0715-Apr-12 9:16
Membernitish_0715-Apr-12 9:16 
AnswerRe: Leave event is not working. Pin
Luc Pattyn15-Apr-12 9:39
sitebuilderLuc Pattyn15-Apr-12 9:39 
GeneralRe: Leave event is not working. Pin
nitish_0715-Apr-12 10:45
Membernitish_0715-Apr-12 10:45 
QuestionNot able to call the procedure. Pin
nitish_0715-Apr-12 5:44
Membernitish_0715-Apr-12 5:44 
AnswerRe: Not able to call the procedure. Pin
phil.o15-Apr-12 6:46
mvephil.o15-Apr-12 6: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 7:31
Membernitish_0715-Apr-12 7:31 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 6:49
sitebuilderLuc Pattyn15-Apr-12 6:49 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 7:23
Membernitish_0715-Apr-12 7:23 
GeneralRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 7:26
sitebuilderLuc Pattyn15-Apr-12 7:26 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 7:30
Membernitish_0715-Apr-12 7:30 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn15-Apr-12 7:38
sitebuilderLuc Pattyn15-Apr-12 7:38 
AnswerRe: Not able to call the procedure. Pin
Wes Aday15-Apr-12 8:01
professionalWes Aday15-Apr-12 8:01 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 8:17
Membernitish_0715-Apr-12 8:17 
AnswerRe: Not able to call the procedure. Pin
Dave Kreskowiak15-Apr-12 8:50
mveDave Kreskowiak15-Apr-12 8:50 
GeneralRe: Not able to call the procedure. Pin
nitish_0715-Apr-12 8:53
Membernitish_0715-Apr-12 8:53 
AnswerRe: Not able to call the procedure. Pin
Bernhard Hiller15-Apr-12 22:42
MemberBernhard Hiller15-Apr-12 22:42 
GeneralRe: Not able to call the procedure. Pin
nitish_0716-Apr-12 9:28
Membernitish_0716-Apr-12 9:28 
AnswerRe: Not able to call the procedure. Pin
Luc Pattyn16-Apr-12 9:55
sitebuilderLuc Pattyn16-Apr-12 9:55 
GeneralRe: Not able to call the procedure. Pin
nitish_0716-Apr-12 10:20
Membernitish_0716-Apr-12 10:20 
AnswerRe: Not able to call the procedure. Pin
karthiDebug25-Apr-12 20:11
MemberkarthiDebug25-Apr-12 20:11 
QuestionHow to create mysql stored function from c#.net Pin
nitish_0715-Apr-12 0:51
Membernitish_0715-Apr-12 0:51 
AnswerRe: How to create mysql stored function from c#.net Pin
Eddy Vluggen15-Apr-12 1:30
professionalEddy Vluggen15-Apr-12 1: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.