|
|
Hello
Can anyone suggest an approach on how to work seamlessly with typed DataSets and TableAdapters when preparing a DAL for use with both PostGres and MS SQL servers, if there is such a way? I'm in a situation where support for both postgres and MS SQL is needed, but i don't want to give up the beauty of typed datasets.
Thanks!
-- modified at 18:23 Thursday 20th July, 2006
|
|
|
|
|
|
Hi All
I have problem regarding updating DataTable.
First let me explain, what i'm actually doing. i have datatable with several columns like rownumber, date etc. I need to sort table by latest date first.
table is having 1001 records, and i'm using following code.
after using this code i see all the rows with same data. when i debugged it, i observed somehow tempRow array data is changing, but i'm not updating tempRow array at all.
Can some one go through this code and help me where i'm doing wrong.
Here is the code i'm using.
// Reading sorted data to array
DataRow[] tempRow = resultsTable.Select("", "proc_date DESC"); resultsTable.ColumnChanged += new DataColumnChangeEventHandler(resultsTable_ColumnChanged);
int cnt = resultsTable.Rows.Count;
for (int k = 0; k < resultsTable.Rows.Count; k++)
{
dr = resultsTable.Rows[k];
dr.BeginEdit();
for (int j = 0; j < resultsTable.Columns.Count; j++)
{
if (j == 0)
{
dr[0] = cnt; // Updating Row Number column
}
else {
dr[j] = tempRow[k].ItemArray[j];
// updating other columns of resultstable, by tempRow array data
}
}
dr.EndEdit();
cnt--;
}
dv = new DataView(resultsTable);
/////////////// column Changed Event method ///////////////
void resultsTable_ColumnChanged(object sender, DataColumnChangeEventArgs e)
{
if (e.ProposedValue == null)
{
//throw new Exception("The method or operation is not implemented.");
e.Row.CancelEdit();
}//
}
MK
|
|
|
|
|
ive got a asp.net 2.0 treeview and when i click on any node, the font size of the text of the nodes gets one size larger - but after first time it does not change again any further.
any idea what the hell is going on?
i am not changing the size in C# CODE anywhere, all i did was changed node font from times to verdana in the property grid of the treeview. with times new roman this wasn't happening.
|
|
|
|
|
As I don't see how you declare the treeview control, so I don't have much to say, but IMO you might want to check the style settings (or css) of the control before and after the postback occurs.
|
|
|
|
|
Hi guys,
I need some help regarding ASP.NET. Ok i'm actually developing an asp.net page to be accessed by a pocket pc IE. In my page I actually wanna allow the user of the pocket pc to download a file from the server.
What i did was to include a command button and this in the code behind file:
<br />
Dim file As System.IO.FileInfo = New System.IO.FileInfo(URL)<br />
Response.Clear()<br />
Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name)<br />
Response.AddHeader("Content-Length", file.Length.ToString())<br />
Response.ContentType = "application/octet-stream"<br />
Response.WriteFile(file.FullName)<br />
Response.End()<br />
I managed to get pIE to download my file. However the file i downloaded, no matter what the size and file format only creates a 520 kb file with the same name and file format as the downloaded file. Is there any solution to this problem?
My second problem relates to the activex windows media player embedded object on the asp.net page. I understand that we need wmp10 mobile to allow activex support for pIE to embed wmp10 mobile on our page. I've downloaded wmp10 mobile for that purpose. But i can't seem to find any code to allow my page to embed wmp10 mobile on my asp.net page. Can anyone please help!
Jason
|
|
|
|
|
Hi..
Iam using Visual Studio 2003.I dont know how to make a beautiful Web Page using ready to use page templates or FrontPage program for that reason my Web page looks ugly as you can see from the following link:
www.engineeringprojects.net[^]
Could any one tell me how could I make it beautiful using FrontPage or ready to use templates with Visual Studio 2003?
"I am too late but i will never give up"
|
|
|
|
|
First i have to commend you on that pretty ugly page. but you've done a good Job to convince me u need help
To use a ready template, you can copy it's html very carefully and insert it into an asp.net web page(html secttion). If The web template comes with other dependencies such as css files, remember to copy those files into your applications local path so it becomes accessible.
I'll also like to give you a link to some pretty wild templates^. Hope You enjoy them.;)
Live in fragments no longer. Only connect.
|
|
|
|
|
Sorry for being too late...
Thank you very much I was seeking for this answer for a long time .But what about the Form tag? I mean should the Form tag include the template or vice versa?
I am too late but i will never give up
|
|
|
|
|
Beauty is in the eye of the beholder.
Using templates won't make your pages any more or less visually appealing. The layout, design and graphics are what you need to concentrate on.
|
|
|
|
|
Sorry for being too late...
May you tell me what is the best way to make an attractive web page layout?
I am too late but i will never give up
|
|
|
|
|
|
Sorry for being too late...
This is a greate website for learning a lot of effective design subjects thank you very much.
I am too late but i will never give up
|
|
|
|
|
http://www.templatemonster.com/[^] this site contains some pretty good samples. For a small price you can buy those and use them in your site. I usually look there to get some inspiration for the general look for a site.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Sorry for being too late...
Thank you very much for this helpful link.
I am too late but i will never give up
|
|
|
|
|
Greetings all. Just joined and this is my first post. Sorry if this is the incorrect forum
I am currently working on a project where certain actions must happen within a given date range, if this date passes then my web app needs to do things.
For instance a customer purchases an item. The item gets marked with Purchase made on DATE, the seller then has 14 days to ship. If 14 days pass then I need the application to end the transaction and return the money to the buyer like a refund.
This isn't something that I feel should be triggered by any user action, but instead should be something that is automatically run every evening at Midnight. I am still rather new to ASP.Net but I am looking for a functionality similar to that provided by CRON on Linux/Apache Servers, where I can specify code being run at a set time/date etc...
Any assistance in this would be greatly appreciated. Thanks in advance.
FCarentz
|
|
|
|
|
You could create a windows service that can run at a specified interval in the background, or you could create a sql server job for the same purpose.
|
|
|
|
|
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[^]
|
|
|
|