|
Hi all,
one big disadvantage (that's my feeling) of .Net-App is, the application startup delay on the first start (loading libraries etc.). I am going to write a "Do nothing Apps" which will be loaded on autostart, so that the libraries are in memory an the other applications will start faster.
.... or is there a much better way to improve the startingtime ?
Frank
|
|
|
|
|
That might work, until you load something that the OS decides is more important and frees up the unused, but still cached, libraries.
I guess I wouldn't bother. All you're doing is moving the problem around. Now you're computer will boot that much slower! And you still won't have solved your "first time load" time delay.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
I have a new lunatic idea,
I write a VB6 app's, showing a pretty logo and the hourglass cursor, do a process-start of my .net app's and make a challange to the user to cook e new coffee, make two or three phone calls and than...... my app's still ready to work.
.... o.k we are in the Einstein Year - time is relative - if we move slower ... time goes faster or something like that.
That's another day of microsoft frustation.
Frank
|
|
|
|
|
Don't do it.
If you send the loading time to system startup, you will make it slower every time; and it's not every time that your users turn on their computer to use your app, is it?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
hi,
i use asqldatareader to read my data which the commandtext
has two transaction inside,when i attempt to get the data by Read() method it gets the first result set and the other is lost,when i use NextResult() method i get the other result set but first result of the set is skipped,
what should i do?
here is my commandtext:
mycommand.CommandText="SELECT COUNT(TypeId) FROM mytable1; SELECT Name, TypeId FROM mytable2 ";
|
|
|
|
|
|
hi,
here is my code:
com.CommandText="SELECT COUNT(TypeId) AS idcount "<br />
+"FROM NewsTypes ; SELECT Name, TypeId FROM NewsTypes "<br />
+"ORDER BY TypeId";<br />
try<br />
{<br />
SqlDataReader rd=com.ExecuteReader();<br />
rd.Read();<br />
temp=new NewsTypes[(int)rd["idcount"]];<br />
int index=0;<br />
while(rd.NextResult())<br />
{<br />
rd.Read();<br />
temp[index]=new NewsTypes((string)rd["name"],(short)rd["typeid"]);<br />
index++;<br />
}
thanks
|
|
|
|
|
Hi UAU,
The problem is with your while statement. Instead of that use a do while loop while using the NextResult on datareader. Guess the following code will help you.
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "";
conn.Open();
SqlCommand percommand = new SqlCommand("select * from person;select count(*)as name from person;",conn);
SqlDataReader reader = percommand.ExecuteReader();
do
{
while(reader.Read())
{
MessageBox.Show(reader["name"].ToString());
}
}while(reader.NextResult());
Thanks and Regards
SGS
|
|
|
|
|
|
unfortunatley this doesnt work yet,i lost first row of
the next resultset,i examined several ways but i loose my rows
|
|
|
|
|
|
I did so but i lost the first row of resultset.
I think i'd better use dataset instead.
|
|
|
|
|
My windows application creates word documents from template document with bookmarks and data from database. I create one document for each user, e.g. I select five users and application creates five MS word documents filled by data from database. Documents are saved in memory. I use reference to "Microsoft Word 9.0 Object Library" (MS Word 2000). My target is application creates word documents and merges into one document and saves it. Can you help me?
|
|
|
|
|
Have a look here[^].
It's a Web-based solution but it's quite similar to what you are after, and can easily be ported to a Windows application.
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi Guys,
I have a problem though I think it's hard to solve this unless you see the codes. Allow me to share to you and if you have any ideas that can help or comments is most welcome.
I have a tracking system web based program that record a daily activity of a certain operation department. Most of the time 2 or more users are working at the same time from different building. What I',m doing since it's a header/ detail information everytime they create new record and fill up the detail part I saved the record straight to our SQL database using a temporary key then when the USER PRESS a SEND BUTTON what I do is update the TEMP KEY with the original key of a record. The problem is that IF two users do this at the same time sometimes I get the other information record so when I open the file the next time for checking there is inconsistency of record because I can see that the information on the screen is supposed to be in the other person. If two page are open at the same time SOMETIMES I saved the page information which is wrong.
I don't used GLOBAL variable, all are local. Any Ideas?
Thanks
/dabuskol
|
|
|
|
|
I think you should consider reviewing your Database structure rather than your application's architecture. A good way for handling concurrent multi-usability would be to provide locks on the tables you are using (e.g. pessimistic/optimistic record or table locks, etc.).
I haven't done this before on SQL Server but I am 101% sure there are ways to handle multiple users.
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi,
Can someone help me to pass parameters from C# to a .au3 file (with a sample preferably).
Regards,
Abi
|
|
|
|
|
How to merge / include / embed an image file (such as jpg, wmf, etc.) in an Assembly so that the image file is also compiled inside the Assembly executable itself, instead of keeping the same as an outside file.
Keeping an image file outside the Assembly requires the presence of the image file alongwith the executable, causing error if the user has by mistake deleted the image file.
|
|
|
|
|
Have a look here[^].
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi,
1) Create a resource file using ResEditor.
2) Using AddExistingItem option of the project add the resource file to the project and Build the application.
3) Use the ResourceManager class to retrieve these resources (use getstring and GetObject methods).
Thanks and Regards
SGS
|
|
|
|
|
Hi,
Can someone help me to pass parameters from C# to a .au3 file (with a sample preferably).
Regards,
Abi.
|
|
|
|
|
I've finally gotten my Crystal Reports to work with a DataSet. However, I am now facing a new problem.
I created a packing list in Crystal Reports, but now we need to be able to modify how the interface reacts based on data in the report - hence, the need for using a DataSet. Because of the amount data involved, the same data that is collected in the C# and passed as a parameter field to Crystal, is being used in a WHERE clause to limit the amount of data pulled into the DataSet (if we pulled everything into the dataset every time, we would be pulling 300-500 orders 400-700 times a day - too much load.)
The problem with this approach is that the DataSetis limited to the particular order that a box belongs to. Each time they try to process another box, it starts from scratch (theoretically). However, it only seems to work on the first box because something is keeping stale data. I tried disposing the dataset and dataadapters at the beginning of each try, refreshing the report object before and/or after setting the datasource method, and refreshing the reportviewer object before and/or after setting the reportsource method. All to no avail.
At this point I'm at a loss as to what to do to refresh the data so that I'm not using stale data each time I run the report. Any ideas would be greatly appreciated.
--In a world without fences, who needs Gates?
|
|
|
|
|
I wrote a class that binds a specific property of a control to Properties in another class. For example, given the class below:
<br />
public class MyClass<br />
{<br />
public int MyProperty<br />
{ get {
{ set {
}<br />
I can bind the SelectedIndex property of a ComboBox to MyClass.MyProperty
It all worked great until I run into properties that return enumerated types.
I looked at the IL code of my classes and the enumerated types are int32 so when I call the PropertyInfo.SetValue method with the value casted to int32 my program still crashes. The error I get is System.ArgumentException "Object type cannot be converted to target type".
I did try using Whidbey and it works, but I can't wait until it gets released.
Following is my code:
<br />
private void SetPropertyValue(object obj, string propertyName, string val)<br />
{<br />
Type objectType = obj.GetType();<br />
PropertyInfo propInfo = objectType.GetProperty(propertyName);<br />
string dataType = propInfo.PropertyType.FullName;<br />
<br />
if (dataType == "System.Integer" || dataType == "System.Int32")<br />
{<br />
propInfo.SetValue(obj, Convert.ToInt32(val), null);<br />
}<br />
else if (dataType == "System.Decimal")<br />
{<br />
propInfo.SetValue(obj, Convert.ToDecimal(val), null);<br />
}<br />
else if (dataType == "System.String") <br />
{<br />
propInfo.SetValue(obj, val, null);<br />
}<br />
else<br />
{<br />
Int32 val2 = Convert.ToInt32(val);<br />
propInfo.SetValue(obj, val2, null);
}<br />
}<br />
|
|
|
|
|
You can't set a property whose type is enum to an int. You have to convert it to an enum type. The best way to do this is to get the type of the property you are SETTING, using PropertyInfo.PropertyType. Then, using that type, get the TypeConverter from the TypeDescriptor.GetConverter. Test for "CanConvertTo", and if successful, to a ConvertTo and pass the resulting object to the SetValue method.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|