|
Does any one of you have an example to connect to Oracle DB on Unix machine using C# service application ? Any hint or idea would be of great help....
Srinath
|
|
|
|
|
Have you used the OracleProvider?
|
|
|
|
|
Yes..
Srinath
|
|
|
|
|
Hi,
I've got a List object containing listviewitems. And i have a few items added to my listview control.
With the findIndex() method i wanna search for an index of an element in the List object and add another element as a subItem to that element.
The problem is, i don't understand the arguments FindIndex() expects.
Can somebody give me an example?
Thanks in advance!
|
|
|
|
|
MSDN topic for List.FindIndex Method[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
The MSDN information is what I would read to get the information, as well as some sample code, though I do have some trouble understaing it sometimes. From my understanding (still learning) the FindIndex takes a predicate. The predicate is basically a function that accepts a value of whatever type your list contains, does a calculation, and returns true or false.
So let's say I have a List of INTs. If I wanted to search for the first occurance of a number greater than 5, I would create a function like this:
<br />
public bool IsGreaterThan5(int i)<br />
{<br />
if(i > 5)<br />
return true;<br />
else<br />
return false;<br />
}<br />
Then, when I want to find the first instance in my INT list that is greater than 5, I do this.
<br />
int FirstOccurance = myIntList.FindIndex(IsGreaterThan5);<br />
There are also other variations of the FindIndex function that you can use:
List.FindIndex(int32, predicate) - Limits the search range from the int32 element to the end of the list
List.FindIndex(int32, int32, predicate) - Limits the search range from int32 to int32.
Hope that helps!
|
|
|
|
|
Hi guys,
I've read the msdn library for both code sample of this method and the documentation about it.
But i didn't understand it very well.
I've also searched with google for another example...
This is what i've tried:
// convertedString is an int
int indexOfNumber = this.listViewItems.FindIndex(FindIndexOfListViewItem(convertedString);
private int FindIndexOfListViewItem(int index)
{
for (int i = 0; i < this.listViewItems.Count; i++)
{
string currentItem = this.listViewItems[i].ToString();
//this.number is the item i wanna add as a subItem
if (currentItem == this.number)
{
return i;
}
}
return -1;
}
These are the errors i get:
The best overloaded method match for 'System.Collections.Generic.List<system.windows.forms.listviewitem>.FindIndex(System.Predicate<system.windows.forms.listviewitem>)' has some invalid arguments
Argument '1': cannot convert from 'int' to 'System.Predicate<system.windows.forms.listviewitem>'
What am i doing wrong?
Thanks in advance!
-- modified at 3:26 Thursday 11th January, 2007
|
|
|
|
|
Hello!
I would like to capture video from a camera, but I just can't find information about it... I found some articles, but there are no explanations there...
Maybe anybody knows where can I find information about it?
Thanks in advance!
|
|
|
|
|
DirectShow is what you need to use. There are articles on it on CP, just do a search.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
You can also search for articles that use avicap32.dll for webcam capture.
Do your best to be the best
|
|
|
|
|
|
Hi all,
I want to read ustructured pdf documents, how can i do that, any idea will help me to start this project.or any helpful links.
Many Thanks,
adnan
|
|
|
|
|
There's code for reading PDFs on sourceforge, and also commercial components you could try
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
When i run the web page, most of the time the treeview works fine but sometimes this error pops up:
Microsoft JScript runtime error: 'TV_FilePlan_Data' is undefined
and it asks, "continue or break" it won't let me continue and if i break, i can't edit the code. in the Http://localhost.../default.aspx page.
Please help.
-Melissa
|
|
|
|
|
Good People,
How do I get a form I have added to my project to show? I want it to show in response to a user's button click.
Also, how do I design a form that looks like, for example, the "Exception Assistant" dialog? It doesn't have that heavy blue border/header at the top. Is there some criteria or selection that should be checked or must I code it?
Thank you,
BP
|
|
|
|
|
BlitzPackage wrote: How do I get a form I have added to my project to show?
Create an instance of the class and call ShowDialog()
BlitzPackage wrote: I want it to show in response to a user's button click.
Then you need a click event. Double click on the button in the designer and you'll get one.
BlitzPackage wrote: It doesn't have that heavy blue border/header at the top.
Change that property in the form designer. I forget it's name, although I always change it ( the default is resizable form and I never want that ) The default also puts an item in the taskbar, I never want that, either. The default is stupid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian,
You'll never believe the error tht kept me from showing the form - I did not create an instance of the class and was trying to call show on the type - LOL!
At any rate, I'm still searching for the feature that will remove the blue border at the top.
Thanks again,
BP
|
|
|
|
|
You can remove the blue border at the top by selecting None for FormBorderStyle in the visual designer. If you don't like the way that looks, there are several other choices.
|
|
|
|
|
Thanks,
One last quick question: Can I create a customer interface using Visual Studio (C#) 2005? In other words, supposed I wanted my application to have a mac style look and feel or other different skin theme, can I use what ships with Visual Studio to do that?
Thanks again,
BP
|
|
|
|
|
Kind of. ToolStrips, MenuStrips, ContextMenuStrips all have a Renderer property, that controls the look and feel.
I recommend the free Krypton Toolkit[^], makes your forms, buttons, menus, everything look beautiful.
|
|
|
|
|
|
Result is here:
I ask I find
http://msdn2.microsoft.com/en-us/library/aa446560.aspx
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace OutputTest
{
class Program
{
public static int i;
static void Main(string[] args)
{
while (true)
{
i = Console.Read();
Console.WriteLine("Output: ", i);
}
}
}
}
|
|
|
|
|
Umm...you have no break set in your control loop. That program's gonna hang at the while and never release. Not sure why it would print 3 times. What are your command line args?
|
|
|
|
|
It should run forever: while(true)
|
|
|
|