Questions tagged [mysqlcommand]

Represents a SQL statement to execute against a MySQL database.

13 questions
2
votes
2 answers

How to Select an out parameter from a MySql Procedure in .net

Assume we have a stored procedure like so CREATE PROCEDURE CopyValue(IN src INT, OUT dest INT) BEGIN SET dest = src; END I want to call this from a .net app (assume connection etc created successfully) var sql = "call CopyValue(100,…
Binary Worrier
  • 50,774
  • 20
  • 136
  • 184
1
vote
0 answers

MySqlCommand c# - How to ignore custom row parameter whilst replacing other params in command text

So I'm trying to use the following syntax to produce a row number for each result, where: @row is created as the query runs and @search is a parameter I've added myself: var cmd = new MySqlCommand(); cmd.CommandText = @"SET @row = 0; …
Dave
  • 5,283
  • 7
  • 44
  • 66
1
vote
2 answers

C# : Cancelling MySqlCommand using CancellationToken giving NULLReferenceException

I was trying to cancel a MySqlCommand using a CancellationToken. The query executes successfully when cancellation is not requested. public async Task ExecuteNonQueryAsync(string connectionString, string query, CancellationToken…
jophab
  • 5,356
  • 14
  • 41
  • 60
0
votes
1 answer

How to submit all MySQL command only by one time Clicking on Button Event in C# Winforms

Dear folks, btnSubmit_Click is not able to process the code and showing error in MySql Syntax Error. I just wanted to insert the textbox input into the database at the same time select Cus_ID from database and reinsert into Orders table. In the…
parz
  • 19
  • 2
0
votes
1 answer

Re: MySQL 8.0 Command Line Client Error 1205

MySQL 8.0 Command Line Client is giving me a timeout error and I have restarting the transaction by typing "start transaction" another time. Keep in mind that I have another command line open with the table CIA_DATA.new_table and it is also being…
0
votes
0 answers

How do I upload to rds mysql db using mysql command line directly from aws s3 bucket in aws cloudshell

I'm posting this question because I searched for an answer for several days and finally determined the correct syntax. Using mysqldump - create .sql file backup for rds database in s3 bucket using pipe (|) syntax mysqldump -u admin -p -h…
0
votes
1 answer

Update sql table column by applying a C# function to another column

I need to update a table column by applying a defined function to that column. Using MySqlCommand for example. Eg. I have a C# defined function that cleans text string GetCleanText(string text_to_clean) and in one of my tables, I have a column…
Belkacem Thiziri
  • 605
  • 2
  • 8
  • 31
0
votes
1 answer

Object cannot be cast from DBNull to other types in C#

I wrote this code : MySqlCommand command1 = new MySqlCommand("SELECT SUM(standard_one) FROM `challenge` WHERE (SELECT DAYOFWEEK(date)=1) AND challenge_id = @challenge_id and username = @username", db.getConnection()); …
0
votes
2 answers

How to concatenate single quote in MySQL query with VB.NET parameter?

I am making a MySQL Select query using MySQLCommand object in VB.NET were I use parameters. I am facing an issue, in my where clause, I need to put the value for the criteria into single quote, I tried to use backslash ' (\') to escape the single…
0
votes
0 answers

MYSQL error code:1805 password won't update

When mysql password expired.I tried to set it.But I get this following error while I'm reset password. ERROR:Failed! Error: Column count of mysql.user is wrong. Expected 45, found 46. The table is probably corrupted How I can resolve this problem...
0
votes
2 answers

Receiving error on eecute reader that my sql syntax is incorrect

I am going to guess the issue is that I have two seperate queries inside one command. Is there a way to get around this? The connection string is filled with example data but it connects correctly. I'm also aware that it's not secure to put…
Ocheezy
  • 113
  • 1
  • 11
-1
votes
2 answers

MySQL command, without using Manual input

How to create a table which is included this by MySQL command without using Manual input, see the pic blow: enter image description here
-2
votes
1 answer

MySQL select with OR operator

In C# desktop application I use MySqlConnection MySqlCommand cmd.CommandText: "select * from reg where username='" + user + "' and password='" + pass + "' and key='" + key + "'"; to selects records, but I'm trying to figure out, how to use OR…
user11137294