|
Am I missing something about how Visual Studio works?
Page_Unload is executed the first time that I open a page. Is this designed to be this way?
I thought that by its name, this method would be executed when the server removes the page from memory...not loading the page into memory. And, "yes" I can already see something of a conflict within my own statement. The Page_Unload method must be read into memory before the server can run it...but, that does not imply it should execute...does it?
Any commentary to improve my understanding would be appreciated.
Thanks.
SD
|
|
|
|
|
I always thought "Load" and "Unload" where bad terms for web app API in this situation. In this case it should have been "Pre"/"Post" or some other pair of terms I'm drawing a blank on. The idea is that when the server touches the object for some activity it fires a "Load" and when it is done with it it fires a "Unload". The action that triggered the pair of events may not have anything to do with actual Html or sending data to the client. The object itself has a "lifetime" outside of these pair of events as well (the object might be created hours before the actual event, the object might not be disposed for hours).
Ultimately, having web controls behave this way is desirable over being tied to create/destroy events.
-- modified at 10:40 Friday 30th September, 2005
|
|
|
|
|
Tom,
the flood lights just went on. Thanks for the terminology seperation, too. Page_Unload is not what I needed at all.
Best Regards,
William
|
|
|
|
|
Hi everybody...
I have crystal report 9.x for VS.NET installed with my VS.NET 2003 installation CD.I want to create dynamic reports at runtime with crystal reports. I searched in google and found that, it needs RAS (Report application Server) of crystal report that is not contained in VS.NET 2003 installation CD.Please tell me where I can download it from the web ?
Best Regards,
Xironix
[ _ Always there is another way _ ]
|
|
|
|
|
hi,
i have am retrieveing data from file and populating dataset and now i have to search some data, i dont want to treverse all the tables as it is heavy for processor
is it possible to run a sql query that can fetch my desired value from dataset, if not possible in dataset what control should i use from which i can fetrch data using sql query
Waiting for your help
Regards
Arus
|
|
|
|
|
On a dataTable you can set a rowFilter something like - ds.Tables[0].DefaultView.RowFilter = "name like 'a%'" So maybe check out those properties as well as the DefaultViewManager property of a DataSet - I think that one might be the one to use.
|
|
|
|
|
You can not run SQL queries directly on any ADO.NET data container (DataTable, DataView, DataSet). Your currently only able to set filters (i.e., the where clause of the SQL statement) or sorts (i.e., the order by clause of the SQL statement). If filtering and sorting is all you need, your good to go, although I must warn you, they can be quite slow. The DataSet is going to do all the work you would have done to find the records you needed, and its going to go through more code than you would write yourself most probably.
If you have 5000 rows in your datatable, and you sort them with ADO.NET, its going to be noticably slower than if you sorted them on a database server with a SQL query. The DataSet object also has a significant amount of overhead to provide all the capabilities it offers, so sorting with a DataSet may even be noticably slower than if you sorted manually.
For your purposes, you might be best off writing your own code to find the data you need, or else dump the data into a true database somewhere and actually run that SQL query.
|
|
|
|
|
I need to be able to rotate an image kinda like a parking break found inside of a car. It needs to rotate on its far left axis and move from 0 to say 45 degrees. Any help would be much appreciated. Thanks in advance.
P
|
|
|
|
|
|
how to pass messages between java and .net without using sockets
Mohamed Hasan is usally called as Hasan. He is very much interested in C++ programming . He slowly picking up .NET programming. He done his Bachler degree in Arumugam Pillai Seethai Ammal college Thiruppathur. and Master degree in MK university College.
Contact him at: hasansheik@hotmail.com
hasansheik@yahoo.co.in
hasansheik@lycos.com
|
|
|
|
|
string value="hasan";
Btn_save.Attributes.Add("OnClick","clientfun('"+hasan+"')");
the above methed u well pass value server to client side javascript;
----------------
client side/javascript u can access the value following methed
function clientfun(element)
{
var str=element;
alert(str)
}
|
|
|
|
|
|
As Java and .NET are two completely different development platforms, you can't use standards from one with the other. For example, .NET has Remoting, which allows you to directly access and use objects remotely, or essentially pass messages accross a disparate network to remote objects, and get responses back. Java has something similar, but for java programs only.
The only truely universal, cross language, cross platform messaging infrastructure is Web Services. You can develop a web service in Java and consume it with a C# program, and pass messages back and forth that way. Or vice-a-versa, and even if neccesary, develop web services in both so they can talk to each other. The bummer about web services is they are heavy compared to remoting, and generally require a web server on at least one end for them to work.
|
|
|
|
|
I created win application with comboBox1, axAcroPDF1, button1.
The code looks like this:
…Button1_Click()…
{
if(comboBox1.Text =="myfile1.pdf")
{
axAcroPDF1.LoadFile(@"\myfile1.pdf");
axAcroPDF1.Show();
}
else if(comboBox1.Text =="myfile2.pdf"))
{
axAcroPDF1.LoadFile(@"\myfile2.pdf");
axAcroPDF1.Show();
}
}
It displayed "myfile1.pdf" when I chose "myfile1.pdf" from comboBox1 and pressed the button but gave me the error when I tried to display "myfile2.pdf". Does anybody know how to fix this problem?
Thanks
|
|
|
|
|
The complete error message would be helpful. Other that that, you haven't supplied any information to be able to help you track down the problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I fixed. It was easy.
Thanx.
|
|
|
|
|
i need to create a custom file (serialize a structure)
that contains these information:
1 image .png
1 string
1 int value
1 int value
1 image .png
1 int value
is it easy or anyway possible to get for hacker or people the .png files or other values without use my program?
I mean open it with some notepad or other software can get these objects?
|
|
|
|
|
Well if you use binary serialization it will make it harder for them to get the values. i.e. if they open it in notepad they wont be able to distinguish anything of real meaning and it will look like a bunch of garbage but if they tried hard enough using some kind of software they could probably get the values.
|
|
|
|
|
You could encrypt the whole file as you serialize it and decrypt it again when you deserialize.
|
|
|
|
|
How to load different customize mouse cursor on different winform panel and also how to save and load them from resource file.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
Create a cursor file and compile it as an embedded resource in your exe/dll. Then call the Cursor constructor and pass in the name of the cursor file.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Hi CPers!
I got this strange thing here and I hope somebody can help me. I'm using the DataSet as a cache for my app. The DS object is accessible for multiple threads and it seems like I cannot lock the object?!! Here is the code:
public class AppCache
{
private string ConnectStr;
private DataSet DS;
public AppCache(string ConnectStr)
{
this.ConnectStr = ConnectStr;
DS = new DataSet();
}
public override DataTable GetDBTable(string TableName, string SelectStr)
{
if (DS.Tables.Contains(TableName) == true)
{
return DS.Tables[TableName];
}
//Load the table's data
lock(DS)
{
using (SqlConnection conn = new SqlConnection(ConnectStr))
{
SqlDataAdapter DA = new SqlDataAdapter(SelectStr, conn);
DA.Fill(DS, TableName );
DA.Dispose();
}
CommonUtils.WriteToSystemLog("Fill table", EventLogEntryType.Information);
return DS.Tables[TableName];
}
}
}
In some race-condition multiple threads are simultanously reading the data from the DB into the same table, resulting duplicated rows in the DataTable. I could trace it when looking into the Windows EventLog and saw multiple entries of "Fill table".
Please advice!
Sangra
|
|
|
|
|
It's possible that GetDBTable is entered while another thread is reading the table.
You have to put the "lock(DS) {" statement in front of the "if (...Contains)" line.
|
|
|
|
|
Hi,
Thanks it would solve my problem. However, it will always lock the DS object even during readings and what I wanted is to lock the object only during writing. After some search, I came up with a solution, you may take a look at it. I would appreciate your opinion.
if (DS.Tables.Contains(TableName) == true)
{
return DS.Tables[TableName];
}
//Load the table's data
if (Monitor.TryEnter(DS))
{
try
{
using (SqlConnection conn = new SqlConnection(ConnectStr))
{
SqlDataAdapter DA = new SqlDataAdapter(SelectStr, conn);
DA.Fill(DS, TableName );
DA.Dispose();
}
CommonUtils.WriteToSystemLog("Filled table", EventLogEntryType.Information);
}
finally
{
Monitor.Exit(DS);
}
}
else
{
//Another thread is filling the DataSet ->wait
while (DS.Tables.Contains(TableName) == false)
{
}
CommonUtils.WriteToSystemLog("Waited on the table for filling", EventLogEntryType.Information);
}
return DS.Tables[TableName];
BR Sangra
|
|
|
|
|
I don't know if the Tables-Collection is thread-safe, but you can do a double-check also like this:
public override DataTable GetDBTable(string TableName, string SelectStr)
{
if (DS.Tables.Contains(TableName))
return DS.Tables[TableName];
lock(DS) {
if (DS.Tables.Contains(TableName))
return DS.Tables[TableName];
using (SqlConnection conn = new SqlConnection(ConnectStr)) {
....
}}}
|
|
|
|