Click here to Skip to main content
15,888,324 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to sync two or more collocation database server? Pin
Gilbert Consellado7-Mar-17 1:58
professionalGilbert Consellado7-Mar-17 1:58 
QuestionFoxpro DBF, Joining a table with multiple columns that can return more than 1 record and projecting it into a list(Of Pin
jkirkerx27-Feb-17 8:07
professionaljkirkerx27-Feb-17 8:07 
Questionintegration of flash to javadb Pin
Member 1302448026-Feb-17 19:38
Member 1302448026-Feb-17 19:38 
AnswerRe: integration of flash to javadb Pin
Mycroft Holmes26-Feb-17 21:53
professionalMycroft Holmes26-Feb-17 21:53 
GeneralRe: integration of flash to javadb Pin
Richard Deeming26-Feb-17 23:43
mveRichard Deeming26-Feb-17 23:43 
QuestionGetting data Pin
Member 1302296325-Feb-17 0:23
Member 1302296325-Feb-17 0:23 
AnswerRe: Getting data Pin
Richard MacCutchan25-Feb-17 20:48
mveRichard MacCutchan25-Feb-17 20:48 
Questionc# to call MySQL Update Stored Proc error Pin
jonmy24-Feb-17 0:00
jonmy24-Feb-17 0:00 
Hello,

I'm trying to call the following MySQL SP:

DROP PROCEDURE IF EXISTS tgc.UpdateCustomerBalance;
CREATE PROCEDURE tgc.`UpdateCustomerBalance`(customerId varchar(50), cost Decimal(8,2))
BEGIN
UPDATE Customers SET Balance = Balance - cost WHERE CustomerId = customerId;
END;


with the following C# code:

C#
try
            {
                using (var context = new Db_Entities())
                {
                object[] parameters =
                {
                    new MySql.Data.MySqlClient.MySqlParameter("@customerId", customerId),
                    new MySql.Data.MySqlClient.MySqlParameter("@cost", cost)
                };
                  
                await context.Database.ExecuteSqlCommandAsync("UpdateCustomerBalance @customerId,@cost", parameters);
                }
            }
            catch (Exception e)
            {
                throw;
            }


But I receive the error:

"Message": "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 'UpdateCustomerBalance 'xyz',0.03' at line 1",


Can anyone help shed some light on this? I've tried all sort and am now seeing tunnel vision.

Incidentally, this works:

await context.Database.ExecuteSqlCommandAsync("UPDATE Customers SET Balance = Balance - " + cost + " WHERE CustomerId = '" + customerId + "'");


All help appreciated.
AnswerRe: c# to call MySQL Update Stored Proc error Pin
Richard Deeming24-Feb-17 0:26
mveRichard Deeming24-Feb-17 0:26 
GeneralRe: c# to call MySQL Update Stored Proc error Pin
jonmy24-Feb-17 0:37
jonmy24-Feb-17 0:37 
QuestionSave a Query as a View issue Pin
john_berman21-Feb-17 11:35
john_berman21-Feb-17 11:35 
AnswerRe: Save a Query as a View issue Pin
Richard Deeming21-Feb-17 12:04
mveRichard Deeming21-Feb-17 12:04 
QuestionTime Variance Query works - Sorry it needs a tweak Pin
john_berman21-Feb-17 9:48
john_berman21-Feb-17 9:48 
QuestionMySql Resource Pin
BobbyStrain20-Feb-17 14:12
BobbyStrain20-Feb-17 14:12 
AnswerRe: MySql Resource Pin
Peter Leow20-Feb-17 16:08
professionalPeter Leow20-Feb-17 16:08 
QuestionTricky Query that includes a time difference Pin
john_berman20-Feb-17 6:09
john_berman20-Feb-17 6:09 
AnswerRe: Tricky Query that includes a time difference Pin
Richard MacCutchan20-Feb-17 6:22
mveRichard MacCutchan20-Feb-17 6:22 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 6:45
john_berman20-Feb-17 6:45 
GeneralRe: Tricky Query that includes a time difference Pin
Richard Deeming20-Feb-17 6:52
mveRichard Deeming20-Feb-17 6:52 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 7:04
john_berman20-Feb-17 7:04 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 7:06
john_berman20-Feb-17 7:06 
QuestionDatabase Design - Help Appreciated Pin
john_berman19-Feb-17 21:03
john_berman19-Feb-17 21:03 
AnswerRe: Database Design - Help Appreciated Pin
Mycroft Holmes19-Feb-17 21:38
professionalMycroft Holmes19-Feb-17 21:38 
GeneralRe: Database Design - Help Appreciated Pin
john_berman20-Feb-17 6:07
john_berman20-Feb-17 6:07 
QuestionDB Case Sensitivity, unexpected/surprising behaviour Pin
User 1106097918-Feb-17 1:17
User 1106097918-Feb-17 1:17 

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.