|
|
Hi all!
I'm working on a .NET data provider, and the DateTime Constructor is killing me. The data is coming from a byte array (which is an ODBC TimeStamp structure) and I'm tearing it apart and stuffing it into a DateTime.
In my test application, it takes me 10+ seconds to return 10,000 records from the DB. If I comment out the DateTime constructor line and just return null for the DateTime, it only takes 2 seconds to return the 10,000 records.
So far, I've tried every constructor to see if there was any different performance. The only constructor that had any difference was the DateTime(long) (ie, number of ticks since 1/1/1), but how do you calculate how many ticks a given date is?.
All of the properties are read-only, so I can't create a temp DateTime and just set my values (or can I?). I'm really kind of at a loss here...
Anyone have any ideas?
Josh
Find a penny, pick it up, and all day long you'll have a back-ache...
|
|
|
|
|
You might consider running the fetch in a thread so that the user is less affected by the delay.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Thanks for the suggestion, but it really isn't an option . I found that the only constructor that is worth anything (performance-wise) is the DateTime(long ticks), but I was having a hard time converting the date from an ODBC structure to the tick value. I found a work-around by using the FromOADate(double date) static function that had similar speedy performance. I wrote some code to convert the ODBC date to an OLE Automation date, and , I'm back in business!
Josh
Find a penny, pick it up, and all day long you'll have a back-ache...
|
|
|
|
|
I am doing an windows application and i need to make the mouse click automatic,
My code:
...
if(int = 5)
{
//mouse auto click
}
How can i make the mouse click=
|
|
|
|
|
use SendMessage 
|
|
|
|
|
|
Hello,
I'm trying to parse frames from pages using the WebBrowser control and sometimes when frames or iframes are not from the same domain as the main page, I get an interframe security problem.
This problem (or feature of IE) is well known and a workaround exists for C++. My problem is that I'm not comfortable with COM object and don't known how to translate the workaround into C#.
Any help on translating this will be greatly welcome.
Here is the KB article from MSDN:
KB196340 - HOWTO: Get the WebBrowser Object Model of an HTML Frame
<br />
LPDISPATCH lpDisp = NULL;<br />
lpDisp = m_webBrowser.GetDocument();<br />
<br />
if (lpDisp)<br />
{<br />
IOleContainer* pContainer;<br />
<br />
HRESULT hr = lpDisp->QueryInterface(IID_IOleContainer,<br />
(void**)&pContainer);<br />
lpDisp->Release();<br />
<br />
if (FAILED(hr))<br />
return hr;<br />
<br />
IEnumUnknown* pEnumerator;<br />
<br />
hr = pContainer->EnumObjects(OLECONTF_EMBEDDINGS, &pEnumerator);<br />
pContainer->Release();<br />
<br />
if (FAILED(hr))<br />
return hr;<br />
<br />
IUnknown* pUnk;<br />
ULONG uFetched;<br />
<br />
for (UINT i = 0; S_OK == pEnumerator->Next(1, &pUnk, &uFetched); i++)<br />
{<br />
IWebBrowser2* pBrowser;<br />
<br />
hr = pUnk->QueryInterface(IID_IWebBrowser2, (void**)&pBrowser);<br />
pUnk->Release();<br />
<br />
if (SUCCEEDED(hr))<br />
{<br />
pBrowser->Refresh();<br />
pBrowser->Release();<br />
}<br />
}<br />
<br />
pEnumerator->Release();<br />
}<br />
Thanks,
R. LOPES
Just programmer.
|
|
|
|
|
In Winform, I would like to put a linkedlabel, by click it, it will show up IE web browser, ( Browser will totally seperate from Windform, not within a winform control), how can I do it?
|
|
|
|
|
See Process claass.
Mazy
No sig. available now.
|
|
|
|
|
this should help you :
VB:
<font color="#0000FF">using</font> System.Diagnostics;
<font color="#006400">
<font color="blue">Private</font> <font color="#0000FF">void</font> button1_Click(<font color="blue">Object</font> sender, System.EventArgs e)
{
Process processToStart =<font color="#0000FF">new</font> Process();
processToStart.StartInfo.FileName="IEXPLORE.exe";
processToStart.StartInfo.Arguments="http://google.com";
processToStart.Start();<font color="#006400">
}
hope it helps
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
use combination of Process and ProcessInfo class
and call method start ;)
|
|
|
|
|
This should do the trick. (I think I originally picked up this from MSDN or something):
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)<br />
{<br />
linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true;<br />
System.Diagnostics.Process.Start(e.Link.LinkData.ToString());<br />
}<br />
|
|
|
|
|
Is it possible to call a C# DLL(or really any other way to use C#) from a C DLL?
|
|
|
|
|
Yes, but you will have to work with COM. Look into the topic of Com Interop. You will need to tell the project to register the c# dll for com interop.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
|
|
Hope it helps.
-Nick Parker
|
|
|
|
|
If you can use Managed C++ you don't even need COM.
|
|
|
|
|
Is there any way I can create the same file dependency that has an asp.net application but this time with a class library
What I'm trying to do is call from BizTalk the class library which has to locate a file that will parse, but it would be better if there wouldn't be the need of hard coding the path to the file that this class library will parse
And this parsing process will be repeated daily, so if the file to be parsed changes its location for some reason or the class library is moved to another computer, then I just have to change the configuration file instead of compiling again
With ASP.NET you can configure this with the web.config, with windows form or console apps with app.exe.config but can't find anything for class libraries
Thanks in advance
Isaac
|
|
|
|
|
Place (and name) your config files, as the would belong to the exe-file that uses your class library. A class library doesn't have an association to a config file of its own.
Example:
if your class library is in c:\x\my_class_library.dll and it is beeing used by c:\y\some_executable.exe, then your .net will on behalf of your class library look in c:\y\some_executable.exe.config
|
|
|
|
|
I would like to have a menu shortcut for Ctrl+Alt+F1 but don't find that combination in the Shortcut enum. Is there a way to create this shortcut string by ORing values or some other method that I have not found yet.
Thanks
Neil Lamka
neil@meetingworks.com
|
|
|
|
|
How can I set the Tab-Stops in a ListBox to have all Items that are seperated with '\t' aligned. In C++/MFC (CListBox) it was with SetTabStops() but now in C#/.NET ???
I fount the Property 'UseTabStops' to enable/disable the using of the TabStops, but Nothing to set the distance between the TabStops.
Greets
Roland
|
|
|
|
|