Skip to content

Tag: c#

DataGridView selected row to check a checkbox

I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview. I have gotten this to display text with TexBoxes, but cannot get it to check a check box. Yes = True No = False Any recommendations, would be very much appreciated. The table being displayed is bound by’binding source’ the

C# Multiple comboBoxes used in MySQL Where

Im trying to learn using MySQl with C# so im creating app that allow sorting and adding data to my tables. That is code that i use to show items selected only by my comboBox_1 value. But now i want to add 2nd comboBox and show data that meets both conditions. The problem is i have no idea how to

How to insert images of picture box which is created by for loop?

If user enters 5 this loop creates 5 pictureboxes Here I have a click event for selecting image of each picture box My question is… How can I insert those images of pictureBoxes into SQL SERVER at once? can anyone help ? appreciate it. Answer If you have 5 picture boxes in your application and in your database table there

Search in the database

This Messages form display table with these informations (ID,FROM,TO,TITLE,MESSAGE). I am trying to search for all the messages send to a certain user . user will enter his name in the Search_textBox then it will filter the table to keep only messages to this user. I get this error : Answer this is Correct

SQL | C# – Reader rows

I have a small problem with MySqlDataReader. I have data in MySql and I have column “name” and X rows under. Reader reads sucessfully all of this but output is in one string and looks like “FirtSecondThird” but i need all of this words in list word by word. The code is: Does anyone know what to do with it?

Build efficient SQL statements with multiple parameters in C#

I have a list of items with different ids which represent a SQL table’s PK values. Is there any way to build an efficient and safe statement? Since now I’ve always prepared a string representing the statement and build it as I traversed the list via a foreach loop. Here’s an example of what I’m doing: Which feels very unsafe