|
Thanks.
I'm still not 100% sure how to format this in the datagrid to the value I want.
|
|
|
|
|
ma se wrote: If I have the following, what is the value of decEuro if the textbox txtEuro is empty? decimal decEuro = Convert.ToDecimal(txtEuro.Text.Trim());
The Visual Studio help file tells you (use MSDN if you don't have Visual Studio) that you will throw an ArgumentException if the value is null, FormatException if "value does not consist of an optional sign followed by a sequence of digits (zero through nine) and an optional decimal point symbol.'
ma se wrote: Is decimal the best data type used for a currency value?
I don't work with currencies, I can't help you there.
ma se wrote: public static Object CheckDecimalForDB(decimal decCheckDecimal)
{
if(decCheckDecimal != 0)
return decCheckDecimal;
else
return DBNull.Value;
}
The datatype/type returned when decCheckDecimal contains a value, is decimal, or Object?
When it contains a value, it will be a decimal. You will need to caste it as such. The proper technique is:
decimal value = (decimal)CheckDecimalFOrDB( d ) as decimal;
if ( value != null ) {
....
}
Again the help file has this documented. Look up 'as operator'.
Can't help you with the Euro Formatting
My suspicion is that you should use the Response.Redirect. The Server.Transfer is performed strictly on the server side, the browser is unaware that it has been directed to a new page. If the user does a refresh, they will be redirected back to the original page.
Response.Redirect causes the browser to request the new page. Values will need to be passed by other means such as a cookie or session state. If session state is used and memory is an issue, be sure to recover the session memory by setting the values to null after you have extracted them.
See the Visual studio help file at ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dv_vbcode/html/vbtskCodeExamplePassingDataFromOneWebPageToAnother.htm
Brian Leach
|
|
|
|
|
Hi guys.I need to build a PlotControl where my graph will be shown but I got no idea how to do it.Maybe anybody an help me with any reference?I would be very grateful
|
|
|
|
|
If you tell me more about your plotboard, do you want to draw it with GUI+, maybe make graphics class, I dont know, send me a mail, I try to help you.
Percy Bloomfield
Santa Cruz - Bolivia
|
|
|
|
|
Is There any way to get the method name inside a method.
ie public int GetName { puts("I'm called from function: GetName" }
|
|
|
|
|
|
Close this window (if you close the mother form, it close all the forms child)
this.Dispose();
_________________
Dispose the cursor
this.Cursor.Dispose();
_________________
Hide this form
this.Hide();
_________________
If title (text) is X: Do X think
if (this.Text == " YOUR TEXT ")
{
THE ACTION THAT YOU WANT THAT THE APPLICATION DOES IF THIS CONDITION IS TRUE
}
else
THE ACTION THAT YOU WANT THAT THE APPLICATION DOES, IF THE CONDITION IS FALSE
_________________
Reset a form
NAME.Text = "";
_________________
Thank you
|
|
|
|
|
What's your question ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't know how to put a navigation bar control into the toolbox control, which is the same toolbox in Visual Studio.Net IDE. I'm in dark. Please help me, thanks a lot!
NPS.
|
|
|
|
|
The controls in any Microsoft product tend to be custom written, so they have the edge for a while, then custom control writers make money on selling the 'VS UI' or the 'Office UI' toolkit.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I only know for the .NET Framework v2.0
There is a control which is named
System.Windows.Forms.ToolStripDropDownButton
This control could be added in the control bar.
I recommend to download the Visual Studio 2005 c# express edition beta2 (for free because its a beta).
There is a very good formdesigner in there.
Yours sincerely,
Berni
|
|
|
|
|
Hi,
I have another question, that is regarding to the posting using C#. I am writing an application that is suppose to post data for further processing to another person. I am aware of posting data to the file using file stream. Is there any other mehtod available that data will be carry over ethernet so that I can create another page to retrieve those results. Here is another challenge I am facing, I don;t want to carry that data using URL string. I want that data to be hidden from the user. I am aware of sessions but I have double dimension arrays, and I don't how to use sessions to store the double dimension arrays. I will appreciate any input on this issue. Thanks,
IT specialist
|
|
|
|
|
Hi Guys,
I have another question. I was wondering if there is a way to user Server.Create method that was supported in ASP. Can you please provide me gidance regarding that. I have a dll that happens to work with Server.Create object and it is residing on server. I tried to use that dll as reference in C# web project, but Ihad no luck with it. Now I have decided to use that dll by using Server.Create object. Any help will be appreciated. Thanks,
|
|
|
|
|
Isn't Server.Create for COM objects? If so, just use COM interop.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I've created a class that needs to have a subclass array of the same class, so basically my class contains an array of itself. Does this make sense? What is the best way to go about doing this? Basically I need to make a heirarchy of these classes that can never end
Class
Class1
ClassA
ClassB
Class2
All these classes have the same properties.
Thanks,
JGA
-- modified at 20:49 Monday 24th October, 2005
|
|
|
|
|
You mean an array of class types ? You can't do this, because Class1 cannot derive from ClassA and ClassB, and if it did, this couldn't work when both classA and classB expose the same methods. The obvious thing would be to create an interface, and impliment it in all of these classes, but your class heirarchy would be flat, you could have one base class at most on each level, and they would all impliment the interface in the same way
What are you trying to do ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a todo list heirarchy and each element can have it's own properties (due date, title, priority). so I can have:
Class=
Title:Version 1
DueDate: 12/01/05
Priority: High
SubClass:
Title:Create blah
DueDate: 10/26/05
Priority: High
I'm reading from an XML File to get all of the data, the XML format is something like:
<TODOLIST>
<TASK DUEDATE=10/24/05 TITLE=ASDF PRIORITY=HIGH>
<TASK TITLE=sdfa></TASK>
</TASK>
Does that make sense at all?
|
|
|
|
|
OK - so there's no reason in the world to create a class heirarchy. All you need to do is create a class ( or a struct, more like it ), that contains a reference to itself as a parent and a collection of items that represents it's children ( so you can iterate in either direction ).
So you need one class, like this
class myClass
{
private string title;
private DateTime dueDate;
private PrioryEnum priority; // Create an enum for this
private myClass parent;
private ArrayList children;
}
Then add properties for access as needed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
do you'd just create an arraylist of class myclass right?
|
|
|
|
|
jgallen23 wrote: do you'd just create an arraylist of class myclass right?
If you're using VS2005, then yes, you can create an array of a specific type. Otherwise, the arraylist will contain only objects, but yes, it would be an array of the class instances that are the children of the current object.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi All
I must ask 2 question that i cant find the answer for them
1. When i use c++ [MFC] i add the function GetDlgCtrlID to get Ctrl Id of the CButotn os CList when i set some event of the Button or list.
Does in C# there is some parallel method that return the ID of the control ?
2. I need to load some WAV file and play it in Real Time.
How can i do it in C# ?
Thanks for the help.
|
|
|
|
|
yanshof wrote: Does in C# there is some parallel method that return the ID of the control ?
The base control class has an ID property. The ID is a string, not a number, as it was in C++.
yanshof wrote: 2. I need to load some WAV file and play it in Real Time.
How can i do it in C# ?
Import the PlaySound API using pinvoke, or use Managed DirectSound.
[DllImport("coredll.dll")]
public static extern int PlaySound(
string szSound,
IntPtr hModule,
int flags);
public enum PlaySoundFlags : int {
SND_SYNC = 0x0, // play synchronously (default)
SND_ASYNC = 0x1, // play asynchronously
SND_NODEFAULT = 0x2, // silence (!default) if sound not found
SND_MEMORY = 0x4, // pszSound points to a memory file
SND_LOOP = 0x8, // loop the sound until next sndPlaySound
SND_NOSTOP = 0x10, // don't stop any currently playing sound
SND_NOWAIT = 0x2000, // don't wait if the driver is busy
SND_ALIAS = 0x10000, // name is a registry alias
SND_ALIAS_ID = 0x110000,// alias is a predefined ID
SND_FILENAME = 0x20000, // name is file name
SND_RESOURCE = 0x40004, // name is resource name or atom
};
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can you guys tell me if these are correct? I'm parsing a file, word by word, and I'm trying to see if they fit into the correct format.
The first format is if the token is a double. Meaning we have 1234 or 1234.0123
What I have is if( (Regex.IsMatch( token, @"\d*")) || (Regex.IsMatch( token, @"\d*[.]\d*")) )
The second is if it is a letter followed by any other alphanumeric up to 10 characters total in length:
if( Regex.IsMatch( token, @"\b[a-zA-z]\w{2,3,4,5,6,7,8,9}\b") )
Do those look right?
Thanks in advance!
|
|
|
|
|
jeweladdict wrote: What I have is if( (Regex.IsMatch( token, @"\d*")) || (Regex.IsMatch( token, @"\d*[.]\d*")) )
You can do this with one regex
@"\d*([.]\d*)?"
jeweladdict wrote: if( Regex.IsMatch( token, @"\b[a-zA-z]\w{2,3,4,5,6,7,8,9}\b") )
YOu can shorten {2,3,4,5,6,7,8,9} to {2, 9}.
Expresso is the program you need to test your regex, just google it, I think it's on CP tho.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
@"\d*([.]\d*)?" seems to work for IP addresses as well. I tried using the @"\b\d*([.]\d*)?\b" but that didn't seem to help. I'm only looking for numbers that are possible doubles. Any ideas?
|
|
|
|
|