|
Hello,
System.IO.Path has a lot of fancy methods like:
string extension = System.IO.Path.GetExtension(filename);
All the best,
Martin
|
|
|
|
|
You can check for extension of openFileDialog1.FileName
|
|
|
|
|
Don't delete your question - It is considered rude.
|
|
|
|
|
I am having a strange experience. I have inherited a grid class and written my own class, say myGrid. Now, i am wrapping myGrid object in myPresentationControl class.
when i set the visibility of myPresentationControl object , sometimes OnLeave event of myGrid is firing and sometimes not, any idea what could be the reason?
Thanks
kumar
|
|
|
|
|
Hello,
Maybe it depends on if the Grid has focus or not?
All teh best,
Martin
|
|
|
|
|
hi
we have an excel file opened and contain data, this file is not saved on the hard i want to read the data of this excel file while it i opened in memory
i don`t want to save the file the read it using it`s path i want to read it from the memory
how can i do that
thanks in advance,
haitham
|
|
|
|
|
I don't know if that is possible but if it is you would use the Excel Object Model from the Primary Interop Assembly. If you go search on MSDN you can find all sorts of information about it. The namespace is: Microsoft.Office.Excel
led mike
|
|
|
|
|
Hi, any idea how to calculate files size found in some folder??
string[] arSourceFiles = System.IO.Directory.GetFiles(MyDir);
arSourceFiles.(:confused:);
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Try This....
foreach (string file in arSourceFiles)
{
FileInfo finfo = new FileInfo(file);
int filesize = finfo.Length; // Length returns the size of file.
}
|
|
|
|
|
Looks good enough thank you Mandaar
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
If you also whant to look in the folders of you main folder, you have to go threw it recursive!
Like this:
private double GetFileSize(DirectoryInfo di, double currentsize)
{
double actsize = currentsize;
FileInfo[] AllFiles = di.GetFiles();
DirectoryInfo[] AllDirectories = di.GetDirectories();
foreach(FileInfo fi in AllFiles)
{
actsize = actsize + fi.Length;
}
foreach(DirectoryInfo dinew in AllDirectories)
{
actsize = GetFileSize(dinew, actsize);
}
return actsize;
}
I think there is some feature in .Net >1.1 which does that.
Hope it helps!
All the best,
Martin
|
|
|
|
|
|
|
Hi Friends,
I want to merge to dataset i.e ds1 into ds2 and commit changes in ds2.
I managed to merge but its not commiting changes
Any help Please?
|
|
|
|
|
Try this.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I guess I didn't explain my problem v.well.
Basicaly i have 2 data bases each datbase got 1 table with same schema.
first database table has got 20 rows while 2nd Database has got 5 records
I want to insert other 15 records from first database to 2nd database
I opened two connection connectino 1 and Connection with databaeses respectively and filled 2 DataSets ds1 and ds2 respectively.
I am merging datasets as
ds2.Merger(ds1);
its showing 20 records in ds2 also but its not updating those records in Databaset it showin in debugging mode only.
How can I update those to database. thanks.
|
|
|
|
|
Deer All,
I have created a windows application using C# .NET 2005 and I used Crystal Report Viewr to view three kinds of reports according to different criterias. The starange thing is that the application ran without errors for some days and after that the following error appear and I try to fix it by all things I thought about without any change.
The exception is:
" The type initializer for 'CrystalDecisions.ReportSource.ReportSourceFactory' threw an exception. "
Please, help me as I think later to use Reporting Server instead of Crystal Report but this will be waste for time whitch is the most invaluable thing.
Thanks alot for cutting your valuable time.
Dina A.H
Software Developer
|
|
|
|
|
I have two radiobuttons of same group and three buttons back, next and cancel in the same order. if i check any of the radiobuttons, back button is highlighting. i want Next button to be highlighted.i.e Focus should be on Next button.
Any solutions??
Imran.
|
|
|
|
|
Try setting focus mannually in the Click event or CheckedChanged event of the radio button using BtnNext.Focus()
|
|
|
|
|
Hi.
I want to insert a record in a table and then get it's ID(which is an autonumber field) to use it as a reference in another table. What is the best approach?
Thanks.
|
|
|
|
|
blackjack2150 wrote: I want to insert a record in a table and then get it's ID(which is an autonumber field) to use it as a reference in another table. What is the best approach?
What is the database?
|
|
|
|
|
If this is a MS-SQL database Ive gotten this to work by using a stored procedure and returning @@IDENTITY from the stored proc.
The only other way I know of is to timestamp the record at the time of writing and return the record with that timestamp(or some other form of identifying field) in a query statment.
|
|
|
|
|
Let's continue on the database forum.
This topic can now be deleted by the admin.
Thanks.
|
|
|
|
|
blackjack2150 wrote: This topic can now be deleted by the admin.
Why should he? The admin is busy enough with other things.
|
|
|
|
|
Dear All,
Please let meknow how can I encrypt a string and store the encrypted string in database, then reterive the encrypted string and decrypt it.
thanx
|
|
|
|