|
myDataView.Table refers to the original table, not the filtered data. Just use myDataView[i][k]; .
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
wowww,I didn't know it is possible,I have to test it now.
Thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Neither did I, this is the second look I've taken at the DataView class and I just noticed it had an indexer on it (so you can use the myDataView[] syntax).
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I have another question about it,I used myDataView[][] and it was ok.Now How can I return NUMBER of filterd ROW,myDataView[] is index of recordset not row.
Thanks.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
myDataView.Count;
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
ya,thats it;)
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I'm surprised that nobody noticed that source code of .NET CLI is available at http://msdn.microsoft.com...
Just to let you know, as well as to point out the quality of discussions...
|
|
|
|
|
It was posted in the lounge
The sources aren't anything too spectacular unless you wanted to see how certain parts of it worked. For the framework itself there was always ILDASM and Anakrino for seeing how that worked :-P
I do think it is a good thing they have been released though as that gives others a chance to experiment with .NET
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I downloaded the stuff out of curiousity and I was amazed how simple the build process was. I just need to download the activeperl, and thats it. All of the build process happened through a single command.
Since, I have tried all the other so called open source stuff like star office (though it was long time back) it was a real pain to set up the environment for the build (cygwin ... etc) and I was always scared of 'n' no of other things that are required to setup the build environment.
Anyway, Shared source is a great thing for the academics. Imagine people at college doing research. Now they can play around with whole lot of these stuff.
What is the Anakrino is it a decompiler of some sort .. can u give me the url.I searched in google but couldnt get any direct link.
thanks
Cheers
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
What is the Anakrino is it a decompiler of some sort .. can u give me the url.I searched in google but couldnt get any direct link.
Anakrino formerly exemplar
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
System.Diagnostics.Process object.........
I just cant handle this event.
Some code examples or documentation on this will do!
Somebody ?
Thanx!!
XxX
|
|
|
|
|
I have couple of bitmaps in the root of my project (as Embaded Resources).
When I want to reference them I'm using a code like this:
Bitmap bmp=new Bitmap(GetType(),"Bitmap1.bmp");
pictureBox1.Image=bmp;
But I would like to organize my project and move all the bitmaps to the folder "Bitmaps".
Now the first line of the code above will bomb saying that "The resource "Bitmap1.bmp cannot be found in the class SomeNameSpace.SomeClass", where SomeClass is a class where I reference the Bitmap1.bmp.
How could I instruct C# to find my bitmap?
Jerzy
|
|
|
|
|
Does "Bitmaps.Bitmap1.bmp" work? I've never used the syntax you have here before, glad to see it doesn't always have to be as long as myAssembly.GetManifestStream yadda yadda yadda; .
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
No, it doesn't. What is required here is a namespace:
This is an example from Mr. Petzold:
Icon=new Icon(typeof(ProgramWithIcon),"ProgramWithIcon.ProgramWithIcon.ico");
The first argument of the constructor refers to ProgramWithIcon class. Within that type operator, you can use the name of any class that your program defines. Or you can use the name of any structure, enumeration, interface, or delegate that you program defines.
In any code in the ProgramWithIcon class, the expression:
typeof(ProgramWithIcon)
is equivalent to:
GetType()
This equivalence means that you can use the somewhat shorter constructor:
Icon=new Icon(GetType(),"ProgramWithIcon.ProgramWithIcon.ico");
And the program still works the same.
The second argument to the Icon constructor is more or less a filename. If you named the icon MyIcon.ico, the Icon constructor would look like this:
Icon=new Icon(GetType(),"ProgramWithIcon.MyIcon.ico");
The first part of the quoted name is called a namespace, but it’s a resource namespace. Don’t confuse it with the .NET Framework namespace. By default, Visual C# .NET gives this resource namespace the same name as the project, but you can change it. It’s the field labeled Default Namespace in the Property Pages dialog box for the project. The name in that field must agree with the first part of the quoted name in the Icon constructor. You can even set Default Namespace field to nothing, in which case the second argument to the Icon constructor is just the bare filename:
Icon=new Icon(GetType(),"ProgramWithIcon.ico");
or MyIcon.ico or whatever you’ve named the file.
If you’re running the C# compiler from the command line, you use the /res switch for each resource. For example, if you use the compiler switch:
/res:ProgramWithIcon.ico
you load the icon like so:
Icon =new Icon(GeType(),”ProgramWithIcon.ico”);
Or you can give the icon an extended name following the filename and a comma:
/res:ProgramWithIcon.ico,ProgramWithIcon.ProgramWithIcon.ico
You then use the constructor:
Icon =new Icon(GeType(),”ProgramWithIcon. ProgramWithIcon.ico”);
to load the icon.
Here’s a problem you might run into if you just use the default resource namespace name that Visual C# .NET assigns to your project: Suppose you create a new project named ProgramWithIconPlus in which the ProgramWithIconPlus inherits from the ProgramWithIcon class. In the ProgramWithIconPlus project, you create a new file named ProgramWithIconPlus.cs and you also add a link to the existing ProgramWithIcon.cs file. But you decide not to create a new icon for the new program. Instead, you create a link in the ProgramWithIconPlus project to the ProgramWithIcon.ico file. The constructor in the ProgramWithIcon class continues to load the icon.
And what happens when the program tries to load the icon? It terminates with an exception. So what’s going on? The statement in the ProgramWithIcon constructor to load the icon looks like this:
Icon=new Icon(typeof(ProgramWithIcon),”ProgramWithIcon.ProgramWithIcon.ico”);
But the default resource namespace for the ProgramWithIconPlus is ProgramWithIconPlus, not ProgramWithIcon. The simple solution? Change the Default Namespace field in the ProgramWithIconPlus project to ProgramWithIcon. Or make all the Default Namespace fields blank and use the naked filename in the constructor.
Jerzy
|
|
|
|
|
Anybody got around to putting a Coding Standard together for C# code, that can be used in code reviews. I'd like put one together but I've not written a lot of C# code yet. Does everybody write their code in the style of the MS samples?
Michael
|
|
|
|
|
The style of the MS samples is what MS proposes as the standard (of course). The only change I've made that I'm aware of is I prefix private variables with _.
I stick to one public class or public struct per file, excluding structs created for P/Invoke. If an enum is only used by a class/struct I stick it in the same file at the bottom of the file. Some say I should make an enum part of the class if it is only used by that one class -- public class foo { public enum bar { ... } ... } -- but I like it being separate so if a later piece of code needs it I don't have to change all references to the typename.
Take my standards with a grain of salt though, I'm the only person reading (most of) my source :-P
James
Sonork ID: 100.11138 - Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Well, you can use the official .Net Design Guidelines as a starting-point.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnetframeworkdesignguidelines.asp
Kevin
|
|
|
|
|
I have a class derived from CollectionBase that is giving me some wierd results. Whenever I add an object to the class, the List goes through my objects and changes all of them to equal whatever value(s) the new added object has.
I'm simply using the standard List.Add() method for my Add implementation. Why would it change all other objects in the collection to equal the added object?
|
|
|
|
|
I suggest you get ColGen2 from gotdotnet.com
It's a collection generator that does all this for you.
|
|
|
|
|
I am currently trying to set up a complex configuration file which
might look like this:
<configuration>
<configSections>
<sectionGroup name="MyGroup">
<section name="MySection"
type="System.Configuration.NameValueSectionHandler />
</sectionGroup>
</configSections>
<MyGroup>
<MySection>
<component id="1" start="0" length="2" default=""/>
<component id="2" start="2" length="10" default=""/>
[...]
</MySection>
<MyGroup>
</configuration>
So, how can I read all elements of MySection ? How can I access them ?
For your information, the id's aren't always starting with 1, they may
start with 500 or something like that.
Regards,
Michael
|
|
|
|
|
hi,
i'm doing some rect-invalidate-update-paint things. it works quite well with one exception:
the painting process is flickering, because the invalid rectangle is filled with the background-color first. does someone know, where i can turn that off?
i'm relatively new to C# and that class library. i hope it's just a matter of finding the right property...
thx in advance
:wq
|
|
|
|
|
Does anyone know of a method to return a list of files that a current executable is using? I will be doing this in C# but would like to get some input from anyone. Thanks in advance.
Nick Parker
|
|
|
|
|
I use this code for printpage:
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int x = e.MarginBounds.Left+70;
int y = e.MarginBounds.Top;
try
{
for (int i=0;i<100;i++)
{
e.Graphics.DrawString( i.ToString(), new Font("Arial", 10), Brushes.Red, x, y);
y+=15;
if (y >= e.MarginBounds.Bottom)
{
e.HasMorePages = true;
return;
}
}
e.HasMorePages = false;
}
catch(Exception myE)
{
MessageBox.Show("Problem!!" + myE.ToString());
}
}
The problem is now I don't have two page from 1 to 100,my both pages in printpreview are the same and it draw second page the same as first one,not proceed it.
I hope it is clear.
Thanks
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
isn't that function called each time you print a page? and it is starting each time with i=0. so it appears correct to me, that each page looks the same.
in fact: i'm wondering why it doesn't print infinitely
when printing the second page, you should start the i-loop where the one for the first page stopped.
...but i'm new to c# and the corresponding class library...
:wq
|
|
|
|
|
Rüpel wrote:
isn't that function called each time you print a page? and it is starting each time with i=0. so it appears correct to me, that each page looks the same.
Yes,I know it and I beleive you are right,but how can I solve it,my code is just simple example,in more complecated text its not like this.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|