|
haha, agreed!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
question...
why no loops? whats the point of not using the "tools" a language offers?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Thanq ...
This is the Question i faced in an interview .
Thats y am asking , is there any procedure to do it .
thats all ....
Thanq frnds ...
|
|
|
|
|
what was your reply to the question?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
By using "Console.WriteLine" is the answer for my question .
He asked me the basic question but i thought that there is any other tech to implement like that ....
Thats wat ...
ok Thanq Saayman ....
|
|
|
|
|
what about a recursive function?
|
|
|
|
|
Probably a homework assignment, that's usually what these types of questions are. e.g. Do this, but you're not allowed to use this".
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Does following work?
<br />
public static void printit(string value, int num)<br />
{<br />
if (num < 1) return;<br />
num--;<br />
Console.WriteLine(value);<br />
printit(value, num);<br />
}<br />
<br />
static void Main()<br />
{<br />
printit("Satish", 100);<br />
}<br />
<br />
|
|
|
|
|
Functional style
Well there is a condition in it so Id say it doesnt live up to the OPs requirements.
|
|
|
|
|
C#3
string res = Enumerable
.Repeat("Satish", 100)
.Aggregate((left, right) => left + Environment.NewLine + right);
Console.WriteLine(res);
Do I get a cookie?
|
|
|
|
|
Enumerable maintains an array- am I right?
|
|
|
|
|
nareshss wrote: i have a doubt lie this
You mean a question?
1.
Console.Write(new String('x',100).Replace("x","Satish\r\n"));
2.
Console.Write("ssssssssss".Replace("s","ssssssssss").Replace("s","Satish\r\n"));
3.
public string msg(int cnt) { return "Satish\r\n" + (cnt > 1 ? msg(cnt - 1) : string.Empty); }
Console.Write(msg(100));
Despite everything, the person most likely to be fooling you next is yourself.
modified on Monday, February 25, 2008 8:15 AM
|
|
|
|
|
Guffa wrote: Console.Write("ssssssssss".Replace("s","ssssssssss").Replace("s","Satish\r\n"));
Sheer genius.
Knowledge is hereditary, it will find its way up or down. - Luc Pattyn
so you answer don't be scared of failure
The only failure is never to try
Things You've Never Done - Passenger -2008
|
|
|
|
|
simply superb..
|
|
|
|
|
hi to all!
I m using raw socket class to capture network packets,parsing packet headers of TCP/IP and UDP/IP .I want to determine the packet size .
Is there any method to calculate packet size and also calculating the network traffic rate . anybody have idea to calulate packet size or network trafic rate.
thanks to all.
|
|
|
|
|
Hi friend i m stuck in one problem.
my question is like..
I have added treeview control in my form and also i hav added treenode to this treeview.
that is basically name of all table in my database..
This part i hav done.
Now i want to create a gridview which include all column name of given table name.
Now i want to perform drag and drop operation across treeview.(treenode provide that table name) --(so i want to drag treenode to another panel of my form where i will create gridview dynamically or i can say that from this drag and drop i m able to figure out which table gridview would be created.....)
i have tried all event of treeview but still not able to do this task......?
Hope you understand my problem.
Thanks lot.
Avtar
|
|
|
|
|
You say you have tried all the events on the tree view but no luck?! What have you actually tried?
This all depends on how your application is designed. I'm not really sure from your post exactly what you have tried but here is the overall steps.
1. Set AllowDrop = true for both the treeview and gridview
2. Connect to the treeview drag drop events i.e. so the user can drag an item from the treeview. (plenty of examples on this site)
3. Connect to the grids drag drop events i.e. so the user can drop items into the grid. (plenty of examples on this site)
4. On the grids DragDrop event get the item being dropped i.e. the tree view item.
5. Depending on how your application is designed, populate your grid using the data stored within the dropping node object OR get the data you need from a data set\data source and populate the grid that way. This step all depends on your design.
I cant see any real problems with implementing what you are asking, thats if i have understood what you have asked correctly.
|
|
|
|
|
Thanks lot S_Richie.
Now i m able to do this.
Thanks lot bro.
|
|
|
|
|
Hello, I am not certain that it should be behaving this way but I will explain and hopefully someboday will have some insight/help which would be great.
I will throw together a rough example below, We have a transaction contain multiple saves:
Try
{
Save1.Update(dt.Select(null, null, DataViewRowState.Added));
Save2.Update(dt.Select(null, null, DataViewRowState.Added));
Save3.Update(dt.Select(null, null, DataViewRowState.Added));
}
Catch
{
Trans.Rollback();
}
We have logic in the sprocs to ensure that no invalid data is saved, if Save1 completes the RowState is changed from added to unchanged. However if Save2 then throws an exception the try..catch rolls the transaction back however the Row in Save1 remains with a RowState of unchanged and so that row will not be persisted to the database once the invalid data is corrected and save is called again.
I would have expected the RowState to return to Added if the transaction is rolled back. Has anybody experienced this before? Is this what you would expect?
Thank you for any help or insight, it will be greatly appreciated.
|
|
|
|
|
i m having a datagridview which shows the appointment detail.....user can modify it from another form....so i want to know how can i refresh my datagridview on closing of another form so that it shows the updated record...please help me
|
|
|
|
|
i did the same thing a week or two back, you have to use a dialogResult.
follow my messages in this forum "forms issue" Here[^]
good luck!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
|
Not a problem
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
using System.Threading;
Thread myThread = new Thread(new ThreadStart(_listener.Prepare));
myThread.Start(); The Start call on myThread is quite important. Without it, the thread doesn't start, and no amount of debug code in the 'Prepare' method will get called and you look a complete arse when you ask a colleague for help. If you call Start on your thread, your thread starts and everything is really good.
It's gonna be one of those weeks.
Knowledge is hereditary, it will find its way up or down. - Luc Pattyn
so you answer don't be scared of failure
The only failure is never to try
Things You've Never Done - Passenger -2008
|
|
|
|
|
I want to load an assembly from a file, change a method body and save it to a file using reflection. I do not want lot of for loops to traverse through the entire assembly and do all things manually. I just want to change one method in one module in the assembly.
Thanks.
|
|
|
|