using System.Linq, thats the one. Thanks Eslam!
Mark06
Posts
-
Missing extension methods in 3.5 [modified] -
Missing extension methods in 3.5 [modified]System.Collections.Generic sits in the System.Core assembly, which is referenced by default. :^)
-
Missing extension methods in 3.5 [modified]Ive got a class library project set up, and its set for 3.5 framework.(Im actually following a tutorial online). However, when I reference a IList, I get no extension method in the list, such as ToArray. Im defining an object as:
IList<int> results = new List<int>();
// populate listvar convertedtoArray = results.ToArray<int>();
But I can compiler error because ToArray doesnt exist. Even though Im using the System.Collections.Generic namespace. Any ideas? Mark
modified on Thursday, January 22, 2009 5:27 PM
-
Finding monthend dateHi, anyone know of a function already in .Net to return the monthend date of a specified date? If I have a date, 30 April 2007, and call:
myDate.AddMonth(1)
It will return 30 May 2007, but thats not the monthend. Anyone know? -
Automatic NamespacesHi, By default, when adding a folder to a C# project, it will affect the namespace of new classes contained there. EG: Add a folder called dummy. then a class below, the IDE automatically inserts "namespace classlibrary1.dummy" into the class. Is there anyway to turn this on in VB.Net?
-
Textbox not scrollingI've got a textbox that updates with some information when an event fires. The textbox multiline value is set to true. A message is appended to a new line in the textbox. But if the number of lines exceeds the size of the control, the vertical scroll bar appears, but it stays at the top position. It wont automatically scroll down to the last entry. I've been trying:
TextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.SelectionStart = TextBox1.Text.Length
orTextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.Select (TextBox1.Text.Length, 0)
But no luck. Any ideas? -
Disabled Show All Files ButtonHi, for some reason, the "Show All Files" button in my solution explorer is disabled. I started a new Website project, selected ASP.Net, filesystem, in C#. But no matter where in the solution I click, I cant click this icon, its disabled. PS: I'm actually following a webcast, and it starts by manually pasting some files into the project directory, clicking show all files, and then "including" them in the project. Any ideas?
-
Converting double slashesYup, that'll be it!! :mad:
-
Converting double slashesbut this isnt an sql problem. the problem is, c# setting a commandtext to "sp_attach_db N'c:\\temp\\logfile.txt'" when it should be "sp_attach_db N'c:\temp\logfile.txt'" the actual sql command is irrelevant. its the double slashes thats the issue.
-
Converting double slashesappologies, I was trying to keep it simple. I'm actually calling the stored proc 'sp_attach_db' and I've tried command.CommandText.Replace("\\",@"\"); but it didnt do anything to the commandtext value.
-
Converting double slashesHi, Ive got a filename that i'm passing to an stored proc, but the string is a filename:
string filename = "c:\\temp\\LogFile.Txt";
my command is built:command.CommandText = "sp_UpdateLogFile '" + filename + "'";
however, sql doesnt accept the \\ directory seperators, they should only be one \. Is there a function already available to remove these double slashes? -
Problem with SchemasHi, I have a schema which reflects a table in the database. I've just added a field to the schema table, called Watermark. I've built the library. But when I access it in my main project, the intellisense works:
reportSchema.Dataset.tblReport(recordnum).Watermark
But at runtime, I get an error: Watermark is not a member of tblReportRow I've tried removing and readding it a few times. Its like the autogen code in vs2005 hasnt updated everything. Anyone seen this before? -
Scrolling in PanelsHi, I have a control, which contains a flow panel, with textboxes being added dynamically at runtime. The flow panel docking is set to fill the control, and its flow direction is set to TopDown. I want the control to be scrollable, incase there are more textboxes added at runtime than fit the original size. So I enable Autoscroll for the FlowPanel. However, I get both updown and leftright scrollbars. I simply just want the updown scrolling. Anyone know how I can force this, or find a way around it? Any response gratefully appreciated
-
Math QuestionCheers Miszou
-
Math QuestionHey, anyone know the equivalent of VB's MOD, in C#? Cant find it :^)
-
Where can I find...Hey, I'm trying to find a dialogbox in Visual Studio 2005. Its a box that appears normally after installation. It gives you the option to setup default layout. And selection of either C# settings, or VB settings or C++ settings. Anyone know where I can find that? I'm stuck with VB layout, and I want to change it back. Mark
-
The correct way to format a numberBut how do I should I use it? I tried
Label1.text = String.Format(value, "N2")
and it didnt work. As for Europe, appologies, I meant countries like Germany represent decimals and thousand seperators differently to UK. -
The correct way to format a numberHi everyone, I was wondering, what would be the correct way of formatting a number, based on regional settings. For example:
Dim value as double = 123456.78 Label1.Text = value
The label would show:123456.78
I need it to show:123,456.78
if I'm in the UK123.456,78
if I'm in Europe I'm sure its a simple Format problem. Just cant remember. Any ideas Mark -
Ask a silly question...Being a 30 year old, I'm extremely embarrased to ask this, but if Easter celebrates the passing of Jesus, why is it a different weekend every year? Apparently Easter weekend in 2008 will be in March :confused:
-
XP Pro Security TabHey, When I right click on a folder and choose properties/Security in XP Pro, I get the basic tab pages, that just says "share this folder", and "allow network users to....." But Im sure there's another section that says about adding/removing users, and assigning different rights per user. Anyone know how can I access this? Mark