|
How are you caching it? Is the FoxPro code caching it? Surely there's settings or calls you can make to set up caching or even to disable it. If you're using the Page.Cache property, you should set up a CacheDepedency to invalidate it. There's also many other caching techniques for ASP.NET described in the .NET Framework SDK, as well as various articles in the ASP.NET Technical Articles[^] on MSDN.
If this doesn't quite answer your question, please be more specific about how you or your code is caching objects, and what is actually being cached.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Also, if it's caching the DLL, this should not be a problem. It's only loading and keeping the DLL in memory. The data being cached is the problem here. Either FoxPro is caching data, your DLL is caching data, or ASP.NET is caching data. If you actually change the ASP.NET web site (like recompiling or changing the Web.config file in the application's root directory), the web application is forced to restart, which will reload the DLL.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
its the web page cacheing the dll i use the dll for other programs and i don't have this cacheing proble and like you said i don't care if its cacheing the dll i care becasue its cacheing the database file
chad
|
|
|
|
|
The DLL is supposed to be cached for faster execution. Keep in mind that your web application using ASP.NET is an instance of an application with many threads that runs until 1) it changes and requires a restart, which the ASP.NET worker process does automatically, 2) you stop IIS, or 3) you shutdown/restart the server.
If your database is being cached, then either your DLL is causing the problem and should not cache data (in which case, it sounds like it's not multi-threaded and isn't expecting many requests from different threads) or you are not closing connections to your database. In either case, I'm pretty sure this is not the fault of ASP.NET. You're going to have to examine your DLL and make sure that it can handle multiple requests on different threads (I know FoxPro can, but it's been over a decade since I've worked with it so I can't help you there much) and that it doesn't cache data - at least not globally (i.e., for all threads).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok i checked the dll and it closes the connection but it seems like it's iis cacheing the dll and dbf because i worte a test.dll just to see and all it dose is when i call it it give me the first record in the database and closes the database but if i change the database outside of the web page it never pickes up those changes unless like you said i restart iis or restart my computer( i even tryed it as a webservice and it still gets cached) but when i use the dll on its own not in a webpage or webservice it works fine
thanks
chad
|
|
|
|
|
IIS or ASP.NET won't cache non-executable code unless you tell it otherwise. Keep in mind that IIS and ASP.NET (depending on how your DLL is loaded - most likely ASP.NET) will keep your DLL in memory so your DLL should not "load" the DBF. There are OLE DB providers, for instance, that create a connection with the DBF using ADO.NET (see the System.Data.OleDb classes). If all you're doing is executing queries on the DBF, then what's the extra DLL for? If that contains business rules and you don't want to redevelop the code for .NET (and there's nothing wrong with that), then make sure it establishes a connection the DBF instead of loading it into memory itself without persistence writes to the file. I guess it would help more to understand what exactly this DLL is, in what it's written, and what you need it for.
As I said though, IIS and ASP.NET would not load non-executable code into memory unless you tell it to (like I load an XML document into the cache in ASP.NET to build dynamic menus and have a cache dependency so that when the file changes the cache is invalidated and repopulated the next time the file is needed). If you're built an ISAPI library (in which case ASP.NET has nothing to do with it, but I add this for posterity), you can disable caching of extension handlers in the application configuration for a virtual application in IIS.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
this dll dose all my business rules and its very fast alot faster then if i did the same thing in csharp it access the dbf in the native visual foxpro language retrives the information it need to do my calculations updated and fields that need updating then closes the files and returns me a value
how to i force iis or asp.net to flush its cache because i know it one of them doing it when i test this from other apps. it works fine and it picks up my changes
chad
|
|
|
|
|
i have a boot disk that boots into 95 mode and brings me to the command prompt. i've made a console app in c# but when i run it it says 'cannot be run in dos mode'. what can i do to fix this?
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
For one, .NET does not work on Win95. Second, if you boot from a floppy disk on a supporting platform (like Win98), the CLR and the .NET Framework Class Library (FCL) at the very least must be loaded, and those definitely won't fit on a floppy disk. There's so many reasons why this won't work. You really need to read the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
then what would you suggest to write a w95 dos mode application?
thanks,
Rob
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
C, using old Win32 APIs from the Platform SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi,
im developing a system where it'll be running accross about four workstations, these four are all connected to a database server. my question is in C# how and where do i synchronize database operations, for example deletion, adding, modifying and searching.
also.. is there any theoratical document that shows the difference between Java n C#, i search the net but only to get one that was on syntactical differences(by Dare Obasanjo). Any other reading materials?
thx !!
CODER
|
|
|
|
|
The easiest place to synchronize the request is by using locking in the RDBMS, such as the MSDE or SQL Server (in which case use the System.Data.SqlClient classes for better support). There are many locking features and many ways to lock queries, so see the SQL Server documentation for more information.
You can search MSDN[^] (the one-stop place for most or your Windows development information) for documents that discuss the differences between Java and C#. Keep in mind, however, that C# is just one of many languages that target the CLR. While languages differ in syntax and support of some features of the CLR, they can all access assemblies (including the FCL) written in any other managed language. So the differences you're looking for are between Java (the JVM) and .NET (the CLR), not just C#.
The runtimes are completely separate, though they share common ideas like JIT'ing, garbage collection, and other facilities that OO runtimes utilize.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi I'm new to C# and I have a folder path string question. I want to only specify the folder path, not a particular file path. Which syntax is correct @"C:\Program Files"; or @"C:\Program Files\";?
Thanks
|
|
|
|
|
In most cases, they will both work, since they technically refer to the same place. If you try putting both of these into the Windows Explorer address bar, they will both bring you to the same location.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Most of the Win32 API's and the .NET Framework functions will accept either. But, there are a couple of functions, like SetVolumeLabel, that require the trailing backslash.
RageInTheMachine9532
|
|
|
|
|
I have to do sth like this.When the client visited web page,he will be asked to update our software.When he accepts update,module will be download to client computer.the downloaded module ( i don't know what is it,may be an activex object) will automatically run and find software and update it, in the client machine.So what can i do to implement these in c#.
|
|
|
|
|
Yes, you can do this using .NET. You write a smart client that is embedded using the OBJECT tag, but not quite in the same way as an ActiveX control (though if you expose your .NET control correctly, you can still script it). I used to have an article detailing this at DevHood, but that site is no longer available so I'm re-writing it for CodeProject (though it's not done yet). You can find more information about this in the .NET Framework SDK, Deploying a Runtime Application using Internet Explorer[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to print formatted text with the Win32 Api using the DrawText function and it is printing out a blank page. Does anybody know what I could be doing wrong? Thanks
|
|
|
|
|
There are many, many ways to write code incorrectly. In this sort of situation, we won't be able to do much without seeing the code that doesn't work.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Here is the code. Thanks alot
public IntPtr CreateFont(IntPtr hDC, string fontName, int size, FontStyle style)
{
LOGFONT lf = new PrinterApi.LOGFONT();
FONT_WEIGHT_FLAGS weight = FONT_WEIGHT_FLAGS.FW_DONTCARE;
if (Convert.ToBoolean(style & FontStyle.Bold)) {
weight |= FONT_WEIGHT_FLAGS.FW_BOLD;
}
if (Convert.ToBoolean(style & FontStyle.Regular)) {
weight |= FONT_WEIGHT_FLAGS.FW_REGULAR;
}
lf.lfHeight = (-1) * GetFontSize(hDC, size);
lf.lfWidth = 0;
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfWeight = weight;
lf.lfItalic = Convert.ToByte(style & FontStyle.Italic);
lf.lfUnderline = Convert.ToByte(style & FontStyle.Underline);
lf.lfStrikeout = Convert.ToByte(style & FontStyle.Strikeout);
lf.lfOutPrecision = CHARACTER_PRECISION.OUT_TT_ONLY_PRECIS;
lf.lfClipPrecision = CLIP_PRECISION.CLIP_DEFAULT_PRECIS;
lf.lfPitchAndFamily = (byte)FONT_PITCH.DEFAULT_PITCH | (byte)FONT_FAMILY.FF_DONTCARE;
lf.lfFaceName = new byte[LF_FACESIZE];
byte[] temp = Encoding.ASCII.GetBytes(fontName);
for (int i = 0; i < lf.lfFaceName.Length; i++) {
if (i >= temp.Length) {
lf.lfFaceName[i] = 0;
} else {
lf.lfFaceName[i] = temp[i];
}
}
return CreateFontIndirect(ref lf);
}
int GetFontSize(IntPtr hDC, int size)
{
return size / 72 * GetDeviceCaps(hDC, LOGPIXELSY);
}
public void Method()
{
string Text = "Some Text";
IntPtr hDC = CreateDC(null, @"Network Imagistics im3510 PCL5e", null, 0);
DOCINFO doc = new PrinterApi.DOCINFO();
doc.cbSize = Marshal.SizeOf(typeof(DOCINFO));
doc.lpszDocName = "Test Win32Printer";
doc.lpszOutput = null;
if (StartDoc(hDC, doc)) {
StartPage(hDC);
try {
RECT rectStruct = new PrinterApi.RECT();
rectStruct.Left = 0;
rectStruct.Top = 0;
rectStruct.Right = 600;
rectStruct.Bottom = 600;
IntPtr font = CreateFont(hDC, "Times New Roman", 20, 0);
IntPtr oldFont = SelectObject(hDC, font);
DrawText(hDC, Text, Text.Length, ref rectStruct, DRAWTEXT_FORMAT_FLAGS.DT_NOCLIP);
SelectObject(hDC, oldFont);
DeleteObject(font);
EndPage(hDC);
EndDoc(hDC);
} catch (Exception e) {
AbortDoc(hDC);
throw e;
} finally {
}
}
DeleteDC(hDC);
}
|
|
|
|
|
Well, I haven't done Win32 printing for a while, but here are a few pointers/questions.
* Why use Win32 printing from C#, when the .NET Framework provides an easier method?
* When using Win32 routines, you need to check return codes, and call GetLastError() -- especially when things aren't working as you expect. It is quite likely that one of the two will give you a strong hint.
* Check basic things like - Is the text color white? - Am I really putting the text where I thought I was? - Can my printer even print in the area that I'm placing the text, or is it cutting that off? - Am I getting back a valid font?
* You are simultaneously dealing with Interop issues and Win32 issues. Unless you understand them both well, the confusion is going to be much greater than if you were dealing with only on at a time.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
The reason that I am trying to use Win32 to print instead of the .Net framework is because the project I am working on is a mass printing system and the .Net framework is too slow to keep up. How do I change the text color? Thanks
|
|
|
|
|
Do you know of a good resource on printing with Win32 Api? Everything that I have found has been very vague and not as detailed as I would like. Thanks alot. I really appreciate your help.
|
|
|
|
|
I haven't personally found (or really needed) a good printing resource for Win32. However, my impression is that it is primarily generic Win32 GDI calls, with a different dpi and size. So, a reasonable way to test your code would be to separate the code that does actual drawing into a separate function, then send that function any DC handle. When trying it out, you can draw straight to the screen. Once that works, you can draw to the printer DC.
SetTextColor() is what my memory tells me about changing the text color.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|