Adding text and image to database with C# and SQL

The following windows form application takes an input for name, age, gender, description, and an image. However when clicking the “Save Information” button the following exception error …

How to Insert C# values to MySql?

I want to insert C# winform values to Mysql there are 3 columns name,id are TextBox text and gender is ComboBox value but there is error and error messsage said: MySql.Data.MySqlClient.MySqlException:…

update command C# DataGridView to SQL

I’m attempting to update a SQL table from C# project datagridview “Work_Table”. However when I attempt to make the update I get this error “Update unable to find TableMapping [‘…

How many SQL Queries will be executed in the database through this EF

I have the following and want to know how many queries will be executed in the DB through this EF? private static dbContext dbc = new ProfileDBC(); private static IQueryable GetProfile(…

C# DatagridView fill with class SingleResponsibility

Hi StackOverflow members, I decided to build a library project to improve myself. I created a class to code Book Operations but i couldn’t find out how to fill datagrid via class method. When i text …

“Column name or number of supplied values does not match table definition” when trying to upload data to my DB

this is the C# code of the query (trying to make it so I can upload images to my DB table): protected void ButtonInsert_Click(object sender, EventArgs e) { insert(); } public …

SSIS Script C# Script Task to Add current date to a file using a variable

Im have this script to add current year month to a file in a directory. It works perfect with the directory path, but I want to change the directory patch for a variable, because every month its going …

Set Sql to Single User mode From C# and Create Admin User

I have a c# winform application which connects to a database and read data. This database is used by another app also. I just executed a query from my app to read some data. I don’t have the user …

Seeding a table with Foreign key

I encountered a problem where I cant seed an SQL script since it has a foreign key constraint, I tried context.SaveChanges() but it isn’t working. Is there any way how this can be done? protected …

SQL – Select with group by, Get data from the register with the max(date)

I have two tables in the database: Product and ProductVersion , each product can have n ProductVersions. ProductVersion has this fields ( Id, name, origin, date, provider ) I want a query where I get …