Click here to Skip to main content
15,879,326 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Ideas for windows form Pin
Abhinav S21-Apr-12 0:11
Abhinav S21-Apr-12 0:11 
GeneralRe: Ideas for windows form Pin
frostcox21-Apr-12 0:20
frostcox21-Apr-12 0:20 
GeneralRe: Ideas for windows form Pin
Benaiah Mischenko24-Apr-12 23:09
Benaiah Mischenko24-Apr-12 23:09 
GeneralRe: Ideas for windows form Pin
frostcox25-Apr-12 8:31
frostcox25-Apr-12 8:31 
Questionhow to disabling the oracle trigger from vb.net Pin
bluesathish17-Apr-12 23:35
bluesathish17-Apr-12 23:35 
AnswerRe: how to disabling the oracle trigger from vb.net Pin
Eddy Vluggen18-Apr-12 0:21
professionalEddy Vluggen18-Apr-12 0:21 
GeneralRe: how to disabling the oracle trigger from vb.net Pin
bluesathish18-Apr-12 0:28
bluesathish18-Apr-12 0:28 
AnswerRe: how to disabling the oracle trigger from vb.net Pin
Eddy Vluggen18-Apr-12 1:10
professionalEddy Vluggen18-Apr-12 1:10 
QuestionPainting Controls in Windows Forms with C# Pin
RiKr217-Apr-12 10:21
RiKr217-Apr-12 10:21 
AnswerRe: Painting Controls in Windows Forms with C# Pin
Eddy Vluggen18-Apr-12 0:20
professionalEddy Vluggen18-Apr-12 0:20 
QuestionBarcode generation in Winforms Pin
dunnarcher23415-Apr-12 22:40
dunnarcher23415-Apr-12 22:40 
AnswerRe: Barcode generation in Winforms Pin
drewclark39815-Apr-12 22:49
drewclark39815-Apr-12 22:49 
AnswerRe: Barcode generation in Winforms Pin
Richard MacCutchan16-Apr-12 1:15
mveRichard MacCutchan16-Apr-12 1:15 
AnswerRe: Barcode generation in Winforms Pin
drewclark39816-Apr-12 17:15
drewclark39816-Apr-12 17:15 
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 
OdbcCommand cmd = new OdbcCommand();
            try
            {
                // cn.Open();
                cmd.Connection = cn;
                cmd.CommandText = "use userdb";
                cmd.ExecuteNonQuery();
                cmd.CommandText = "DROP PROCEDURE IF EXISTS add_emp";
                cmd.ExecuteNonQuery();
                
                cmd.CommandText = "CREATE TABLE emp (empno INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(20), last_name VARCHAR(20), birthdate DATE)";
                cmd.ExecuteNonQuery();

                cmd.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.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            cn.Close();
            Console.WriteLine("Connection closed.");
            try
            {
                Console.WriteLine("Connecting to MySQL...");
                cn.Open();
                cmd.Connection = cn;

                cmd.CommandText = "add_emp;";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("?lname", "Jones");
                cmd.Parameters["?lname"].Direction = ParameterDirection.Input;

                cmd.Parameters.AddWithValue("?fname", "Tom");
                cmd.Parameters["?fname"].Direction = ParameterDirection.Input;

                cmd.Parameters.AddWithValue("?bday", "1940-06-07");
                cmd.Parameters["?bday"].Direction = ParameterDirection.Input;

                //cmd.Parameters.AddWithValue("@empno", MySqlDbType.Int32);
                //cmd.Parameters["@empno"].Direction = ParameterDirection.Output;

                cmd.ExecuteNonQuery();

                            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
           
            cn.Close();
            Console.WriteLine("Done.");
        }

By this code procedure is created successfully bt when it comes to calling that procedure it throws an error
System.Data.Odbc.OdbcException: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.77-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add_emp' at line 1

AnswerRe: Not able to call the procedure. Pin
phil.o15-Apr-12 5:46
professionalphil.o15-Apr-12 5:46 
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 

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.