|
C# has some nice pading functions, so I guess would suggestion pad some spaces to a set width.
So the code is like var.ToString().PadLeft(4) for the St# column unless you are planning on going over 9999 then pad 5 or whatever. You get the idea.
Hope that helps.
Ben
|
|
|
|
|
You could use something like
String.Format("{0,3 }", read["IncCash"].ToString());
only two letters away from being an asset
|
|
|
|
|
Thanx for the replies! I will try that!
Jude
|
|
|
|
|
Troops,
We have a Windows Forms C# app that is getting the following error on startup. Only one user is having this issue in our new release... rolling back to the previous version works fine. I skipped over some of the stack trace.
An exception occurred
Cannot executa a program. ...\v1.1.4322\csc.exe ...
... ... \Temp\mmjry42r.cmdline
at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated( ... )
...
...
at System.Xml.Serialization.Compiler.Compile()
...
Cng.Tlc.LoggingService.LoggingService..ctor()
...
This happens right upon startup when it runs Main() and builds all the controls, including a web service class used for logging data about our application. This LoggingService is being established as it goes thru the stack trace above.
This user does have MSXML 4 SP2 installed on their machine and the other users at that location do not. However, I have that same SP on my machine and I'm fine.
We tried uninstalling the .Net Framework, reinstalling and there's no change. I don't see much on this topic... others are related to .ASP and IIS from what I've seen.
Any ideas?
Thanks,
Stretch
|
|
|
|
|
Hi,
I send emails using the SmtpClient of namespace System.Net.Mail ...
Is there a way to see if the mailmessage was received or an non-delivered message
was sent back to me?
That is, process a mailbox from C# code supplied with credentials ?
The only way i know know is to use my mozilla thunderbird client to receive non-delivered mails
and that's 2-3 steps more than i want to use.. I want this included in my program!
Are there anyone that knows a way to see if non-delivered messages are sent back to my mailbox using any namespace?
Thanks from Daniel, Sweden.
|
|
|
|
|
It would be easier to view the mails on the mail server via imap or pop and search the texts for key text. The returned text is always different dependant on the server or smtp server that rejects it.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
IEnumIDList folderEnum = (IEnumIDList)Marshal.GetTypedObjectForIUnknown(folderEnumPtr, typeof(IEnumIDList));
while (folderEnum.Next(1, out pidlSubItem, out celtFetched) == ShellAPI.S_OK && celtFetched == 1)
{
}
The cycle "while" execute several time ok but suddenly raises exception "First-chance exception at 0x7c81eb33 in Server.exe: 0x80004002 Not supported"
Info about Studio:
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Professional
Whats wrong to my code?
|
|
|
|
|
Hi all,
I'm not sure if that is the write word
i want to have a range of charters ( like some ones name)
and be able to go through every possiblity of each Charter
I am trying to write code that will go through each
a
b
c
aa
ab
ac
aaa
aab
aac
aba
abb
abc
aca
and so on
but only with the Char I parse into a string
Anyone got any ideas?
|
|
|
|
|
Google necklace generating algorithms. Personally I like n-ary trees for this type of algorithm where the data structure itself generates the necklace. Check out my bridges of konigsburg article to steal an tree structure that will do it.
File Not Found
|
|
|
|
|
Put the characters into an array and then make all the indexe permutations.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
could you explain a little more?
|
|
|
|
|
It's not difficult but you have to formulate the question in a more accurate way, i.e. I think that the sequence you gave it's not correct (or I cannot guess correctly what do you want to do...)
I mean, you include
aa
ab
ac
but not
bb
bc
and
cc
that, I think, are legal sequences.
Moreover, do you consider
ba and
ab the same sequence or not?
Finally, I repeat, be more accurate in your request (or explain me what i cannot understand...)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
you are correct sorry it slipped my mind when i was giving the example
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
aaa
aab
aac
aba
and so on
If it were numbers it would just be X=x+1 but in strings i cant figure it out.
|
|
|
|
|
in fact, more difficult (at least to me) then I expected. But finally (with a bit use of recursion):
public static void Main(string[] args)
{
perms("abc");
Console.Read();
}
public static void perms(string s)
{
for (int iDigits=1; iDigits<=s.Length;iDigits++)
{
recurse(s, "", iDigits, 0);
}
}
public static void recurse(string sOrig, string sCur, int iDigits, int iLevel)
{
iLevel++;
for (int i=0; i<sOrig.Length;i++)
{
string sNew =sCur+sOrig[i];
if (iLevel == iDigits)
{
Console.WriteLine(sNew);
}
else
{
recurse(sOrig,sNew, iDigits, iLevel);
}
}
iLevel--;
}
Hope that helps.
P.S. I made a try with perms("abcde") and it runs (the correctness check is up to you...)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks so much for your help
im still strugling to grasp the code
I'm having trouble getting it to run
the "for (int i=0; i"
line is giving errors
usually it would be for (int I=0: i<10;i++) or something like that but I'm not sure exactly what its supposed to be
i will start playing with it in the hopes i can get it working but if you wouldn't mind letting me know what its supposed to be i would be interested to see if i got it right
and again thanks for your help
|
|
|
|
|
Last night was a bit late. The fixed line follows:
for (int i=0; i<sOrig.Length; i++)
Let me know if there are further troubles.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
nope that workes perfectly
thanks for your help
|
|
|
|
|
Hi,
I have DataGridView in my application connecting to Oracle DB. Oracle table has a date as '03/12/2007' and same is returned to the front end via DataSet. However when this dataset is bound to the grid, the date displayed is '03/11/2007'!!! Similarly all the dates that have two (2) digit days (from 10 to 31) are reduced by a digit! e.g. instead of '03/30/2007' it shows '03/29/2007'. If I do not use any formatting for the .DefaultCellStyle property then the date displayed is '03/11/2007 11:00 PM'. Dates with single digit days i.e. '03/08/2007' stays the same though - with or without formatting. Please note that my SQL statement truncates the date to short date format - TRUNC(pay_date) - already.
Any help is really appreciated.
Thanks.
crzYank
|
|
|
|
|
You could try and just use text straight from Oracle and use it as string. If you are using a strong typeing thi might not be possible.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
That should work. I'll try that.
Thanks!
crzYank
|
|
|
|
|
and it worked...........
crzYank
|
|
|
|
|
I have a need to change the Regional And Language Settings/Locale through my C# Application. To further Complicate the matter, it will need to be done using Win CE 5.0 operating system. I have Visual Studio 2005.
Anyone have any suggestions?
Thanks
|
|
|
|
|
|
Thanks for the response. I am doing this project with the Compact framework.
I am not sure how this will help me set the Control Panel -> Regional Settings for different Languages->Cultures using C#/C++.
I Would also be ok with finding a DLL that I could connect to, to use some method within that would help me set the regional values.
|
|
|
|
|
i have an IP and i want to change it to host name
how is that??
thanks allot
|
|
|
|