|
as Aaron said,
assign the retrived file array to a fileinfo object and use the properties to get the filename or extension.
FileInfo fileinfo = new FileInfo(files[0]);
long sFileSize = fileinfo.Length;(gives u the file size)
fileinfo.Directory etc.......
|
|
|
|
|
I'm working to an aplication that uses a database of 7000 records (MS Acccess database). When I load my aplication, it takes a lot of time (to much anyway).I think that I can load my database faster, but I don't know how.Can someone help me? Thank you.
|
|
|
|
|
Nicostancila wrote: Can someone help me?
It's almost impossible without knowing what you're doing currently. So provide the code of question or at least some more details what you're doing when you load your application.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Access isn't the best database for a lot of things. It is hard to answer without knowing exactly what you are trying to do, but some suggestions....
If you have a 2 tier application where multiple users connect to the database, Access does not support connection pooling, so you have a lot of connections open to the same database/table. This will slow down Access quite a bit.
If the relationships in the database are complex and you are (or are not in some circumstances) forcing the restraints/relations to be upheld in the program, that will drain Access.
Are you filling a datatable with a dataadapter? If so, how many times are you doing it? (Check to make sure your sequence of events doesnt load the data twice). If using commands and a datatable, set BeginLoadData=true before reading the data to the datatable, and =false when done. This temporarily keeps restraints from being enforced.
If none of that helps, more info is needed.
Aaron
|
|
|
|
|
Hi Aaron,
So, which kind of database do you recommmend for applications that require several connections at the same time? For example, a server containing just one database and multiple clients loading from it.
Thanks
Kurtz
|
|
|
|
|
try loading your data selectively. or filter only the data that you need.
|
|
|
|
|
i have image file on hard disk (jpg,gif or png)
i want to insert this image file as binary in field in database
this field has varbinary data type
and when i select this field i show the binary data in picturebox
please help me
thanks
MD_NADA
|
|
|
|
|
Hello
1- Write your image so a stream of bytes using Image.Save(Stream, ImageFormat) method.
2- Write that array of bytes to your database.
3- When reading the image from the file reverse the process and use Image.FromStream(Stream) to read the stream into the image object.
4- Use the PictureBox.Image property to display your image.
Regards
|
|
|
|
|
This question has been asked and answered many, many times. I suggest you search the forum.
|
|
|
|
|
Hi,
I have a web site with:
A MasterPageDefault and
Page1 and Page2, which both referes to MasterPageDefault.
On MasterPageDefault I have put a delete button. Now in the codebehind file, I want to delete two diferent things which depends on what page I stand on. Therefore I need to know, which page I stand on.
Is there anyone, who can help me, to find some code, which kan determe on which page I stand on?
Kind regards,
simsen
|
|
|
|
|
What framework variable do I use to access the path to My Documents?
|
|
|
|
|
My Documents is a "special folder" and is accessed using the Shell. So however the framework exposes the Shell that is how you get the solution.
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
That is not an answer to my question.
|
|
|
|
|
They hide the rest of the information in the Documentation[^]
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
Hello
string MyPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Regards
|
|
|
|
|
The Documentation says it works with 1.1 but I'm not seeing the enum SpecialFolder.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
Hello
Why don't you see it in your intellisense?? It should appear. Try writing without the intellisense. What compile error -if any- appears?
Piece of advice:
Remove you email address to avoid the possibility of spamming.
Regards
|
|
|
|
|
I have a class
public class myclass : BindingList<T> {}
I have created(shadowed) the GetEnumerator method to provide some custom sorting and what not.
But the problem is the type can be Category, Topic, or Entry.
And I need to test each one because each has its own sorting strategy.
I tried if( typeof(T) is Category) but that doesn't work.
What is the easiest way to determine the type T is?
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
typeof(T) will always return a type of T, and T is really a type identifier. What you may try is this:
public void Sort(T item)
{
if ( item is Category )...
if ( item is Volume ) ...
}
|
|
|
|
|
lol. its a GetEnumerator(). Theres no definition like that.
<br />
Type t = typeof(T);<br />
<br />
if( t.Equals(Category) )<br />
<br />
I figured it out just a second ago
Thanks tho
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi,
In my Win form, I have a variable name string myVar.
Ok, now I want to bind this varibale to a binding source same like a control's certain property is bound to a member of a data binding source.
Right now, In order to do this, I placed a hidden text box bound to a data binding source (text property) and created an event handler for TEXT CHANGED event and on text change, I update the value of the variable with the content of that hidden text box.
Now, How can I avoid this hidden text box and directly bind the variable with a certain member of a data binding source.
Thanks in advance.
Regards,
|
|
|
|
|
You can do the same thing by creating a datatable, add a column named something with a typeof(string) and your data becomes bound to a "datasource".
For example: I'm adding a datasource for my checkboxes so that sorts keep the state of the checkbox.
....
batchSelectColumn = new DataGridViewCheckBoxColumn();
batchSelectColumn.Width = 30;
batchSelectColumn.DisplayIndex = 0;
batchSelectColumn.Name = "BatchSelectColumn";
batchSelectColumn.ThreeState = false;
batchSelectColumn.DataPropertyName = "SelectColumn";
batchSelectColumn.HeaderText = string.Empty;
viewer.BatchGrid.Columns.Add( batchSelectColumn );
DataTable BATCHHEADER = new DataTable();
BATCHHEADER.Columns.Add( "SelectColumn", typeof(bool) );
|
|
|
|
|
Hi,
Thanks for your reply.
As I always make same table columns in dataset as available in real SQL database. Because, I did not learn if I have extra column in my dataset which is really not in SQL, then How can I reflect the changes of that DataTable to the original SQL database.
Now, would you please help me to with an idea, how can I access the bounded column’s value directly from my code ? In order to explain my question, please allow me to give you an example.
In the property editor of a Textbox, there is a property for databinding. In that property editor, I can use visual editor to set the text property of the text box to a bounded data column of the datasource (Selecting a NODE from the DataSource Table – Column Tree).
Now, how can I GET or SET value to that data column directly using variable from programming code ? By doing that, when the binding navigator will be used to navigate data row by row, I will be able to show a calculated value to a control from a particular data column’s value.
Thanks a lot in advance as I asked a long question.
|
|
|
|
|
is there a way to cancel a foreach loop before it has iterated through the entire collection, without throwing an exception?
i have a loop that feeds a string to a switch() and i want it to terminate if a certain parameter is fed to it.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|