|
No shame in offering solutions.
|
|
|
|
|
I installed "CRRuntime_32bit_13_0_19" but in installation time it give me file missing error
I ignored that and it installed.
Now when i make a report by wizered it runned successfully but when i give it data table as datasource to it give the file not load error
|
|
|
|
|
Perhaps you ought to re-install the package and not ignore the error this time?
|
|
|
|
|
As CHill60 says, ignoring a missing file is probably not a good idea. If you bought a new car and when it was delivered one of the front wheels was missing, would you accept it and expect it to work fine? No? So why would you expect software to work with a big chunk missing either?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Send wheelz! Urgent!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
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....
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.
|
|
|
|
|
Get rid of the try-catch. You are swallowing any exceptions that are being raised which is very, very bad practice.
Also never, ever use string concatenation with user-entered information to create sql commands - you are leaving yourself wide open to SQL Injection attacks - see Query Parameterization Cheat Sheet - OWASP[^]
Make those two changes and see what happens. If there is an error reported let us know what it is.
|
|
|
|
|
Do not repost you have already posted this in C# questions.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
i want to create point and move it from point to another point on picturebox in time
i want this code in c#
|
|
|
|
|
Member 13154038 wrote: i want this code in c# Then you will need to write it; this site does not provide code to order.
|
|
|
|
|
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
When I finished serialize and Deserialize,and create a local file .
But if i need update code, i create a new variable in SerializationInfo ,for example ,I declare a new variable "A" in code. But when i deserialize exist old local file, the exception warning is "can not find A", so Deserialize failed. How can i do if i want to ignore A when deserialize old files?
|
|
|
|
|
It depends how your deserialisation is working, but basically you need something in the file to tell you which version the contents were created with.
|
|
|
|
|
how to do it? I don't know how to do....Could u send me an example?
|
|
|
|
|
Example of what? I have no idea what your code is doing or how you are managing your data. Just think about what you are trying to do. If you change the definition of a class after it is serialised, then the data will no longer match. So you need some way to use the previous definition to deserialise it. How you achieve this will depend a lot on the structure of your data and the associated classes.
|
|
|
|
|
Yes, but i have no idea to achieve it...Could u help me?
For example,
Class A
{
int a=0;
int b=0;
}
When i finished serialise class A and create a local file "Saved".
When i update my Class A
Class A
{
int a=0;
int b=0;
int c=0;
}
Then deserialise "Saved", it will throw exception ,how can i do it? I hope when i deserialize "Saved",it will ignore c.
|
|
|
|
|
You cannot do it with the new class, because it does not match. You must deserialize into an instance of the old class and then copy the data to the new one.
[edit]
If the new version of your class is actually based on the original you may be able to do it that way using a cast. Should be easy to test.
[/edit]
|
|
|
|
|
Oh, actually, my Class is a form , i use serilized to store input data, like textbox or radiobutton data.
When my project version update, maybe i will add some textbox or other controls in form class, so i will not deserilize old file, i don't know how to handle it.
Please tell me a method to realize save function.
|
|
|
|
|
You probably need to write a custom serialiser.
|
|
|
|
|
Please help i am new to C# and i have a windows form with textbox1, textbox2, and buttom1 i would like to print the value of textbox1 without previewing or let me say straight to the printer without any interactions, textbox value has to be the number of capies i would love to print and also to page number all those copies say if i input 3 it should say page 1/3 2/3 3/3 please help and excuse my english i have the following code under my button
private void button1_Click(object sender, EventArgs e)
{
PrintDocument printDocument = new PrintDocument();
printDocument.DefaultPageSettings.Landscape = true;
printDocument.DefaultPageSettings.PaperSize = new PaperSize("zed", 400, 850 );
//printDocument.PrinterSettings.Copies = 2;
printDocument.PrintPage += PrintDocumentOnPrintPage;
printDocument.Print();
|
|
|
|
|
Hello all,
I have a (personal) screensaver that shows particular content based on what applications are running. Under Win10 the program runs perfectly when executed directly (ie. running the exe), however when the program is executed from Windows10 (via screensaver trigger) the application can no longer enumerate Process windows.
Specifically:
If i use the following code snippet:
using System.Diagnostics;
Process[] processlist = Process.GetProcesses();
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
}
}
and run the application I get a proper list of open windows. But if the SAME application is launched as a screensaver, the above code produces nothing. Never had this issue under Win7 or previous.
Does anyone have any idea what might be happening ?
Thanks in advance,
Andy
|
|
|
|
|
Disclaimer; I never touched Win10 - but it may just be running as another user. Something like the SYSTEM account, with limited rights.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the reply. I checked and SYSTEM has full admin privledges. I even changed and made sure that the app had FULL access as either myself or SYSTEM. Same effect.
(It's hard doing a google search on this because you get a zillion hits for "how to change your screensaver" LOL)
Still stuck ...
Andy
|
|
|
|
|
Your only recourse is to add debug/logging code to the screensaver to find out what is going on when it runs for real.
|
|
|
|
|
andymo2 wrote: I checked and SYSTEM has full admin privledges. Great. Format your box, or throw it away - SYSTEM is a limited account for a reason.
Another scenario where this would fail would be if the screensaver (or the OS) opens a new desktop. You may not have enumerate-priviliges there, and it may not have any open windows.
Is there error-logging included in the code? Iow, are you sure there is no exception thrown that terminates the execution of the screensaver?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|