|
sunilwise wrote: DateFolder=month(rsdate(0)) & "" & day(rsdate(0)) & "" & year(rsdate(0))
This line can be translated as this:
DateTime dt = DateTime.Parse(rsdate);
string FolderName = String.Format("{0}{1}{2}",dt.Month,dt.Day,dt.Year);
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
thanx for u r reply Mr.Andrei Ungureanu its workin fine;);)
|
|
|
|
|
That is not a good way to format the date, as different dates will share the same folder. For example, the dates 2007-01-11 and 2007-11-01 will both become "1112007".
If you really need to create that format anyway, you can use .ToString("Mdyyyy") to format a date that way.
A better format would be "MMddyyyy", as that would give a unique value for each date, so 2007-01-11 becomes "01112007" and 2007-11-01 becomes "11012007".
An ever better format would be to follow the ISO 8601 order "yyyyMMdd". This is unambigous (as opposed to the dd/MM/yyyy and MM/dd/yyyy formats), and you even get the folders in date order in the explorer.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
|
It was going pretty well, till ....
g_hemanth17 wrote: Can any one send me the code
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
use masked text box it will help u
|
|
|
|
|
Thankyou very much for this email, but may i know what is that for? And what am i supposed to do with this?
Email i just received is as follows:
This is a direct email response to your message on the page "C#". This message has not appeared on the discussion board for that page.
Message from g_hemanth17 <*Email Deleted*>:
i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox...
///////////////////////////////////////////////////////////////////////////////
private void onKeyPress(object sender, KeyPressEventArgs e)
{
char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' };
bool blnNumFnd = false; //for keeping track of decimal
foreach (char c in myNum)
{
if (e.KeyChar == myNum[11])
{
String txt = ((TextBox)sender).Text;
if (!txt.Contains("."))
{
blnNumFnd = true; //means its decimal value and user can't enter another decimal again!
break;
}
}
else if (e.KeyChar == c)
{
blnNumFnd = true;
break;
}
}
if (!blnNumFnd)
e.KeyChar = '\0';
}
---------------
it will take . for only 1 time..like this i want for + and - in the same text box can u try it
hemanth
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice.
Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice.
Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today.
Finally, when someone takes the time to do your job for you, you should show some gratitude instead of complaining that it doesn't do the job you're being paid to do and cannot work out for yourself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I second you Christian
That surely is not the right way of using the "<email>" link!!
Thanks for the support.
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi,
I just want to build an application that can read document and pdf files in C#.net but i don't have any idea about that. Do you guys have any solution for that or any article about that? Please let me know. It would be very nice of you.
Regards,
Arslan Ilyas
Software Engineer
Red Signal
|
|
|
|
|
|
I think it would be helpful for me. Thank You
Arslan Ilyas
Red Signal
|
|
|
|
|
Hi Arslan,
Using "Advanced Search" of this site (www.codeproject.com), search for "pdf" in the articles, selecting "C#". You will get alot of articles for that.
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
|
Hi Guys. I am running an export from my db to csv. I would like to populate the Exported Column in the DB with a 'Y' to show that the record has been exported. Can somebody please tell me how I can do this? Below a snip of the export code. Also, if I do this, how do I only export records that are marked as N in the ["Exported"] Column in the table?
private void toolStripButton2_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(@"C:\nefz.csv", false);
DataTable dt = m_dtCallCentre;
int iColCount = dt.Columns.Count;
for (int i = 0; i < iColCount; i++)
{
sw.Write(dt.Columns[i]);
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString());
}
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
}
I would like to enhance this to search for value 'N' in ["Exported"] column, export the record and change the value to 'Y'.
Any help with this would be greatly appreciated.
|
|
|
|
|
Hi,
Can you describe a little bit about table structure i.e. columns, keys etc, you want to export?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hi. Exporting the data is fine. What I want to do is mark a specific column in the Table with a Y once the record has been read by the StreamWriter. The export routine is in my original post.
|
|
|
|
|
Hi,
How can I calculate the size of the parameters that I supply to a web service method?
thanks,
- ferudun
|
|
|
|
|
I want to keep the values in "frog" readonly. However, for some reason I'm not being allowed to set these values in my constructor, even though the error reads:
A readonly field cannot be assigned to (except in a constructor or a variable initializer)
*Note: {{ and }} replace angle brackets, which HTML can't handle
public struct foo<br />
{<br />
public readonly List{{frog}} al;<br />
<br />
public struct frog<br />
{<br />
public readonly int legs;<br />
public readonly int eyes;<br />
}<br />
<br />
public foo(int unususedInt)<br />
{<br />
al = new List{{frog}}();<br />
frog myFrog = new frog();<br />
myFrog.legs = 2;<br />
myFrog.eyes = 2;<br />
al.Add(myFrog);<br />
}<br />
}
What am I doing wrong, and how can I implement this?
|
|
|
|
|
JoeRip wrote: public foo(int unususedInt)
{
al = new List{{frog}}();
frog myFrog = new frog();
myFrog.legs = 2;
myFrog.eyes = 2;
al.Add(myFrog);
}
It looks like you have the legs and eyes fields on your struct set as readonly. I doubt the error you're encountering is being generated from writing to the list, but instead setting the properties on the frog instance. Hope this helps.
|
|
|
|
|
Sorry, I misread the first time....
Since those fields are readonly in addition to your list, you need to set them in the a constructor of the frog struct. You might try adding something like the following to your frog struct.
public frog(int legs, int eyes)
{
this.legs = legs;
this.eyes = eyes;
}
so your entire program would look like....
public struct foo
{
public readonly List<frog> al;
public struct frog
{
public frog(int eyes, int legs)
{
this.eyes = eyes;
this.legs = legs;
}
public readonly int legs;
public readonly int eyes;
}
public foo(int unususedInt)
{
al = new List<frog>();
al.Add(new frog(2, 2));
}
}
Hope that solves your prob. Sorry it took me twice to get the problem.
|
|
|
|
|
Interesting, I'll try this. Thanks for your help.
Man, I have to get a better grip on the difference between the instance data and the... uh, non-instance data. Apparently all of my questions about using a struct come down to this.
|
|
|
|
|
I have a problem while using MDI childs in DOTNET C#. On may MDI Parent when one child is maximized all chileds are maximized. But i want to stop some forms from maximizing.
Can any one help me
|
|
|
|
|
Hi..
I am using ASP.NET 2.0 +C#. In my webpage, I have a listbox. I have declared the listbox as shown below:
<code> <td align="center" valign="middle" style="width: 160px">
<asp:ListBox ID="lstPickAvillQueue" runat="server" Height="120px" Width="144px">
</asp:ListBox></td></code>
I want to provide a horizontal scrollbar so that long names can be easily seen. How to provide the horizontal scrollbar to the listbox?
Thank You
Venkat
|
|
|
|