Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
GeneralRe: A way to overlay a transparent image on the screen that does not respond to the mouse. Pin
bions1-May-17 10:24
bions1-May-17 10:24 
GeneralRe: A way to overlay a transparent image on the screen that does not respond to the mouse. Pin
Dave Kreskowiak1-May-17 14:06
mveDave Kreskowiak1-May-17 14:06 
GeneralRe: A way to overlay a transparent image on the screen that does not respond to the mouse. Pin
Richard MacCutchan1-May-17 20:43
mveRichard MacCutchan1-May-17 20:43 
QuestionCrystal Report installation File missing Error and Run time file loading error Pin
Member 1253182629-Apr-17 9:47
Member 1253182629-Apr-17 9:47 
AnswerRe: Crystal Report installation File missing Error and Run time file loading error Pin
CHill6029-Apr-17 9:55
mveCHill6029-Apr-17 9:55 
AnswerRe: Crystal Report installation File missing Error and Run time file loading error Pin
OriginalGriff29-Apr-17 21:33
mveOriginalGriff29-Apr-17 21:33 
GeneralRe: Crystal Report installation File missing Error and Run time file loading error Pin
Richard Andrew x6430-Apr-17 9:26
professionalRichard Andrew x6430-Apr-17 9:26 
QuestionHow to fill DataGridView Cells on cellvaluechanged in MYSQL in C#? Pin
TatsuSheva28-Apr-17 23:33
TatsuSheva28-Apr-17 23:33 
I have a DataGridView in which there are 4 columns; Reference,Quantity, Rate and Amount.
The DataGridView is Editable. When I enter a value in the Reference Column then immediately it will fill the other values in the others cells from mysql database.
This is what I tried....

C#
private void TAB_Credit_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {

            try
            {
                if (TAB_Credit.CurrentCell.ColumnIndex == 0)
                {

                    MySqlDataAdapter sa = new MySqlDataAdapter("SELECT * FROM table WHERE Reference='" + TAB_Credit.Rows[e.RowIndex].Cells["Reference"].Value + "'", MyConnexion);
                    DataTable dt2 = new DataTable();

                    sa.Fill(dt2);
                    
                        double value = (double)TAB_Credit.Rows[e.RowIndex].Cells["Quantite"].Value * (double)TAB_Credit.Rows[e.RowIndex].Cells["PU"].Value;

                        TAB_Credit.Rows[e.RowIndex].Cells["Designation"].Value = dt2.Rows[0]["Designation"].ToString();
                        TAB_Credit.Rows[e.RowIndex].Cells["Quantite"].Value = dt2.Rows[0]["Quantite"].ToString();
                        TAB_Credit.Rows[e.RowIndex].Cells["PU"].Value = dt2.Rows[0]["Prix_Unitaire"].ToString();
                        TAB_Credit.Rows[e.RowIndex].Cells["Total"].Value = value.ToString();


                    }
                    
            }
            catch
            { }
        }

So in the datagrid, when I insert in the Reference Cell nothing is appearing in the other cells.
Thank you.
SuggestionRe: How to fill DataGridView Cells on cellvaluechanged in MYSQL in C#? Pin
CHill6029-Apr-17 2:32
mveCHill6029-Apr-17 2:32 
AnswerRe: How to fill DataGridView Cells on cellvaluechanged in MYSQL in C#? Pin
User 418025429-Apr-17 3:01
User 418025429-Apr-17 3:01 
QuestionHOW I CAN MOVE LIGHT POINT FROM POINT TO POINT IN TIME Pin
Member 1315403828-Apr-17 21:16
Member 1315403828-Apr-17 21:16 
AnswerRe: HOW I CAN MOVE LIGHT POINT FROM POINT TO POINT IN TIME Pin
Richard MacCutchan28-Apr-17 21:33
mveRichard MacCutchan28-Apr-17 21:33 
AnswerRe: HOW I CAN MOVE LIGHT POINT FROM POINT TO POINT IN TIME Pin
OriginalGriff28-Apr-17 21:50
mveOriginalGriff28-Apr-17 21:50 
QuestionHow can I use serialize and Deserialize to realize Store Function when update code? Pin
smallkubi27-Apr-17 16:03
smallkubi27-Apr-17 16:03 
AnswerRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
Richard MacCutchan27-Apr-17 21:53
mveRichard MacCutchan27-Apr-17 21:53 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
smallkubi28-Apr-17 2:47
smallkubi28-Apr-17 2:47 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
Richard MacCutchan28-Apr-17 3:05
mveRichard MacCutchan28-Apr-17 3:05 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
smallkubi28-Apr-17 18:00
smallkubi28-Apr-17 18:00 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
Richard MacCutchan28-Apr-17 21:28
mveRichard MacCutchan28-Apr-17 21:28 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
smallkubi28-Apr-17 22:33
smallkubi28-Apr-17 22:33 
GeneralRe: How can I use serialize and Deserialize to realize Store Function when update code? Pin
Richard MacCutchan28-Apr-17 22:40
mveRichard MacCutchan28-Apr-17 22:40 
QuestionPrint number of copies depending on the textbox input and put page numbers C# Pin
de winta26-Apr-17 21:40
de winta26-Apr-17 21:40 
QuestionScreensaver denied access to process/window list ? Pin
andymo221-Apr-17 11:12
andymo221-Apr-17 11:12 
GeneralRe: Screensaver denied access to process/window list ? Pin
Eddy Vluggen21-Apr-17 12:30
professionalEddy Vluggen21-Apr-17 12:30 
GeneralRe: Screensaver denied access to process/window list ? Pin
andymo222-Apr-17 2:56
andymo222-Apr-17 2:56 

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.