|
If it's not a .NET solution, then why are you posting it here? This seems like a very odd forum to post a none .NET question.
|
|
|
|
|
This google search might help[^]. Take a look around the MSDN links
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Guys, I am trying to do the following but I get some conversion errors. can someone help me please?
Class:
public class Widget
{
public string RSP = "";
public int WidgetOrDiscount = 0;
public decimal Price = 0.0m;
}
Console apps:
static void Main(string[] args)
{
//LinkedList<System.String> myList = new LinkedList<System.String>();
LinkedList<Assignment3.Widget> myList = new LinkedList<Assignment3.Widget>();
PopulateData(ref myList);
}
private static void PopulateData(ref LinkedList<Widget> myList) {
//record 001
Widget wdg1 = new Assignment3.Widget();
wdg1.RSP = "R";
wdg1.WidgetOrDiscount=150;
wdg1.Price=1.00m;
myList.AddFirst(wdg1);
//record 002
Widget wdg2 = new Assignment3.Widget();
wdg2.RSP = "R";
wdg2.WidgetOrDiscount = 130;
wdg2.Price = 2.00m;
myList.AddAfter(wdg1, wdg2);
//record 003
Widget wdg3 = new Assignment3.Widget();
wdg3.RSP = "S";
wdg3.WidgetOrDiscount = 145;
wdg3.Price =0.00m;
myList.AddAfter(wdg2, wdg3);
//record 004
Widget wdg4 = new Assignment3.Widget();
wdg4.RSP = "R";
wdg4.WidgetOrDiscount = 50;
wdg4.Price = 2.50m;
myList.AddAfter(wdg3, wdg4);
}
Please help me.
|
|
|
|
|
AddBefore and AddAfter require list nodes as arguments. Whereas AddFirst and AddLast do not.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
can u give me an example with node? does it accepts object type or only string? please help.
|
|
|
|
|
I used addbefore and addafter. how can I loop to display the items in a console app for the linked lists? I see online saying >ForEachLoop but it does not work,
|
|
|
|
|
1st, I think it's better that you write your LinkedList like this:
LinkedList<string> ll = new LinkedList<string>();
LinkedListNode<string> lln = new LinkedListNode<string>(Console.ReadLine());
ll.AddFirst(lln);
LinkedListNode<string> Prelln = null;
while (true)
{
Prelln = lln;
string input = Console.ReadLine();
if (input == "End")
break;
lln = new LinkedListNode<string>(input);
ll.AddAfter(Prelln, lln);
}
It takes less memory. [Edit] However, It's your choice [\Edit]
2nd, a simple foreach gets you your nodes, for this example:
foreach (string i in ll)
Console.WriteLine(i);
While (true) { Human.isLearnable = true; }
modified on Tuesday, October 21, 2008 2:41 PM
|
|
|
|
|
I found some code on the net to allow drag and drop on a grid.
Code can be found at :- http://www.danielsoper.com/programming/DataGridViewDragDropRowsColumns.aspx[^]
Has any one had any experience of using this object? AS I am getting some frustraiting results!
Once I have added my DataSource and DataMember the control will not let me change the names of any of the columns. If I rename Column1 to Name, when I close the properties page it renames its self Column1
I can get round this by renameing the columns in code datagridView2.Columns[0].HeaderText = "Name";
When I run my form the control seems to append a number of blank columns to the begining of my data,
if my data returns 23 columns the grid displays 43 columns
Any help would be appreciated.
|
|
|
|
|
Graham_4 wrote: AS I am getting some frustraiting results!
You apparently did not understand that the page is showing one way to do this. It is not a reusable class. One minute of looking at the code easily finds the following:
protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
{
e.Column.SortMode = DataGridViewColumnSortMode.Programmatic;
<span style="color: Red; font-weight: bold;"> e.Column.HeaderText = "column " + e.Column.Index;</span>
base.OnColumnAdded(e);
}
This clearly indicates that the code is for example purposes, not reuse. I am afraid your plan to copy/paste software development has been upset due to you not having a clue what you are doing. Shocking, no really it is.
led mike
|
|
|
|
|
i want to select that row in true db grid on which mouse right click button is clicked but now i left click button clicked on true db grid it will select that row but with the right click it doesnot select the row.
i want to select the row of grid with both right and left click buttons of mouse
thanks & Regards
Tanvir.
dasda
|
|
|
|
|
Best bet is to try the vendor's website - or fire the left click event when the right button is clicked?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Anyone know if there's code out there for generating a paginated interface like Word, with a drawing area the size of the page selected in the printer settings?
|
|
|
|
|
I don't know if it will help in your context but I think there is a print preview control available in .NET for Windows Forms.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
In VB.net when we define DaySel as:
Dim DaySel As Date then when we use the command totaldays = DaySel.DaysInMonth(DaySel.Year, DaySel.Month)
it will response the corresponding days of the selected month (28 or 29 or 30 or 31 days)
However when I define in VC#
System.DateTime DaySel = default(System.DateTime);
- I only can get DaySel.DayOfWeek or DaySel.DayOfYear
Anyone can show me how to get the total days of the selected month?
Thank for nay help
|
|
|
|
|
//
// Summary:
// Returns the number of days in the specified month and year.
//
// Parameters:
// year:
// The year.
//
// month:
// The month (a number ranging from 1 to 12).
//
int daysInMonthCnt = System.DateTime.DaysInMonth(int year, int month);
|
|
|
|
|
The DaysInMonth is a static method, so you use the class name to call it, not a variable instance:
DateTime.DaysInMonth(DaySel.Year, DaySel.Month)
I don't know the exact reason why you can call static methods using a variable instance in VB, but it's not very logical.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I need to be able to execute a SQL request thru a thread and wait till the end of the execution of the query to get the error code of the query.
What is the best way to do so ?
I am using the System.Data.SqlClient and System.Threading libs
Thanks in advance
Regards
Pierre
|
|
|
|
|
Check out the BackgroundWorker component
|
|
|
|
|
hi
i have some qus.s i hope u answer me please
1- am working on C sharp 2003 i want when i click on a command in form1 it opens new form and this new form it contain text box >>>
what the code i wrote i command ?????????
2- what it mean by UCOMIStream???? and should i used it n C# too or just in v.b
Thanx
|
|
|
|
|
Miss_hacker wrote: what it mean by UCOMIStream
I have been using C# for 6 odd years, and never needed to even find out what that is used for. I suspect something to do with COM. Well, COM is dead!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Miss_hacker wrote: 1- am working on C sharp 2003 i want when i click on a command in form1 it opens new form and this new form it contain text box >>>
what the code i wrote i command ?????????
For starters, have a look at the documentation how to Show a window (or control) Control.Show Method [^]. There's a simple example in doc.
Miss_hacker wrote: 2- what it mean by UCOMIStream???? and should i used it n C# too or just in v.b
UCOMIStream is needed when communicating with COM objects, if you need the communication in streams between managed code and COM-object you'll neeed the interface regardless of the language, but you would be better off not using COM objects unless it's a requirement.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
You d´ont want to do that.
1) use mdi child/parent forms or
2) use usercontrol as pages, for that you will have to use delegates.
About second question i d´ont know nothing about that.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Not a technical question, rather a fairly nebulous question about a UI design.
In summary, I have an application that may or may not perform a task every minute. I need to create a visual representation of when this task will be performed over a day/week. Something like a time line where a user can view a single day/week that displays when the task will execute.
As an example, the task is configured to execute at 12,34,45,50,56 past the hour in the hours 1,4,8,15,18,20,21,22
The problem is that there are 2440 minutes in a day, so creating a visual UI is somewhat complicated. Unless of course the user has a 500 inch wide screen monitor
Just incase anybody has heard of it, I am trying to create this for Crontab jobs.
|
|
|
|
|
Why don't you 'steal' MS Outlook's calendar view... I think it's a neat way to present events over time.
|
|
|
|
|
MrEyes wrote: The problem is that there are 2440 minutes in a day
Wow, you are either cursed or lucky with an extra 1000 minutes a day
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|