|
But after any code performance some other things also matter like :
put huge data into session like multiple tables.
And all the repeated images which I want to show on our application, may not be done cached.
|
|
|
|
|
In general.
1. Requirements - most impact
2. Architecture
3. Design
4. Implementation - least impact
For some limited domains there can be differences in the above. For example embedded device drivers could see performance impacts due to the last item.
|
|
|
|
|
Hello,
If we talk about real time we can perform various data processing in real time like data updating, data highlighting, data sorting, data filtering and data grouping which is application based. I will suggest you a custom component, which will help you to increase your application performance http://www.dapfor.com/Feature.aspx?id=performance[^]
|
|
|
|
|
i try to pass data (string) from terminal (windows mobile) to webservice
i have good connection and i got this error:
Could not find resource assembly
thanks in advance
|
|
|
|
|
You sure that is the complete exception message? It should tell you clearly about which assembly is missing. All you need to do then is figure out why and fix it.
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
|
|
|
|
|
i have 5 strings and i need to insert them to dataset.
i dont work with any database, i only need to insert 5 strings to dataset.
how i can do it ?
|
|
|
|
|
What kind of dataset? 5 strings in one row? 5 rows of one string each?
Maybe this link[^] has everything you wanted to know and more...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You need to insert 5 strings as 5 rows and 1 column or 5 columns and 1 row?
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Put them in a DataTable first?
|
|
|
|
|
Hi,
save all the five string in a single string with comma(,) separated and split that particular string
by comma(,) when insertion performed in database.
Good luck
|
|
|
|
|
There are two ways you can do this job:
1. Insert strings into a Datatable and then add it to the Dataset.
2. if you want to directly add the strings, each string individually be in a diffrent table(5 tables) or merge all the 5 strings and insert into the dataset.
Hope this answers your question.
Cheers
Amit
|
|
|
|
|
I've got three timers in front of me:
1) Forms.Timer
2) System.Timer
3) Threading.Timer
Which one's callback does not block the current thread when the timer event fired?
Best,
Jun
|
|
|
|
|
I doubt any timer in any language on any OS that supports threads would block the "current thread" when it fires.
|
|
|
|
|
Why not try reading the documentation on each of those first??
|
|
|
|
|
I read those docs. They are not clear, at least to me. I thought I knew but started doubting myself at work.
Best,
Jun
|
|
|
|
|
You could have tested this quite easily and done it in about 5 minutes.
Setup each time and setup a handler for the event/callback for each timer. In the handler, you put one line of code:
Debug.WriteLine(@"Current Thread ID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString());
Put the same line of code at the top of the app and you'd know if the thread is different by the ID numbers.
|
|
|
|
|
The System.Windows.Forms.Timer is the only one that is called on the UI thread if that's what you mean.
|
|
|
|
|
If you want your code to run in a separate thread, then use a BackgroundWorker , because it is very easy to use. I believe System.Timers.Timer and System.Threading.Timer also run their target code in a separate thread. System.Forms.Timer runs in the UI thread.
|
|
|
|
|
|
So far this appears to have stumped a lot of folks, including myself.
The function in Delphi works correctly, the function in C# is crashing with managed/unmanaged errors.
using a delphi.pas generated mrdsio.dll file, the Receive(Adr,Len) is sent on to the mrdsio.dll for processing (mrdsio.dll sends and retrieves data to an mcu epprom memory bank with Adr as Address and Len as Length)
The Tdata (single dimension byte array) is returned from the mrdsio.dll and processed as Data.
Again, Delphi code works, C# fails.
any clues?
original Delphi Code:
type<br />
TData = array [0..255] of byte;<br />
<br />
function Receive(Adr, Len: integer): TData; stdcall; external 'mrdsio.dll';<br />
<br />
procedure TForm1.Button5Click(Sender: TObject);<br />
var Data: TData;<br />
i: integer;<br />
s: string;<br />
begin<br />
if not (CheckBox1.Checked) then<br />
begin StatusBar1.SimpleText:='Bidirectional operation not allowed'; exit; end;<br />
for i:=0 to 255 do Data[i]:=0;<br />
Data:=Receive($02,8);<br />
if (Data[1]=0) then<br />
begin StatusBar1.SimpleText:='Failed, check Connection'; exit; end;<br />
s:='';<br />
for i:=1 to 8 do<br />
s:=s+Chr(Data[i+1]);<br />
Edit1.Text:=s;<br />
end;
Converted C# code;
[DllImport("mrdsio.dll", EntryPoint="Receive", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]<br />
public static extern byte[] Receive(int Adr,int Len);<br />
<br />
private void btnRX_Click(object sender, EventArgs e)<br />
{<br />
byte[] Data = new byte[256];<br />
int i;<br />
string s;<br />
int Adr = 0x02;<br />
int Len = 8;<br />
for (i = 0; i <= 255; i++) Data[i] = 0;<br />
Data = DLL.Receive(Adr, Len);<br />
s = " ";<br />
for (i = 1; i <= 8; i++)<br />
s = s + Data[i + 1].ToString();<br />
txtBox1.Text = s;<br />
}<br />
|
|
|
|
|
Aurbo7 wrote: crashing with managed/unmanaged errors.
Unless you show the exact text of these errors any suggestions will be pure guesswork.
The best things in life are not things.
|
|
|
|
|
MarshalDirectiveException was unhandled<br />
<br />
Cannot marshal 'return value' Invalid managed/unmanaged type combination.
|
|
|
|
|
Your unmanaged code returns a pointer to an array, but your managed code has not been told how to marshall the data. I'm not an expert in this interface but you need to add some more attributes to tell the marshalling code that a pointer is being passed back. You can find more information here[^].
The best things in life are not things.
|
|
|
|
|
If Richard is correct and it's returning a pointer then you may need to copy the data at the pointer to a managed byte array.
byte[] data = new byte[256];
IntPtr result = DLL.Receive(Adr, Len);
Marshal.Copy(result, data, 0, 256);
[DllImport("mrdsio.dll", EntryPoint="Receive", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
public static extern IntPtr Receive(int Adr,int Len);
|
|
|
|
|
Dave,
your version offers up a different error,
'AcessViolationException was unhandled'
Attempted to read or write protected memory.
|
|
|
|