+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 25

Thread: Problem with MySql Stored Procedure

  1. #11
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Quote Originally Posted by jmurrayhead View Post
    hmm..interesting...any reason you're using ODBC instead of the MySQL connector? Your syntax before, minus the parenthesis, would have probably worked if you were using that instead.
    i dont know J, i have no experience!

    i thought that may be odbc will be there at the client server and i dont know much abt all this

  2. #12
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Check it out here, micky: MySQL :: Download Connector/Net 5.2
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #13
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Sorry guys....Was in meetings all day yesterday...

    I agree with J...Download the MySQL Connector and use that....You just drop the MySQL dll in your bin folder.

    The namespace is MySQL.Data.MySqlClient

    Then you have MySQL objects: MySQLConnection, MySQLCommand, MySQLDataReader etc....

    Then you just set MySqlCommand.CommandType = StoredProcedure and CommandText to the name of your SP.

    I'm not really using SPs as I found them a bit of a PITA without giving a huge increase in performance, but if you get stuck I'll see if I can help...

  4. #14
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    thanx J n RR!!
    so basically is it better to use "MySQL connector" than odbc one??

    and do u suggest that i shud drop the idea of using SPs with MySql??
    i wanted to use them coz i thought it'll be faster!!

  5. #15
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    I use the mysql connector and don't have any issues....I think it's better to use the connector from MySQL than a generic one, just because it's been developed by the same people that develop the db...

    SPs should be quicker, so if I was you, I'd use them...

    You could always try making up 2 pages, one using an SP and one not and see if you find any performance differences....That's what I did....

  6. #16
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    Thanx for that one RR
    but u said that u didnt find any increase in performance and i also feel they r a little PITA coz of their syntax and all

  7. #17
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Quote Originally Posted by micky View Post
    Thanx for that one RR
    but u said that u didnt find any increase in performance and i also feel they r a little PITA coz of their syntax and all
    I have one page that brings up a list with about 600-700 rows....I found running a query as an SP and running a query in query browser gave very little difference in the speed the query was returned (we're talking milliseconds). Any improvement in the speed the query was returned was completely negated by the time it took .NET to process the page and render it to the screen.

    I didn't delve into db inserts and updates and test them, but maybe where there is a small page load time (ie retrieving a single record), using an SP could improve performance.

  8. #18
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    ok RR, i got u
    thanx for inputs, downloaded the MySql connector and will use it and SPs.

    and surely will be bak with problems

  9. #19
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Quote Originally Posted by micky View Post
    ok RR, i got u
    thanx for inputs, downloaded the MySql connector and will use it and SPs.

    and surely will be bak with problems
    No problem micky....

  10. #20
    Lazy Bum micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky is a jewel in the rough micky's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    1,763
    Blog Entries
    2
    Rep Power
    8

    i m bak
    Code:
    my SP
    CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_LoginCheck`(
      IN EmailId varchar(100))
    BEGIN
      Select First_Name, Last_Name From tblUserMaster Where Email_Id=EmailId;
    END
    
    my new code
    Code:
    Dim Cmd As New MySqlCommand("call sp_LoginCheck", Con)
    
    Dim EmailIDPara As New MySqlParameter("EmailId", Trim(txtEmail.Text), MySql.Data.MySqlClient.MySqlDbType.VarChar, System.Data.ParameterDirection.Input)
    Cmd.Parameters.Add(EmailIDPara)
    
    Dim Dtr As MySqlDataReader = Cmd.ExecuteReader()
    Cmd.Dispose()
    
    While Dtr.Read
              Response.Write("Welcome " & Dtr("First_Name") & " " & Dtr("Last_Name"))
    End While
    
    i get this error using debug
    Code:
    System.InvalidCastException = {"Conversion from string "xxx" to type 'Integer' is not valid."}
    
    y is it converting to integer?

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast

Similar Threads

  1. Dynamic Stored Procedure without Building Strings
    By jmurrayhead in forum SQL Code Samples
    Replies: 11
    Last Post: March 17th, 2009, 01:12 PM
  2. Using Parameterized Stored Procedure
    By richyrich in forum MySQL
    Replies: 14
    Last Post: June 12th, 2008, 08:00 AM
  3. Stored Procedures on MySQL
    By richyrich in forum MySQL
    Replies: 7
    Last Post: June 9th, 2008, 12:15 PM
  4. If statement stored procedure
    By peebman2000 in forum SQL Development
    Replies: 32
    Last Post: May 23rd, 2008, 04:54 PM
  5. Dynamic Stored Procedure
    By jmurrayhead in forum Microsoft SQL Server
    Replies: 16
    Last Post: March 26th, 2008, 12:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO