|
Thanks can you point me in the direction of creating either of these things? Never done either of them before, although the sql server job sounds like it will fit the bill. Know any links to tutorials for it?
Thanks again
|
|
|
|
|
**************************
MODIFY : SEE UPDATE BELOW.
**************************
hi
Using C# / ASP.NET I am calling a couple of C++ routines from a tried and tested DLL. I have a test binary on the server which also calls the same routines. The DLL reads from a data provider.
Using the following test plan:-
1. Read data via DLL interop call
2. Change source (via a different app)
3. Read data via DLL interop call
Using the binary harness, the results from 1 and 3 are different, reflecting the change made in 2. Using the ASP.NET, the results of 1 and 3 show the same data - ie not showing the results.
I've wrapped the output with timestamps and spooled out to a file which proves teh ASPX page is being called, and the interop DLL method is being called, but some 'magical' thing inside IIS seems to say, 'Youve just called this with the same parameters - here, have the data back you got first time', which is no good.
Cutting to the chase,
1 - am I talking b******s?
2 - if not, can I force IIS to not cache any results from interop calls. The page making the calls definately isn't cached, just the result from the interop call.
[System.Runtime.InteropServices.DllImport "d:/data/inetpub/focs/bin/MonkeyCfg.dll")]
public static extern long GetBatchJobSize(string str , ref long i);
[System.Runtime.InteropServices.DllImport("d:/data/inetpub/focs/bin/MonkeyCfg.dll")]
public static extern void GetBatchJob(string str , System.Text.StringBuilder buf);
UPDATE : Killing the w3wp.exe process which is holding the DLL open resolves the problem. So this leads to the real question - how can I ensure the DLL is unloaded after each call?
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
-- modified at 10:23 Thursday 20th July, 2006
|
|
|
|
|
I'm going to keep answering my own question as I find out more and more until a) I either get it working, or b) somebody reads this thread and puts me out of my misery...
I now know you can't unload assemblies explicitly in asp.net. But...you can create an appdomain, run the assembly in there and unload the appdomain, effectively unloading the assembly....cool....sounds just like what i need....except...
I now can't work out how to create a domain and call my interop method. If it was an exe, no problem, but can't find anything on launching a DLL in a separate domain.
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
When you load up a DLL in a separate AppDomain, you don't need to have it run like an exe, but you have to treat it like a remote. Everything has to be done by proxy. Use the CreateInstanceAndUnwrap method on the AppDomain to initialize an object of a particular type in the AppDomain and get a proxy to it. The type you create must have MarshalByRefObject marked on it. Look here[^]
Logifusion[^]
|
|
|
|
|
 Getting there I think....but I can't seem to load anything using this method. Code included below...
