|
Replace all occurences of [][(uint)dnsQuestions.Count] with [(uint)dnsQuestions.Count][].
|
|
|
|
|
Bo,
I can see two mistakes:
(1) referring to '7.5.10.2 Array creation expressions' in the C# online reference you cannot instantiate the sub-arrays, because the initial value of the first array is null. But in any case this would be an array of new byte [count] []. You try to create a subarray, where no array is created and initiated: new byte [][count] <- this can never work, because the compiler doesn't know how many sub-arrays (i.e. memory) must be initiated.
(2) don't cast to uint, use System.Convert.ToUInt32.
Hope this makes your year
Wolfgang
|
|
|
|
|
So how do I instantiate this?
<br />
<br />
byte[][] bs1 = new byte[(uint)dnsQuestions.Count][];<br />
<br />
for (int j1 = 0; j1 < dnsQuestions.Count; j1++)<br />
{<br />
bs1[j1] = ((DnsQuestion)dnsQuestions[j1]).ToByteArray();<br />
i1 += (int)bs1[j1].Length;<br />
}<br />
<br />
Then how do I instatiate the other part of the array?
<br />
<br />
byte[][] bs1 = new byte[dnsQuestions.Count][dnsQuestions.Count];<br />
<br />
for (int j1 = 0; j1 < dnsQuestions.Count; j1++)<br />
{<br />
bs1[j1] = ((DnsQuestion)dnsQuestions[j1]).ToByteArray();<br />
i1 += (int)bs1[j1].Length;<br />
}<br />
<br />
Like this and IntelliSense says this is wrong.
Thank You
Bo Hunter
|
|
|
|
|
If anyone is willing to take a look at this
project I would be greatfull.
It is Dns query class library with a test app
as well. It runs but I get the Server Faliure
message.
Thanks Again
Bo Hunter
|
|
|
|
|
Hi,
Can anyone tell me how to change column name and column width for a DataGrid (Windows.Forms) that is not bound to a DataSet (i.e. not using DataGrid.TableStyles?)
Thanks in Advance,
[EDIT]
Actually, I just figured out how to edit the names by accessing my DataTable, and figured out how to create a TableStyle dynamically:
DataGridTableStyle myGridTableStyle = new DataGridTableStyle();
However, Help, says you must first create a new DataGridColumnStyle per the table. This:
DataGridColumnStyle myGridColumnStyle = new DataGridColumnStyle();
isn't available, though. Compiler error:
Cannot create an instance of the abstract class or interface 'System.Windows.Forms.DataGridColumnStyle'
So, anyone know how to get around this? I know I have to use DataGridColumnStyle's to change the width of the column, but if I can't create a DataGridColumnStyle I'm at a loss...(And like I said in the original post: no, I can't use the GUI to accomplish this because I'm not using a DataSource via DataSet, etc.)
[/EDIT]
-Idealius
|
|
|
|
|
The DataGridColumnStyle class has over 10 abstract methods, thus cannot be instantiated. The compiler lists the methods that need implementation.
Either you provide (default) implementation, or you may just as well use one of the two ready-to-use derived classes. In MSDN, click on the DataGridColumnStyle item in the TOC, you'll see the class hierarchy, which lists : DataGridBoolColumn and DataGridTextBoxColumn.
|
|
|
|
|
Hi everybody!
I've written a database application ... the database file is a mdb file and the provider is Jet 4.0 OleDB Provider ... the app was fully functional on my pc but when I moved it on another machine that only had .NET Framework it didn't work! A message Box appears with this error:
------------------------------------------
Common language runtime debugging services
Application has generated an exception that couldn't be handled
Process id = 0x.... (-1...), Thread id = 0x.... (-1....)
Click ok to terminate the application
Click cancel to debug the application
--------------------------------
When I fully install the visual studio .net the app works perfectly again! It seems it lacks something when there's only framework installed!
What should I do???
Best regards!
|
|
|
|
|
Make sure to provide the MDAC redistribuable[^] as well.
If you use a particular .NET driver, you might also have to redistribute the corresponding assemblies. If you are using .NET 1.0, more info here[^] (ODBC .NET data provider). Those drivers are now part of the .NET 1.1 run-time (but it's still in beta).
|
|
|
|
|
Of course, this has happened to you...
You had a control, like a MediaPlayer, on your form.
You had it full-sized into a panel, which was not docked
-but anchored in a properly useful way, say 'Top-Left'.
Andi The form loads with the MediaPlayer. Each has its own
size fetched (from last time) from the registry.
So far so good.
The problem start when you resize the form.
You figured that: when the form has loaded the user will
resize the form to his convenience, and load a movie.
That is the user's sole function.
...And...
(The MediaPlayer, ...'Full'y docked into its panel...
will be well-sized with the resized form.)
*Wrong!* (Herein the Jeopardy buzz..)
The MediaPlayer, being docked 'full' into the panel,
is supposed to stretch along the panel as the form is
resized by the user. This seems normal.
Actually, when the user resize the form, the panel is
resized but the MediaPlayer it contains is not resized
along. The MediaPlayer keeps it loaded size even though
its container(the panel) and the form have been resized.
And my question is: 'Why?' -and how can I fix it!!!
Thanks,
Antoine
'Use obstacles as stepping stone' Orison Sweet Marden
|
|
|
|
|
It works for me. I have Windows Media player 6.4 (W2K) :
- create a new windows form app
- insert a panel
- change panel anchor settings to add right and bottom anchors
- insert the media player right inside the panel
- change media player dock settings to "Fill"
|
|
|
|
|
Is it possible to hide a TabPage ? I've tried setting the visible property to false and using the Hide () method but neither seems to hide the page. Is this even possible?
Thanks
|
|
|
|
|
In .NET 1.0, setting the TabPage visible property to false does not change things much. The easiest way to do so is (even if that's a bit lousy) to remove the tabPage item from the TabPages collection.
|
|
|
|
|
.S.Rod. wrote:
The easiest way to do so is (even if that's a bit lousy) to remove the tabPage item from the TabPages collection
If I do this will it destroy the page? I need to be able to add the page back after it's removed and the page isn't created dynamically it's been created in the designer. So if I hide the page this way will I be able to get it back during the life of the application or is it gone until a restart of the program?
Thanks again!
|
|
|
|
|
monrobot13 wrote:
If I do this will it destroy the page?
Not if you first save it off to member variable of the form, so that you can then just re-add the page to the collection.
m_Tp = tabControl1.TabPages[i];<br />
<br />
tabControl1.TabPages.Remove(m_Tp);<br />
<br />
<br />
tabControl.TabPages.Add(m_Tp);
You might have to see how to change the order of the tabs back to the way you had them though. I don't know off hand how to do it.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I think this will work nicely.
Thanks again all.
- monrobot13
|
|
|
|
|
Most of my tables has GUIDs as PrimaryKeys. So when I create new row in any table, i need to generate new guid and use it as ID. Is there simplier method?
thanks
h.
|
|
|
|
|
I have two controls on a form - checkBox1 and textBox1.
When user "checks" checkBox1, textBox1 becomes visible. Looks pretty simple )
1. without databinding:
textBox1.visible=checkBox1.checked
This works great.
2. let's play with some data in dataset:
I have bound "Checked" property of checkBox1 to a field in DataSet/DataTable. This field is also bounded to textBox1.visible property.
Result:
checkBox1 needs to lost focus to update data in dataTable, so user needs to "check" and next click into some other control.
What should i do to make it working properly (immediately)?
thanks
h.
btw: I have also tryed to force focus changes on the form (this.select(...)). The checkBox needed 2 mouse clicks to synchronize its state with dataset and since then, everything was fine )
|
|
|
|
|
This has popped up several times this week. It is rather annoying (not u, the problem )
You will need to do something like this depending on your databinding:
control.DataBindings[0].BindingManagerBase.EndCurrentEdit();
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
You're right two times in one answer:
1. This problem is REALLY annoying. )
2. This method works well - I have tested 3 different binding modes. There is just one small thing - it needs two more clicks on checkbox to "synchronize". Should I open the row for editing? I have tried to use BeginEdit() method on current row, but there was no difference. I think, that may be a point, but have no idea how to solve it.
Thanks for help
h.
|
|
|
|
|
how to do the following using .NET
I have the following XML document :
3.14159
If I were using COM MSXML parser, I could get
NodeTypedValue property to get "strongly-typed"
value.
b= XMLDocument.SelectSingleNode("//b");
variant value = b.NodeTypedValue;
//now the variant contains double value.
The question is:
how to achieve the same using C# ?
Value property of XMLNode object returns String
type, wchich i have to convert to get desired type...
How to do this without explicit conversion (by the means
of XMLConvert class or similar...)
Thanks
Michal Januszczyk
|
|
|
|
|
May be that's me but I believe that even with MSXML you are supposed to have a separate schema (with attributes of the form dt:type="int") to define node data types.
May be for usability reasons MS indeed allowed to put dt:type attributes along with Xml elements, but that of course didn't apply to define attribute data types since an attribute can hardly be data typed by another attribute.
It's not lost with the .NET Xml parser, just made different. The Xml schema has its own namespace and has the equivalent API you referred to, scattered in this namespace. For instance, System.Xml.Schema.XmlSchemaDatatype.ParseValue() .
PS : the .NET Xml parser is not a wrapper of the MSXML parser, which is a very good design decision. (at least something that stands for itself in this .NET run-time).
|
|
|
|
|
.S.Rod. wrote:
...(at least something that stands for itself in this .NET run-time).
Why Stephane, I haven't noticed your using that "smiley" before.
If I didn't know better, I'd say you are among those of us who have been wrestling with the insanity of the software industry for so long...
"Few are those who see with their own eyes and feel with their own hearts." - A. Einstein
|
|
|
|
|
A last funny pic before tonight's hunting,
|
|
|
|
|
I have to an applicatin that in part of it,it shows .zip files.In windows xp when I right click on zip files,I can choose EXTRACT ALL... option and unzip files.I want when I double click on zip files in my program it extract files,So I think I shoul use Procees.Start() and ProcessStartInfo .By default it only open .zip file with windows explorer so I have to set ProcessStartInfo.Verb property,but I don't know the action.I pass EXTRACT or EXTRACT ALL,and somethings like that but it always thrown exception.Does anybody know how can I find the these Verbs name or any idea about this problem?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I am afraid you are facing a shell extension handler. Exposed functions are called by Windows Explorer on the basis of registered components (see HKCR\.zip and HKCR\Directory\ShellEx for entry points), and use COM plumbering, not the command line.
|
|
|
|