|
thanks for ur help. but now i want to put this values of dataview in a datatable.but how i can not do it. cause i am new in c#.plz help me...
|
|
|
|
|
i m new in c#.
working in this topic.
but i don't know from where and how to start.
plz help me or give initial comment!
alok
-- modified at 4:23 Monday 29th May, 2006
|
|
|
|
|
What kind of file is that (.msg) ?
If that file is a binary file, you can read it using BinaryReader and write it to text again using StreamWriter.
|
|
|
|
|
If you just want to rename the file, use File.Move()
|
|
|
|
|
hi all,
how i add some day to a given date ?
let's say i have 29/05/2006 and i want to find the corresponding date 40 days from now on ?
is there a method to add the given days count to initial date ?
help please ...
thanks in advance,
bye.
|
|
|
|
|
u can try
DateTime dt=Convert.ToDateTime("29/05/2006").AddDays(40);
rahul
|
|
|
|
|
DateTime.Now.AddDays(40);
|
|
|
|
|
u can use :-
System.DateTime.Parse( "29/05/2006" ).addDays( 40 )
i think u get ur solution.
|
|
|
|
|
I am working on a FTP client that works great but when I use file drop from windows explorer the application crashes and ends. The error breaks at the Application.Run(new Mainform); and gives me the following error: "An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception." If I put a try catch around that I get this error message Exception.Message = "External component has thrown an exception."
I am using Visual Themes and are sure that that is the problem.
<br />
[STAThread]<br />
static void Main() <br />
{<br />
try<br />
{<br />
Application.EnableVisualStyles();<br />
Application.DoEvents();<br />
Application.Run(new MainForm());<br />
}<br />
catch(Exception Ex)<br />
{<br />
MessageBox.Show(Ex.Message,"Runtime Error.",MessageBoxButtons.OK,MessageBoxIcon.Error);<br />
}<br />
}<br />
When I take the EnableVisualStyles(); out it works fine. Also when I do a file drop, my progressbar losses the Visual Theme.
How do I get around this and still use the Visual Themes?
Here is my Drop code:
<br />
private void listView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)<br />
{<br />
if( e.Data.GetDataPresent(DataFormats.FileDrop, false))<br />
{<br />
string[] files_str = (string[])e.Data.GetData(DataFormats.FileDrop);<br />
<br />
foreach(string file_str in files_str)<br />
{<br />
FileInfo droppedFile = new FileInfo(file_str);<br />
<br />
if(droppedFile.Exists)<br />
{<br />
UploadFile(droppedFile);<br />
}<br />
else if(droppedFile.Directory.Exists)<br />
{<br />
DirectoryInfo droppedDirectory = new DirectoryInfo(file_str);<br />
<br />
if(droppedDirectory.Exists)<br />
{<br />
UploadDirectoryChanges(droppedFile.Directory);<br />
}<br />
}<br />
else<br />
{<br />
MessageBox.Show(file_str +"\nis not recognized as a valid file drop.","Unsupported File drop!",MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
}<br />
}<br />
}<br />
}<br />
Leon v Wyk
|
|
|
|
|
Hi,
can v create an array or collection of SqlParameter and how? if so then how it will be added to the SqlCommand object?
If somebody know about article(s) specifically for SqlParameter then Please let me Know!
Thanks,
|
|
|
|
|
Check This
http://www.codeproject.com/dotnet/NET_Data_Access.asp?df=100&forumid=100484&exp=0&select=923320
|
|
|
|
|
Your linked article deals with the Data Access Application Block. The OP never mentioned anything about that.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
thanks 4 ur warning ![Dead | X|](https://www.codeproject.com/script/Forums/Images/smiley_dead.gif)
|
|
|
|
|
Thanks for reply albCode!
but actually i'm not working with stored procedures.
|
|
|
|
|
uroojkhanpk wrote: can v create an array or collection of SqlParameter and how?
Yes:
SqlParameter[] parameters = new SqlParameter[numParameters];
parameters[0] = new SqlParameter.....
uroojkhanpk wrote: if so then how it will be added to the SqlCommand object?
Loop round the array adding each parameter. See the example on MSDN: SqlCommand.Parameters Property[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Thanks a lot Colin Angus Mackay!
|
|
|
|
|
hai all,i read the whole word document and store it into the string and i pass this string into the database,but the size of the .doc is more so i try get only the content of the document(as in naukri) into the string and store the string into db but i didn't get what i want.is there any way to do this?
help me plz..........
my need is:only the content of the document should be transferred to db not all the things in word doc like tabel,specialchar.etc.
ayyp
|
|
|
|
|
I am trying to determine the feasability of converting the SAC Java classes for CSS parsing from from Java to C#. I thought I had read somewhere that you could convert the Java classes to J# then convert them to C#. Also, I thought I had seen a Java converter program from Mircosoft.
Anyone have any suggestions if this is possible and maybe the best approach to take?
|
|
|
|
|
I've never tried J# before. But if you can use your code in J#, then you can also use your code in C#. Just compile your code using J# into DLL and use this DLL from C#.
|
|
|
|
|
Hey,
Check it out bellow link, u wil get some idea.
And try the demo software and you can convert the code,
http://www.tangiblesoftwaresolutions.com/Demo.htm
Thanks,
Mayuri... ![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
Does anyone know any good c# platforms for developing quick applications in SNMP e.g. agent, manager development. Any known good examples of SNMP c# examples.
Cheers
Mike
|
|
|
|
|
i have a .txt file that i have data in there that is seperated using comma and i want to read from this text file and collect all of the data from the text file
for example
:::::::::::::::::::::::::::
12/4/2005,pin
23/4/2006,unpin
i want to be able to read something like that and get all of the informations seperately so i kno that for the first line i have 12/4/2005 and pin differently and liewise for the other line
? can someone prob point me out to a tutorial that can show me how to do this or possibly show me a snippet of code to do this............
and in general i wold appreciate any links to tutorial for c# also
__________________
kenny
|
|
|
|
|
Search "Reading a text file in C#" in google.
Once you have a line of text from the file you can use string.Spilt(','); to seperate the info. Something like:
string currentText;
string [] seperated = currentText.Split(',');
|
|
|
|
|
Thanks Sean89 i tried the snippet of code u gave me and i was able to sperate this sample text string i put in my code just to check
::::
string cfvText="kenny,edmond,walker" ;
:::::::
so i am goign to try and find a tutorial as u say that will assist me to read from a file in c# now, thanks again
kenny
|
|
|
|
|
using(StreamReader sReader = new StreamReader(@"c:\temp\test.txt"))
{
string text = string.Empty;
while((text = sReader.ReadLine()) != null)
{
Console.WriteLine(text);
}
}
|
|
|
|