<br />
public class MonkeyDLL : MarshalByRefObject<br />
{<br />
public string LoadBatch(string batchName)<br />
{<br />
long i = 0;<br />
<br />
GetBatchJobSize(batchName, ref i);<br />
<br />
System.Text.StringBuilder buf1 = new System.Text.StringBuilder(((int)(i + 10)));<br />
GetBatchJob(batchName, buf1);<br />
<br />
return buf1.ToString();<br />
}<br />
<br />
[System.Runtime.InteropServices.DllImport("d:/data/inetpub/focs/bin/MonkeyCfg.dll")]<br />
public static extern long GetBatchJobSize(string str, ref long i);<br />
<br />
[System.Runtime.InteropServices.DllImport("d:/data/inetpub/focs/bin/MonkeyCfg.dll")]<br />
public static extern void GetBatchJob(string str, System.Text.StringBuilder buf);<br />
<br />
};<br />
<br />
<br />
<br />
MonkeyDLL monkey = new MonkeyDLL();<br />
AppDomain ad = AppDomain.CreateDomain("MonkeyDomain");<br />
<br />
MonkeyDLL remoteWorker = (MonkeyDLL)ad.CreateInstanceAndUnwrap(<br />
"d:/data/inetpub/focs/bin/MonkeyCfg.dll",<br />
"Worker"); <--FAILS HERE<br />
<br />
cached_batch batch = new cached_batch();<br />
batch.BatchName = job;<br />
batch.XMLContent = remoteWorker.LoadBatch(job); ;
<br />
AppDomain.Unload(ad);<br />
? - What is the second param in CreateInstanceAndUnwrap for? My DLL contains only two methods listed earlier in the thread.
Fails with
System.IO.FileLoadException: COuld not load file or assembly 'd:/data/inetpub/focs/bin/MonkeyCfg.dll' or one of its dependencies.
The given assembly name or codebase was invalid.
The DLL calls works fine through 'normal' interop, so the path is correct, the dependencies are there. I attempted to switch the assembly in CreateInstanceAndUnwrap with notepad, ir c:/winnt/system32/notepad.exe and got the same error.
Can you hammer home what mundane stupid thing I have missed please, or am I missing the whole plot?!?
Cheers
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
-- modified at 5:17 Friday 21st July, 2006
|
|
|
|
|
I am determined to get there...
I have just tried
<br />
MonkeyDLL remoteWorker = (MonkeyDLL)ad.CreateInstanceFromAndUnwrap(<br />
"d:\\data\\inetpub\\focs\\bin\\MonkeyCfg.dll",<br />
"MonkeyDLL");<br />
and now being told "the module was expected to contain an assemly manifest". The DLL in question is an 'old' unmanaged C++ DLL.
Any more ideas?
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Well, anytime you call an unmanaged DLL from managed code, you have to create an interop. For instance, when you add a reference to your project for a COM DLL, Visual Studio creates an interop DLL for you. Make your calls to that interop DLL instead.
Logifusion[^]
|
|
|
|
|
Hi all,
Can anybody help me? actually i am getting data from database and i am displaying it in DIV tag. if the data is which is in HTML i mean tags of the HTML data is not propely ended the data is not displaying properly. and the alignment goes ugly. can anybody help me how to restrict it. But dont say that correct it in database. how can i find that and solve that problem perminantly.
Thanks a crore in advance
Thanks and Regards
Venkat
|
|
|
|
|
As the database is the permanent storage, that is the only place you can permanently fix it. The only other option is to write a HTML parse that the data goes through before it gets to you presentation layer, but considering the difficulties people have parsing HTML, shown by no two browsers being identical, I don't think this is the way to go.
The key reason is you say the tags aren't ended properly - how would you know where to end them? Especially when you started getting nested divs, spans, tables etc.
Good luck!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hi ,
during this small periode of working on an aspp.net application i realized that the web.config file is rthemmost important file in all the web site
iit save configurations , giving authorisations , & authentifiying users , giving roles & so on
so because of this i'm asking if you can help me by sending me whether a document or better a video that explain how the web.config file works & what is its sections & how can we use them & when ? soome stuffs like that to get a clear idea on how that file works
you have to take in concederation that i hav'nt studied XML because of that i see the things more obscure , can you help me please ?
thank you
try to be good if you can't be the best
|
|
|
|
|
These articles will clear most of your douts regarding configuration file.
http://www.dotnetjohn.com/articles.aspx?articleid=24
http://samples.gotdotnet.com/quickstart/aspplus/doc/configformat.aspx
Best Regards,
Apurva Kaushal
|
|
|
|
|
thank you very much
try to be good if you can't be the best
|
|
|
|
|
always welcome...
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hey man do you have VS 2005 ?
can you send it to me ? i mean if you can place it in a ftp it will be great & i can download it , i really feel bad programmig with asp.net 1.1
thank you
try to be good if you can't be the best
|
|
|
|
|
unfortunately i too am working on 1.1 My current project is on that only.
Best Regards,
Apurva Kaushal
|
|
|
|
|
well , that seem great , cuz i need to work on asp.net 1.1 too , cuz here in morocco wz don't have VS 2005
can you help me a little
can you give me your e-mail please ?
thank you
try to be good if you can't be the best
|
|
|
|
|
hey maan its me again
well i want to ask you abt somethings
in the aithorization section on the web.config file i learnned that we can allow users to access our site & also allow them some roles depond on how w ant them to do in that web site
i want to ask you how to add a user & how to create a role in the web.config file & also from the web form by designing an interface that contains some textbxeses & some labels to let the user rergister his informations , his ppassword & login & ...
how can we do that ?
like an registration form do you understand ?
i hope you really did because i know that i have a stupide english
thank you
try to be good if you can't be the best
|
|
|
|
|
You could buy VS 2005, or Microsoft are currently giving a 180 day trial of 2005 professional. I don't think asknig somebody to FTP you a commercial piece of software is a good idea - certainly not on this site anyway!
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hey , thnx for the advice , but i want you know that if i could buy it i would , but unfortunatley we don't have it here in morocco & also i doon't have a credit card so how can buy that stuff ?
thank you anyway
try to be good if you can't be the best
|
|
|
|
|
Asking someone to give you commercial software isn't the answer either. It's called piracy.
You don't need a credit card. Services such as PayPal can be used to purchase items and services.
|
|
|
|
|
oh , really ? & who's going to give me that sh*t you ?
look man , i respect that guy who said that this is not a way to ask a software know why ? because he said it politely
so without insulting in this furom because i respect persons here , go away & do never answer my questions if you want ok ? it was just a suggestion , if i have it i wouldn't ask , now i ask you for the next time to use your mind before posting a teas
try to be good if you can't be the best
|
|
|
|
|
Mohammed Amine wrote: give me that sh*t
Talk about being polite.
I did give you the suggestion of using PayPal.
Mohammed Amine wrote: go away ... use your mind before posting
From your previous posts, including the one that was removed from the site because of it's extremely rude and vulgar language, it is clear that you can not abide by the edicate of this community. I believe it is you that needs to go away until you can use your mind and civility in posting questions/reponses to this forum.
|
|
|
|
|
Mohammed Amine wrote: try to be good if you can't be the best
And you are not trying to be good even.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Good day Y'all. I'm having a problem using a GridView with Edit Functionality. As can be seen below, I'm
using an SqlDataSource control to connect to a MySQL Odbc provider.
<asp:GridView ID="GridView1"
AutoGenerateColumns="false"
AutoGenerateEditButton="true"
DataSourceID="Hotel"
DataKeyNames="reservation_id" runat="server">
<Columns>
<asp:BoundField DataField="reservation_id" ReadOnly="True" HeaderText="ID" />
<asp:BoundField DataField="room_type" HeaderText="Client ID" />
<asp:BoundField DataField="room_number" HeaderText="Room Type" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="Hotel" runat="server"
ConnectionString="Dsn=Hotel"
ProviderName="System.Data.Odbc"
SelectCommand="SELECT reservation_id, room_type, room_number FROM reservations WHERE room_number IS NULL;"
UpdateCommand="UPDATE reservations SET room_type=@room_type, room_number=@room_number WHERE reservation_id=@reservation_id;">
</asp:SqlDataSource>
Problem is that when I view the web page and edit a row, after clicking on the Update Linkbutton, the
GridView as well as the MySQL monitor shows no updates. I'll appreciate any help.
Live in fragments no longer. Only connect.
-- modified at 8:17 Thursday 20th July, 2006
|
|
|
|
|
I'm not big on the grid view, but would you not need to tell the update command which field s relate to which parameters?
|
|
|
|