|
Why? Whats this got to do with C#.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Have a nice day.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
No. For several reasons. First, wrong forum, and secondly, it does not work like that around here. People will help but not give some lazy slacker code just because they ask for it.
"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
|
|
|
|
|
Hi,
I have build a desktop application and a windows service in c#.net 2.0. I have made a button on main form of application which start or stop windows service. Now, it is working properly in windows XP. But when i install it on windows vista i won't be able to stop or start service. It didn't work. The other thing is that visual studio 2005 doesn't run in debug mode in windows vista. Can anybody help me. Thanx in advance.
regards,
Arslan Ilyas
|
|
|
|
|
Hey Arslan,
This is due to the way Vista handles elevation of privilages on accounts (even ones that do have permissions to do things such as start/stop services). You can verify this by running your application as an Administrator (ie. right click and "Run as administrator" with your admin account). You will also be able to run a debug session after start Visual Studio in the same manor (there are things to be aware of when doing this though).
Please reference this site for more information on these things you're experiencing http://msdn.microsoft.com/en-us/vs2005/aa964140.aspx[^]
Cheers,
-t
|
|
|
|
|
Hi Arslan,
Please make sure that you are meeting the following requirements of Windows Vista OS.
1) Run Visual Studio with elevated administrator permissions.
2) Be a member of the "Administrators" group on the local machine.
3) Right-click the Visual Studio icon and select the "Run as administrator" option from the context menu.
PS: You can create a shortcut to Visual Studio and select the option to always run with elevated administrator permissions. Using this shortcut would be the equivalent of the right-click method described above.
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
HI all,
Can someone please help me to convert this VB code to C#.
Thanks!
Private Sub DataGrid1_ItemDataBound
(ByVal sender As Object,
ByVal e As DataGridItemEventArgs)
Handles DataGrid1.ItemDataBound
Dim img As System.Web.UI.WebControls.Image
If e.Item.ItemType = ListItemType.AlternatingItem Or
e.Item.ItemType = ListItemType.Item Then
img = CType(e.Item.Cells(1).Controls(1),
System.Web.UI.WebControls.Image)
img.ImageUrl =
"webform2.aspx?id=" & e.Item.Cells(0).Text
End If
End Sub
EWIN
|
|
|
|
|
There are conversion tools on the web that are free. It's also a good exercise to learn to do this.
The big trick is, there is no C# syntax for 'handles', you need to assign the handler on page load or in the aspx.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Translation of most VB.NET->C# (and other way around) is pretty simple but with a few things that are specific to one language and not the other. One thing that you could do to learn how one thing is written in language X vs. language Y is look at the direct translation from MSIL.
You can download .NET Reflector from -> http://www.aisto.com/roeder/dotnet/[^] and load in an assembly with the above method in it (must be compilable at this point) and .NET Reflector will allow you to toggle between VB.NET and C#.
.NET Reflector merely looks at the IL and translates to the language of choice from that (in most cases you can simply recompile from it as it does a fairly good job at it).
Hope this helps a little,
Cheers,
-t
|
|
|
|
|
//TODO: INSTANT C# TODO TASK: Insert the following converted event handler wireups at the end of the 'InitializeComponent' method for forms, 'Page_Init' for web pages, or into a constructor for other classes:
DataGrid1.ItemDataBound += DataGrid1_ItemDataBound;
private void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
System.Web.UI.WebControls.Image img = null;
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
img = (System.Web.UI.WebControls.Image)(e.Item.Cells[1].Controls[1]);
img.ImageUrl = "webform2.aspx?id=" + e.Item.Cells[0].Text;
}
}
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Hello everyone,
What are the differences between [Serializable] and [Serializable()]? From IL code, I think they should be the same? So, we have two ways of syntax to write the same thing?
thanks in advance,
George
|
|
|
|
|
I am trying to work out how any of your questions help you to either study or use C#.
I doubt they differ. Look at the MSIL to be sure. If MSDN doesn't tell you how they differ, they don't differ in any meaningful way.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
From IL, they are the same. Any ideas? I have not found any MSDN mentioning this topic.
regards,
George
|
|
|
|
|
George_George wrote: What are the differences between [Serializable] and [Serializable()]?
They are same. By writing [Serializable] and [Serializable()] , you are calling Serializable attribute classes parameterless constructor. If Serializable attribute class don't had a parameterless constructor, you won't be able to write [Serializable] , you should write [Serializable(parameters)] instead.
|
|
|
|
|
Thanks N a v a n e e t h,
Question answered.
regards,
George
|
|
|
|
|
Considering the number of questions of this type you keep asking, and your lack of acceptance when you are given a good answer, why not go out and buy yourself a book on C#. Most of you questions are about subjects that, in the real world of programming, make very little difference to anyone - the amount of bloat that MS build into their systems means that the odd little tweak you can do by worrying about what MSIL is generated are really meaningless. If performance worries you, good coding practice and structure will give bigger gains that worrying about a few extra lines of MSIL.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
hy everyone!
i do have a strange problem maybe someone of you knows a solution to this or a good way to find out:
i do have a console application (parser) which reads from file, splits the input if necessary and writes the data to outputfiles. the number of outputfiles depends on the input type, meaning if the file is split into parts then there are as many outputfiles as there are parts.
the program searches a directory using a search pattern, then splits the file if necessary and performes the parsing and inserts data which match the tokens in the output template and renames the final file from tmp to the final extension.
sounds easy. on my system it works well (Vista, Visual Studio 2005).
But when I execute the program on a Win2003 Server it looks like some parts of the code are left behind.
e.g. i do have two files, the first one is split into two parts, but i do only get one output file. a second file which is parsed afterwards (the instance is still running because i first read all filenames which match the pattern) and is not split returns the one outputfile.
so somewhere the second outputfile of the first inputfile is lost, the program doesn't crash it doesn't write a failure into log (because i write a log entry when starting, when finishing and when an exception occures). the start logentry is in the logfile, but no failure nore the finish entry. but both files are moved to the success folder and not to the error folder, so it looks like it was parsed correctly. but after the move statement in the code the logmessage is insert into the logfile. so the code has to be used because the one file is there as well.
so to me it looks like as if the parser just sends some input to nirvana and not to the output or "ignores" parts of the code.
and the strange thing is, when i run the program on my vista machine, everything is ok.
well, the main problem in my case is, i can't install Visual Studio on the server because it is not mine, it's a client's machine i programmed the parser with. so my first idea would be to insert logfile entries when entering one of my functions and one when leaving to see, when the operation suddenly stopps.
did anyone of you encounter similar problems during coding console applications in circumstances like me? or does anyone of you have a hint on which could be the reason to help me solve this strange behaviour more quickly?
thanks for any advice and hints, because i nevery had behaviours like this before. all my programs i coded bevour could be used no matter which operating system or hardware was used. and as i described above, why is the operation successful on the one hand side and on the other side it is not because the output is lost somewhere?!
stephan.
|
|
|
|
|
No idea. But make sure that .net is updated?
|
|
|
|
|
Multiple combo-boxes are being populated using a single Access database.........but everytime I select any of the combo-box, the values in all other combo boxes also changes accordingly........since I want to generate a report using multiple selections of combo-box I want all combo-boxes to have different values of my choice.......how can i do that.........pls help me out.......!!!
- Thanks
|
|
|
|
|
Use multiple data sources, not just one.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Do you know where I can find a list of all compiler warnings associated with each compiler warning level?
For example, Warning Level 1 is associated with CS0657, CS0658, CS0659....
|
|
|
|
|
|
Yeah - That is the information that I am looking for.
However, I need the warnings in more of a spreadsheet format for easy reference.
The format of the information at the url requires me to click on the compiler code in order to see the compiler message. I need to see that information on the same page.
|
|
|
|
|
I have to select multiple rows from datagrid and want to drop it into tree.Below code is working fine for selecting one row and adding it into tree but how to implement multiple selected rows ??? where can I apply a loop ???I am new to C#.
Thanks
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Tree DragDrop
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private void treeView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
if (e.Data.GetDataPresent("System.Data.DataRowView", false))
{
Point pt = ((TreeView)sender).PointToClient(new Point(e.X, e.Y));
TreeNode DestinationNode = ((TreeView)sender).GetNodeAt(pt);
DataRowView view = (DataRowView)e.Data.GetData("System.Data.DataRowView");
DestinationNode.Nodes.Add(new TreeNode(view.Row[0].ToString()));
DestinationNode.Expand();
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Datagrid DragDrop
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void dgview1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
DataGridView.HitTestInfo info = dgview1.HitTest(e.X, e.Y);
if (info.RowIndex >= 0)
{
DataRowView view = (DataRowView)dgview1.Rows[info.RowIndex].DataBoundItem;
if (view != null)
dgview1.DoDragDrop(view, DragDropEffects.Copy);
}
}
}
|
|
|
|