|
i have a combobox whose contents are being populated from a datasource. When the datasource is changed, the contents are not being updated. It still displays the old contents. The refresh function also does not work. Why is this happening?
Waiting for some help.
|
|
|
|
|
Hey guys!! doesn't anyone have a solution for my problem. I'm getting headaches!!!!!!!!!!!
|
|
|
|
|
Hi
I using XmlValidatingReader to validate xml against xml schema.
My xml is looking like this:
<some_name>
... some integer and string data
<xmlData>
... random xml data, like : <a>asdsds</a><b>dsds</b>
</xmlData>
</some_name>
I have no problem with integer and string data, but I don't know to which type to set xmlData element.
xmlData can contain random xml which structure unknown.
Any suggestions?
|
|
|
|
|
Hi,
OK - I've searched CP and Google (in that order...) and found next to nothing, so now I turn to the lounge for help. If this should be in the C# or .net framework forum, please say so and I will move it. The specific error at hand might suggest so, but I believe that the general question is, well, .. more general ?
Scenario:
My software (.Net 2.0 app) running on a client win2000 pc.
Problem:
After some time I get the mentioned error dialog from the framework. I think it is some sort of a failfast ? Anyway, I can't figure out from where the error originates and press the "What data does this error report contain?" link and get a new dialog box with this:
Error signature -------------------------------------------------------
EventType: clr20r3 P1: program.exe P2:1.83.2270.18759
P3: 441e74ff P4: system.windows.forms P5: 2.0.0.0 P6: 4333aefa
P7: 16b3 P8: 159 P9: system.componentmodel.win32
Reporting details -------------------------------------------------------
Bla bla bla...
"View the contents of the error report" link
"Read our Data Collection Policy" link [Close]
Pressing the "contents" link gives me yet another dialog box with this interesting information
Exception Information
Code: 0xe0434f4d Flags: 0x00000001
Record: 0x0000000000000000 Address: 0x000000007c59bc3f
General questions:
Since this is a debug compilation of the program, I would have expected the more informational "old" framework 1.1 error message with the call stack etc, that could tell me where things died. I don't know how to decipher the "error signature" above, as I can't find any official specification of WHAT the parameters P1 -> P9 actually contains. All that google gives from Microsoft is a load of "what has been fixed in <insert_ms_app_here>". Grr....
1)
What does the parameters mean ? Is there a specification somewhere ?
2)
Why don't I get the "old" 1.1 style error dialog with the stack trace. Can I do something to get that ?
Sigh... I moved to 2.0 to get better tracing and so, but it might turn out to be a bit less helpfull when something stops working. Any comments and links will be most welcome !
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
-- modified at 5:48 Wednesday 22nd March, 2006
|
|
|
|
|
|
Dear all,
I am doing a project which is loading the data from a DataSet into an in memory object Excel worksheet, then setting up the PrintTitleRows for the Excel worksheet, finally redirecting the in memory Excel worksheet to the client side.
When I run it, the error message is "System.Runtime.InteropServices.COMException (0x800A03EC): Unable to set the PrintTitleRows property of the PageSetup class at System.RuntimeType."
The following is my code, anyone can help me with it is highly appreciated.
Dim excelCol As New excelColumn
Public Structure excelColumn
Public data() As String
End Structure
Dim dt As New DataSet 'DataSet is filled in another fuction
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim iRow As Integer
Dim iCol As Integer
Dim myTable As DataTable
Dim filename As String
excelCol.data = New String(4) {}
excelCol.data(1) = "A"
excelCol.data(2) = "B"
excelCol.data(3) = "C"
Dim qxl As New Excel.Application
Dim qxlwb As Excel.Workbook
Dim qxlws, qxlwstemp As Excel.Worksheet
qxlwb = qxl.Workbooks.Add()
qxl.Visible = True
qxlws = DirectCast(qxlwb.Worksheets.Add, Excel.Worksheet)
qxlws.Name = "All Columns"
Try
For iRow = 0 To dt.Tables(0).Rows.Count - 1
For iCol = 0 To dt.Tables(0).Columns.Count - 1
If (iRow = 0) Then
qxlws.Range((excelCol.data(iCol + 1)) & CStr(iRow + 1)).Value = dt.Tables(0).Columns(iCol).ColumnName
End If
If (Not ((dt.Tables(0).Rows(iRow).Item(iCol)) Is DBNull.Value)) Then
qxlws.Range((excelCol.data(iCol + 1)) & CStr(iRow + 2)).Value = DirectCast(CStr(dt.Tables(0).Rows(iRow).Item(iCol)), String)
End If
If ((dt.Tables(0).Rows(iRow).Item(iCol)) Is DBNull.Value) Then
qxlws.Range((excelCol.data(iCol + 1)) & CStr(iRow + 2)).Value = ""
End If
Next iCol
Next iRow
qxlws.PageSetup.PrintTitleRows = "$1:$2"
'Me.Label1.Text = qxlws.Range((excelCol.data(2)) & CStr(9)).Value
Response.ContentType = "application/vnd.ms-excel"
Response.Write(qxlwb)
qxlws = Nothing
qxlwb = Nothing
qxl = Nothing
Catch ex As Exception
Me.Label1.Text = ex.ToString
Finally
If Not (qxlws Is Nothing) Then
ReleaseComObject(qxlws)
qxlws = Nothing
End If
If Not (qxlwb Is Nothing) Then
ReleaseComObject(qxlwb)
qxlwb = Nothing
End If
If Not (qxl Is Nothing) Then
ReleaseComObject(qxl)
qxl = Nothing
End If
System.GC.Collect()
End Try
End Sub
Jwu
|
|
|
|
|
HI,
I have a big problem. I don't know how make a GSM DATA CONNECTION with my PocketPC. I try to use TAPI. I succeed to make voicecall with MakeCall method, but i need to make datacall and connection GSM. I see a eVC program that me permit to make datacall, but i don't know how implement it in .NET2003. Who help me?
Thank's
Giuseppe Peschiera
g.peschiera@tiscali.it
Eng. Giuseppe Peschiera
|
|
|
|
|
I've started to use /clr in my old MFC app using VS 2005
How do I distribute my application in an easy way? It only works on computers having visual studio 2005.
I have run Dependency Walker an error is shown:
Error: The Side-by-Side configuration information in "MyApp.exe"contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001)
I got the following error when I try to launch my app:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
All I want is to make my application run on another computer before lunchtime...
I have the .NET Framework 2.0 (dotnetfx.exe) installed on my other cpu.
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi guys...
As you can probably tell from my question i am new to programming c# & the .net framework.
My question is to ask if it is possible to create an application that will play music when a caller is put on hold?(using a smart device).
Any help is greatly appriciated.
Regards.
|
|
|
|
|
That would depend heavily on your phones ability to even do this, regardless of the code used. You might want to find out before wasting a bunch of time trying to code something that will never work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
unable to find any info so far...my phone is an spv m2000 (MS Mobile 2003).
|
|
|
|
|
Dear All
Kindly help me to insert a page break while printing using .net print document. I am printing using System.Drawing.Printing.PrintPageEventArgs.Graphics object.
Aman Tur
modified 9-Jul-22 21:01pm.
|
|
|
|
|
You do not explicitely insert a page break. Just set the HasMorePages property of the PrintPageEventArgs to true and another PrintPage event will fire after the current one is finished.
|
|
|
|
|
Thanks Roberts i found the solution few minutes later in some other code project article.
Regards
Aman Tur
modified 9-Jul-22 21:01pm.
|
|
|
|
|
Hi,
I'm trying to create a Tool Palette with some basic tools for AutoCad 2006 with .Net 2003, form which the user can drag and drop the tool directly from the Tool Pallete, can any one help me in this regard, thank U in advance.
Prakash.C
|
|
|
|
|
I was wanted to share some performance observations after fiddling around with arrays and IList<type> . Since e.g. a double[] a array automatically implements IList<double> in .NET 2.0 I can conveniently accept IList<double> as argument for any method without also needing an overload for double[] . However, after some quick testing it seems a performance penalty is involved using the IList interface! I used this small program to compare the options:
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace TestListVsArray {<br />
class Program {<br />
static void Main(string[] args) {<br />
double[] a = new double[10000];<br />
<br />
for (int i = 0; i < 3; i++) {<br />
TestA(a);<br />
TestB(a);<br />
TestC(a);<br />
TestD(a);<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
private static void TestA(IList<double> a) {<br />
DateTime start = DateTime.Now;<br />
double x = 0d;<br />
for (int j = 0; j < 1000; j++) {<br />
for (int i = 0; i < a.Count; i++) {<br />
x += a[i];<br />
}<br />
}<br />
Console.WriteLine("{0}, {1}", DateTime.Now - start, x);<br />
}<br />
<br />
private static void TestB(IList<double> a) {<br />
DateTime start = DateTime.Now;<br />
double x = 0d;<br />
int n = a.Count;<br />
for (int j = 0; j < 1000; j++) {<br />
for (int i = 0; i < n; i++) {<br />
x += a[i];<br />
}<br />
}<br />
Console.WriteLine("{0}, {1}", DateTime.Now - start, x);<br />
}<br />
<br />
private static void TestC(double[] a) {<br />
DateTime start = DateTime.Now;<br />
double x = 0d;<br />
for (int j = 0; j < 1000; j++) {<br />
for (int i = 0; i < a.Length; i++) {<br />
x += a[i];<br />
}<br />
}<br />
Console.WriteLine("{0}, {1}", DateTime.Now - start, x);<br />
}<br />
<br />
private static void TestD(double[] a) {<br />
DateTime start = DateTime.Now;<br />
double x = 0d;<br />
int n = a.Length;<br />
for (int j = 0; j < 1000; j++) {<br />
for (int i = 0; i < n; i++) {<br />
x += a[i];<br />
}<br />
}<br />
Console.WriteLine("{0}, {1}", DateTime.Now - start, x);<br />
}<br />
}<br />
}<br />
Output on my machine was (tests are repeated to rule out exceptional starting behaviour):
<br />
00:00:01.1015840, 0<br />
00:00:00.6008640, 0<br />
00:00:00.0801152, 0<br />
00:00:00.0801152, 0<br />
<br />
00:00:01.0915696, 0<br />
00:00:00.6008640, 0<br />
00:00:00.0801152, 0<br />
00:00:00.0801152, 0<br />
<br />
00:00:01.0815552, 0<br />
00:00:00.6108784, 0<br />
00:00:00.0801152, 0<br />
00:00:00.0801152, 0<br />
Concluding: iterating of the array interface is quite some faster than iterating over the IList interface of the same array object. Unfortunately using a.Count in the for loop also does cost some. I hoped the compiler/runtime was smart enough such that it would not cost anything.
Let's add those overloads again now.
Wout
|
|
|
|
|
Of course there will be a performance penalty for using a collection over an array. Even though with generics you can easily implement strongy typed collections (avoiding casting and boxing unboxing), the collections in fact use arrays. They provide you with more flexibility than an array (like you don't need to know the number of elements and they can grow as needed) but basically what it does is array operations.
There are some ways you can improve performance, if you know the number of items you can setup the MaximumLenght property of your collection.
Also, both with arrays and collections, whenever you try to access a member, the CLR will perform a bound check.
but if you access it in a for loop, where you expressely use the .Count, or .Lenght property, the compiler is smart enough to detect that and won't do bound checks with a considerable performance gain (in long running loops).
for example
suppose you have an array a and you want to iteract.
you can do it like this:
int limit = a.Lenght;
for (int i = 0; i < limit; i++)
{
}
this will do a bound check for each iteraction.
if you do
for (int i=0; i < a.Lenght; i++)
{
}
this boundcheck will not be performed.
|
|
|
|
|
The point is that I'm using a typesafe array in any case, not one of the collection flavors. I was just testing out which interface to the typesafe array was quickest. I would have hoped the difference between normal array access and access through IList<double> was minimal, but apparantly it isn't.
Also there seems no performance difference in practise between doing (see measurement results above):
int limit = a.Lenght;
for (int i = 0; i < limit; i++)<br />
{<br />
}
and
for (int i=0; i < a.Lenght; i++)<br />
{<br />
}
Maybe the compiler is smart enough here to optimize the limit variable away...
Wout
|
|
|
|
|
wout de zeeuw wrote: Maybe the compiler is smart enough here to optimize the limit variable away...
I'm not 100% sure but can't a.Length change inside the loop?
So therefore the compiler can't optimize it unless it analyses the whole loop, and I'm guessing that the problems that could occur if it did would outweight the speed advantage.
Ed
|
|
|
|
|
It can indeed (just tested )! So beats me why the two options are equally fast.
Wout
|
|
|
|
|
Because they're both accessing the same type of variable. The a.Length one is simply a property wrapper around an int so in effect they're doing the same thing and hopefully JIT will optimize away the property call if it's just a wrapper, but I'm not so sure
Ed
|
|
|
|
|
I am developing a program that will be used to present song lyrics and texts using a projector, much like Powerpoint can, but my program is specialized and not general like PP.
I have a basic prototype/testing bed ready, and am now starting to code the real program, and in the preparation I will have to decide wich features I will implement.
The program will be written i C# using Windows.Forms and GDI+ and will be released under the GPL license.
What I would like to know is this: I know that it is possible to embed an instance of the Media Player in a Form, but is it possible to use this as a background and then draw shapes and text over it, maybee using a transparent panel? Has anyone done this already?
I thought it was simplier to ask that to start trying it out, even if that is what I will do if I don't get an answer. My guess is that the biggest problem would be flickering from the transparent layer having to be redrawn constantly over the video, wich could maybe be taken care of with double buffering.
Yours Sincerely
/Rickard Haake
Bachelor of Science in Software development, but functioning as a
Youth Minister in the Mission Covenant Church of Sweden
-- modified at 5:05 Monday 20th March, 2006
|
|
|
|
|
Xaake wrote: but is it possible to use this as a background and then draw shapes and text over it, maybee using a transparent panel?
No, it isn't. The MediaPlayer will overdraw every control placed over the top of it. You'd have to use DirectShow and write a custom filter to put the overay test and images into the video stream.
Xaake wrote: wich could maybe be taken care of with double buffering
That would be true if Media Player gave you the opportunity to redraw your controls between every frame, but MediaPlayer doesn't expose such an event. So, no, you can't do this either.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, Thanks for the answer.
Now I have to decide on either using MDX or sticking with GDI+ and skipping the video background feature
Yours Sincerely
/Rickard Haake
Bachelor of Science in Software development, but functioning as a
Youth Minister in the Mission Covenant Church of Sweden
|
|
|
|
|
Friends,
Is is possible in .NET to safely download and execute a code remotely ? (something like JINI in JAVA)? If yes, then how ?
Imtiaz
|
|
|
|