|
thankssssssssssssss
Palestine
|
|
|
|
|
|
|
Hi,
I have a Typed DataSet that is bind to some winform controls. TextBox, Labelx etc....
At some point, my dataSet values are updated being the scene. The probleme is that my binded controls are not updated automatically when DataSource is updated.
What I have to do to force the rebind of my controls ?
..Etienne Lefrancois
|
|
|
|
|
Hi guys,
I need some help, please.
I am trying to get the sum of two columns in a dataset table.
Here is what I have so far and it seems to be giving me a aggregate error.
SqlDataAdapter adp= new SqlDataAdapter();
SqlCommand cmd= new SqlCommand();
cmd.Connection=cnn;
........
adp.SelectCommand=cmd;
DataSet ds=new DataSet();
adp.Fill(ds,"tbACJE");
System.Data.DataRow rd= ds.Tables["tbACJE"].Rows[0];
Double fTemp=Double.Parse(ds.Tables["tbACJE"].Compute("SUM(rd[0]+rd[1])", "").ToString()); //this doesn't seem to be working.
if(fTemp==0.00)
{
MessageBox.Show(this,"Error");
}
Please help.
sasa
|
|
|
|
|
Why don't you let the database do the calculation, instead of first fetching all the data and make the Table object loop through it?
Example:
cmd.CommandText = "select sum(field1 + field2) as total from tbACJE";
---
b { font-weight: normal; }
|
|
|
|
|
Because I am doing a lot more than just this calculation to the data.
sasa
|
|
|
|
|
(double)ds.Tables["tbACJE"].Compute("SUM(rd[0]+rd[1])", "") probably works as good.
DataTable table = ds.Tables["tbACJE"];
rd[0] and rd[1] are not fields in your db so try
SUM(" + table.Columns[0].ColumnName + "+" + table.Columns[1].ColumnName + ", "")
might work
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi there,
I tried both your methods and I still get the same error which says,
Syntax error in aggregate argument: Expecting a single column argument with possible 'child' qualifier
Any ideas please will be highly appreciated
sasa
|
|
|
|
|
Hi there,
I finally got the error message not to show by doing this, but I am worried if my logic is correct, any suggestions?
Double fTempCR=0.00;
Double fTempDB=0.00;
Double fTemp=0.00;
DataTable table = ds.Tables["tbACJE"];
object sumObjectCR;
object sumObjectDB;
sumObjectCR = table.Compute("SUM(AmtCr)",string.Empty);
sumObjectDB = table.Compute("SUM(AmtDb)",string.Empty);
fTempCR=Double.Parse(sumObjectCR.ToString());
fTempDB=Double.Parse(sumObjectDB.ToString());
fTemp=fTempDB-fTempCR;
if(fTemp==0.00)
Show message
sasa
|
|
|
|
|
Hi everyone
I'm pretty new to visual studio 2005 in combination with C#... I did some GDI+ research en tried to make my own User Control (which contains a circle, a pin and a rectangle that simulates te rotations of a DC motor).
The control works fine (motor rotates, you replace te motor bij an image of an motor...) But when I place this User Control (named MotorGUI) on a form, visual studio shuts down!!!
I have a solution with 2 projects
- client (test form)
- Simulation.Motor (Motor User Control -> compiled into an DLL)
When I drag the Motor User Control which is displayed in the toolbox after building this solution on the form, VS shuts down. Also when I finally got the control on the form by luck... When this control received a focus (in visual studio @design time... VS shuts down too
Can anyone help me? Or give me a suggestion? May be I am making a critical mistake? I can always copy/paste the code of my motorGUI user control.
Thanks in advance!
Rising Sun
|
|
|
|
|
VS itself shuts down ? What if you write code to create the control dynamically and run the exe ? Does the exe work ?
VS2005 kind of sucks, it now will crash with user controls that work perfectly at run time, for example, your rendering code needs to always work, even if no properties have been provided.
There is a property you can use, but I forget it's name. IsDesign, or DesignMode, something like that. That will allow you to write code that doesn't get run in design mode, which is where the problems are.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Creating the control dynamically solved the problem half. When compiling/building the solution, VS still shuts down
After a deeper search -it must be somewhere in the code- the shut down problem arised because one property of my motor hasn't a instance variable and the name of the accessing get/set method was the same name as the veriable!
(I added the method with the class designer (I would say: dangerous)).
But after all, strange that VS just shut down on that kind of a problem? (VS kind of sucks, indeed) I guess when dropping my motor control on a form, VS 'activate' the control and shuts down because the problem above .
Is is always so that a control is running (getting active?) at design time(like my motor DLL component)? It is not a static view I guess? But a sort of 'runtime' view?
Thanks for the DesignMode property hint! That's how I came upon this solution. Everyting works fine after fixing the get/set method.
Thanks Christian!
|
|
|
|
|
Dear gurus,
I'm dealing for a while now with Enterprise Library 2.0 (EL). I'm almost totally lost.
If I search for samples I always find the same samples which seem to be created by exactly three gurus (Alois Kraus, Tom Hollander and David Hayden). This shows me that I'm not the only who does not understand this stuff. It's a greaty pity, because I think EL is nice and interesting. It seems to me as if Microsoft had created EL only for themselfs
Ok, enough complained.
Can somebody help me with classes as FileConfigurationSource or IConfigurationSource in concert with ConfigurationManager and reading from different configuration files.
Thanks a lot in advance
-- modified at 10:15 Tuesday 15th August, 2006
|
|
|
|
|
Yes, there is certainly a lack of good samples for working with enterprise libraries. Most dev shops that need an enterprise framework probably already have one in-house, so adoption of entlib is kinda low. I'm a fan of entlib but not much chance to use it. Perhaps if you post a specific question this forum can be more helpful.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
Friends,
We all know that there are three buttons on titlebar i.e minimize, maximize and close.
I want to add my custom button on the titlebar near minimize button. How can i do so ?
Imtiaz
|
|
|
|
|
With Interop wizardry
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
But how ? What APIs to call ?
Imtiaz
|
|
|
|
|
Try typing in your question (in the subject line) as it is into Google. Take a look at the fourth or fifth result which is the first CodeProject hit. That should explain it all (but it is in C++).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hello
The best practice I can think of is to inherit a class from Windows.Form, and handle its drawing yourself
Otherwise putting a control outside the client area at runtime -though I think it's not impossible- would be extremely difficult
Regards
|
|
|
|
|
hi
you can use this code Smile |
private void btnmin_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
|
|
|
|
|
Dear gurus,
I need your help.
For configuration I Sometimes see two typical files with a name as
"app.config" and "myprog.exe.config".
They seem to have similiar impact/meaning.
Can you give me some advice?
Thanks a log
|
|
|
|
|
After building, app.config gets copied to your bin folder and is renamed as myprog.exe.config. So, as a developer app.config is the one you need to modify as required.
Kevin
|
|
|
|
|
|
Hi.
using the follow code I can answer to a call, but in the while loop, I want to receive data from the calling phone, that a person is speaking.
serialPort1.BaudRate = 56000;
serialPort1.PortName = "COM3";
serialPort1.ReadTimeout = 1000000;
serialPort1.Open();
serialPort1.Write("ATA\n\r"); //Answer a call
string str;
while (true)
{
str = serialPort1.ReadExisting();
}
Best wishes
|
|
|
|