Storing a value from SQL database to a variable

Storing a value from SQL database to a variable

I tried this code to extract a single value from my database and store it in a variable. But it extracts the value&nbsp;<code>Supplier ID</code>&nbsp;instead of&nbsp;<code>Quantity</code>.

I tried this code to extract a single value from my database and store it in a variable. But it extracts the value Supplier ID instead of Quantity.

string query3 = "SELECT Quantity FROM Supplier WHERE [Supplier ID]='"+supplierid+"'";
SqlCommand cmd3 = new SqlCommand(query3, con);
con.Open();
string temporaryquantity = cmd.ExecuteScalar().ToString();
MessageBox.Show(temporaryquantity);

How can I extract Quantity instead of Supplier ID?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts|Simpliv

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective