Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > c# > february 2008

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

Keeping settings across versions?
Posted by Sin Jeong-hun at 2/29/2008 9:14:41 PM
I used the settings class that VS.NET automatically generates to save some app settings, simply because it is the easiest way. But the problem is, even though the settings class wasn't changed (no fileds are modified) each time I change my app's version slightly (like 0.1.0 to 0.1.1) all the set...more >>


how to remove closing tag of a node of xml file in asp.net and c#
Posted by tosudesh2005@gmail.com at 2/29/2008 9:01:44 PM
hi all I write code like this to remove perticular node. but it left closing tag in xml file. but i want remove this closing tag also. ------------------------------------------------------------ string filename = Server.MapPath("DutyStatus.xml").ToString(); XmlNodeList objnodelst; XmlDocume...more >>

Static vs. instance method: Which one performs better?
Posted by gnewsgroup at 2/29/2008 7:35:19 PM
I am not sure if this question makes sense. But I have been wondering if there is a performance difference between a static method and an instance method. I created something like this, just to give it a test. namespace ConsoleApplication1 { class Program { static void M...more >>

Weird XSLT messages
Posted by Vijai Kalyan at 2/29/2008 7:25:52 PM
I keep getting these weird error messages FailPT0.002Smantis.exe -uFailPT0.002SFailPT0.002SFailPT0.001SExpected data.Some unexpected data.1093This is a sample debug messagePassPT0.001SSkippedPT0.000SBrokenPT0.000SNotImplementedPT0.000S when trying to apply a XSLT on a XML document using the ...more >>

How to convert a Dictionary<int, double> to an array?
Posted by amir at 2/29/2008 6:48:01 PM
I am trying to convert a Dictionary into an array so that I can compare values and compare keys individually. I am looking for a solution like array[array] i.e array of array. ...more >>

Creating a TCP/IP Connection
Posted by BillB at 2/29/2008 3:56:30 PM
Hi, I'm new to C# and was wondering how I can create a TCP/IP connection. I would like to be able to create a connection to a web server on a specific port fire of some commands to it and then once I'm finished close the connection again. I'm looking for something similar to how HyperTerm...more >>

language (sopken) translation
Posted by colin at 2/29/2008 3:48:19 PM
Hi, I need to translate some text messages wich are in a file wich is in windows .ini format, eg:- [Info] Title=haunted church [Message1] NewMessage=do not enter from czech to english, there are quite a few translation websites wich do online translations, but only 1 ive found wich c...more >>

Wierd C# DateTime Parse Error..please help
Posted by avnrao at 2/29/2008 3:01:01 PM
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a DateTime field using DateTime.Parse( datefield ).Add( TimeSpan.Parse( timefield ). For some reas...more >>



Unwanted duplicated columns in DataView
Posted by claucometa at 2/29/2008 2:57:56 PM
I placed a DataGridView in the form and configured it to have 3 columns A, B and C (all in design mode). After that, I did through code a DataTable also with 3 columns, A, B, and C. When I assign the source (dataTable) to the dataGridView instance, my dataGridView instance has its columns d...more >>

default access modifier
Posted by Tony at 2/29/2008 2:30:58 PM
Hello! I want to check with you if the following default accessmodifier is correct. * Class outer level = Internal * Class that are nested = private * field = private * method = private * delegate = internal Is this correct? Is it any more that I have forgotten? //Tony ...more >>

Fast byte array compare for ordering purposes
Posted by Christopher Van Kirk at 2/29/2008 1:04:18 PM
Hi all, I have a need to order a collection of byte arrays and I'm looking for a smart way to improve the performance. One optimization that I am aware of for comparing byte arrays for equality purposes is to convert the array of bytes into an array of integers and compare each integer one at...more >>

Last row in foreach loop
Posted by tshad at 2/29/2008 1:02:25 PM
Is there a way to know if you are looking at the last record record of foreach loop other then setting up a loop counter that you manually increment? foreach (Racecar racecar in RaceCarCollection) { ... if last row do something? } You can tell how many items you have in the c...more >>

ComboBox Setting both DataSource and SelectedIndex
Posted by samueltilden@gmail.com at 2/29/2008 12:34:02 PM
This problem should be simple. I am using Visual Studio 2003, Version 1.1 I am writing a desktop application in which I am binding a DataTable to the DataSource of a ComboBox. // I have 50 rows (concerning states) in dataTable.Rows; ComboBox myComboBox = new ComboBox(); myComboBox....more >>

oledb and dbase III files
Posted by Analizer1 at 2/29/2008 12:16:32 PM
hello, ive looked for decent OleDb Groups but have not found any.... Is there a Way to configure oledb jet.4.0 to read long filenames dbase III, dbase IV , etc I changed the Registry key to 01 to accept long file names , that did not work in my class im Renaming the File to a short name ,...more >>

Auto-completion of interfaces in VS.NET 2005
Posted by Fredo at 2/29/2008 11:58:55 AM
In VS.NET 2003, if I have a class and have it implement an interface, when I type the interface name, it gives me the option to press tab and it will create a #region encapsulated area with all the interface methods, properties, etc. This doesn't appear to work for me in VS.NET 2005. The on...more >>

Re: How do I add/delete row into/from a DataGridView
Posted by Tony at 2/29/2008 11:50:52 AM
Hello! I do some Test now on the DataGridView so we know how to add new rows and remove rows from the DataGridView. Now I have added a event handler for the button named button1_Click se below. This works but it's not the way that we want to add new rows. We want to add new rows just by wri...more >>

How do I add/delete row into/from a DataGridView
Posted by Tony at 2/29/2008 11:15:31 AM
Hello! I have created a class named Person defined below. I have made this class a DataSource by clicking and selecting (Data->Add New Data Source) from the Data option in the meny. So now in the area named Data Source on my screen I can see Person with its field Age, Name and Person_number...more >>

Lazy load of properties in DLinq
Posted by Andrus at 2/29/2008 10:23:48 AM
I tried query like var list=Db.Customers.ToList(); and noticed that all properties are retrieved immediately. Only few properties are actually used in each unit of work. Also properties contain large amout of data (images, attachments, text documentes). Retireving all properties over ...more >>

generic class
Posted by Tony at 2/29/2008 8:47:44 AM
Hello! I just come to think about one thing and that is the statement below. public class Tree<T> where T : IComparable<T> This is a correct statement and it works as expected. But now to my question when you use generic classes like this will you always use the construction with where T :...more >>

Missing sqlceme35.dll
Posted by zacks@construction-imaging.com at 2/29/2008 8:29:37 AM
I am trying to write an application that pulls data out of a SQL Server CE database file, an SDF file. It works just fin on my computer (running XP Pro). But when a co-worker tries to run it on his XP Pro computer, he gets an error that it is unable to load a DLL, namely sqlceme35.dll. I am w...more >>

Singleton - One Per Thread
Posted by jehugaleahsa@gmail.com at 2/29/2008 7:55:04 AM
Hello: Is there an easy way for to create a Singleton so that for each thread a new instance is created? Threads share memory, so I'm not sure how to go about this one . . . Thanks, Travis...more >>

.net language
Posted by davi at 2/29/2008 7:54:20 AM
http://programming-languages-tutorials.blogspot.com...more >>

Problem with VS2008 Target Framework
Posted by zacks@construction-imaging.com at 2/29/2008 7:44:22 AM
I am working on an application in VS2008. I have set the target framework to 2.0. I distributed the app to a coworker in MSI format. When he tried to install it, he was told that he needed to install the 3.5 framework. I am wondering, when I created the project, I didn't even notice the dropdown...more >>

Recursive Call
Posted by slg at 2/29/2008 6:36:58 AM
Gurus, I have a Winform which has a button. When the button click function creates a thread. I want the thread to call the button click again . I can have only one instance of the thread running at a time. I want to automate testing of my function. Any thoughts. TIA private void bt...more >>

calling base constructor
Posted by ryanbreakspear@norubbishgmail.com at 2/29/2008 5:56:11 AM
Hi, Is it possible to call a different base constructor (or just different parameters) in the body of a constructor in C#? Something like: public class test { public test(bool value) { if (value) base("True Value") else base("False Value") } } Sorry if...more >>

Michael Howard's Spot the security bug problem.
Posted by Mugunth at 2/29/2008 5:29:23 AM
Do anyone know the answer to this problem? Int16 req; .... while (true) { getRequest(); req++; arr[req] = DateTime.Now; } Can you spot this code flaw? From this link... http://msdn2.microsoft.com/en-us/library/ms972827.aspx - Mugunth...more >>

When inheriting from System.Web.UI.Page or UserControl, do I have to call their contructors?
Posted by DotNetNewbie at 2/29/2008 4:46:58 AM
Hi, When inheriting from System.Web.UI.Page (or any other class for that matter), do I have to call the inherited classes constructors? I've seen allot of code where people do: protected override void OnInit(EventArgs e) { base.OnInit(e); } Is this necessary if we do...more >>

Inheritance from MembershipUser class
Posted by Ned White at 2/29/2008 3:28:38 AM
Hi All, i can create new instance of MembershipUser class like that; MembershipUser userA = Membership.GetUser("someusername"); But how can i build a class which is inherited from System.Web.Security.MembershipUser class. as follows ; public class B2B_User : MembershipUser { publi...more >>

passing objects through multiple layers
Posted by Frank Munsberg at 2/29/2008 1:20:29 AM
Hey, I guess you all agree that layering software is a good idea but I'm at a point where I'm not entirely sure which route to go (read: stay wtf free). Imagine something like a three layered application with a database, business logic and ui layer for simplicity. Now if I got the principl...more >>

Implement Interface IEnumerator and IEnumerable
Posted by Tony Johansson at 2/28/2008 9:47:46 PM
Hello!! Based on the book I read and on my previous question and answers from you it seems to me that it's really very rare that I have to implement IEnumerable(one method) and IEnumerator(three methods) because these are already implemented I think in every collection class in .Net so I c...more >>

newbie question: WPF Data Binding - when to use "dynamic resource"
Posted by indtaz at 2/28/2008 9:02:47 PM
I am new to WPF and DataBinding. I am trying to create a listbox that will display a list of images in a stackpanel. The images themselves are retried from a table defined in SQL Server. ( Database used is the AdventureWorks database) I am currently able to retrieve the images from the databa...more >>

using ArrayList with object
Posted by Tony Johansson at 2/28/2008 7:00:02 PM
Hello! The question is about this assignment statement Person pp = arrList[0]; I know that to correct the error I have to write Person pp = (Person)arrList[0]; But my question is the following. This statement give compile error. I have always thought that the compiler doesn't see these k...more >>

adding a tag to a jpeg image file
Posted by Mark Harris at 2/28/2008 3:57:24 PM
I have the following code: try { fi = new FileInfo(fn); //fn is a string from a windows form, identifying the jpg in the file system fullPath = fi.DirectoryName + "\\" + fi.Name; Image bm = Image.FromFile(fullPath, true); //creat...more >>

Count of References of an object
Posted by parez at 2/28/2008 3:36:20 PM
Hi, I am trying to implement a pooling system Is there any way i can get a count of references of an object. I am thinking of basing it on this. http://aspalliance.com/1131_Understanding_Object_Pooling_in_Microsoft_NET.6 Please help and TIA...more >>

(Please Select), Smith, Bob Jones, Sue .. how remove comma after (Please Select) in LINQ?
Posted by Ronald S. Cook at 2/28/2008 3:35:04 PM
Hey guys, The below code works fine, BUT appends a comma to my (Please Select). Anybody know how I can get around this? Thanks... and sorry is in VB.NET (I wish I was in C# on this project)... but you guys are WAY more helpful than the VB forum. Dim _Query As IEnumerable(Of Employee) = ...more >>

About interface Enumerable and IEnumerator
Posted by Tony at 2/28/2008 3:25:47 PM
Hello! Interface IEnumerable consist of method GetEnumerator() which will return an object of type IEnumerator. Now to my question will every object that GetEnumerator return implement Current, MoveNext and Reset. I mean in this case I don't have to implement these three methods because th...more >>

Custom Page class sets all querystring values as properties, but what about UserControls?
Posted by DotNetNewbie at 2/28/2008 3:13:52 PM
Hi, I have many querystring values that I pass around in my web application, so I created a Custom Page class that simply inherits from System.Web.UI.Page. I then check for all the querystrings in the URL and initialize them, and these are all public properties so I can reference them from ...more >>

Add color to WPF grid from code behind
Posted by DNB at 2/28/2008 2:51:07 PM
I would like to add this color #E7EBF7 to my WPF data grid I know that I can add light blue color using following: Grid b = new Grid(); b.Background = System.Windows.Media.Brushes.LightBlue; but how to add specific color (i.e. #E7EBF7 ) Thanks DNB ...more >>

Problem with the Invoke Method
Posted by Dom at 2/28/2008 2:41:19 PM
I'm getting a "Parameter Count mismatch error" with the following. At the class level: delegate void lvwCallback (object[] Args); Within a method of the same class: SQLDataReader r = ... int TopCount = 100; lvwCallback Job = new lvwCallback(ShowC...more >>

Reference To An Instantiating Obect
Posted by Microsoft Newsserver at 2/28/2008 2:32:20 PM
I am instantiating an object in an ASP.NET page. From this object I want to be able to access Session. I dont want to change the constructor to pass the page reference to it, and I dont want to have to add extra properties. How can I get a reference to the page object in which the object is ...more >>

App config not seen when running from a logical drive on Vista??
Posted by José_Joye at 2/28/2008 2:11:47 PM
I'm currently facing a problem when runnning an application on Vista from a logical drive (created with "subst"). The problem occurs when the application is run from command prompt. All is ok if the application is run from the debugger. Say I have an application that is located under C:\te...more >>

Loading Data Into Grid Lasts Too Much
Posted by Diego Armando Maradona at 2/28/2008 2:02:13 PM
Hello, I have a DEVEXPRESS grid on my form When I try to load data into the form, If row count is huge (this example : 45000 row is returned, column count =~ 10) This line waits for a long time to load data into grid grdMats.DataMember = "MATS"; // THIS LINE WAITS FOR 1 MINUTE...more >>

struggling to save a tiff as a PNG and keep filesize down
Posted by sklett at 2/28/2008 1:08:46 PM
I have a Tiff (fax) with the following properties: width: 1728 height: 1090 x resolution: 204 y resolution: 98 bit depth: 1 If I open this tiff in Photoshop and change the resolution to 96 and resize to 816 x 1056, then save as png the size is 3.1Kb (great!) If I resize the tiff with gd...more >>

Module & Class detection
Posted by HarryBurtonCSharpDetection at 2/28/2008 12:57:02 PM
Hi I'm looking for a tool to retrive informtion in which class/module a running C# program executes code. Just to avoid setting huge amount of break points :) ...more >>

How do I force a repaint from a custom control?
Posted by Tom P. at 2/28/2008 12:43:36 PM
I am making a custom control (a ProgressBar) and was wondering how do I force the control to paint like the base ProgressBar does? As it is my control doesn't paint until the main execution loop let's it, usually with Application.DoEvents. But even if I do an Application.DoEvents() in my OnPaint...more >>

C# website or tutorial book that has step by step projects to learn?
Posted by Kristen at 2/28/2008 11:34:24 AM
Can anyone recommend a website or book that offers small projects to do to help you learn the .Net basics and C#? I've been programming for 7+ years but its all been VB6. I'd like to move to .NET but dont know where to start. I learn better when I can follow along with a sample project or someth...more >>

MethodInfo.Invoke and TargetInvocationException
Posted by Lasse_Vågsæther_Karlsen at 2/28/2008 10:52:42 AM
We have a base class that relies heavily on MethodInfo.Invoke. Often, as such things happen, exceptions are thrown in the method that was invoked, and this pops up as a TargetInvocationException, at the place of the Invoke command. I have tried wrapping my call to Invoke like this: try ...more >>

How set ComboBox to auto-complete?
Posted by Ronald S. Cook at 2/28/2008 10:50:38 AM
In my Windows forms app, I want my ComboBoxes to let the user begin to type values and it start to populate (if a match is found). But, I don't want the user to enter a value that is not in the list. What properties do I need to set to what to make this happen, please? I think it the invo...more >>

Problems using HttpContext.Current.Request.Url.Host
Posted by Brett R. Wesoloski at 2/28/2008 9:51:15 AM
I am having problems using HttpContext.Current.Request.Url.Host. I have some code that does this... if (HttpContext.Current != null) { subdomain = HttpContext.Current.Request.Url.Host; } Now if I put a break point on the if statemen...more >>

Lifetime of static variable across postbacks
Posted by Deckarep at 2/28/2008 9:37:52 AM
Hey all, this question is somewhat related to ASP.NET but I think it's very relevant to how the dynamics of the C# language work so I'm asking it in this forum: In my webcontrol class that inherits from System.Web.UI.UserControl. I have a private static variable declared. And on my OnLoad I ...more >>


DevelopmentNow Blog