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# > october 2007 > threads for monday october 1

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 30 31

Store Date/Time in SQL Server 2005
Posted by shahoo at 10/1/2007 10:29:56 PM
Hi, I know this is not a good place for this post, but I have too. I need to store Hijri Date in SQL Server 2005, but because it is year 1386 in Hijri calendar, SQL Server does not let me do that. I can store it as simple text but it is not a good approach. Can anyone help me please? ...more >>

Windows Service Question
Posted by Smithers at 10/1/2007 8:21:53 PM
I'm writing a new Windows Service. During the OnStart event procedure I initialize a few things. If initialization fails, then I do not want for the service to start. What I currently have is something like this: if (All initialization tasks succeeded) { // log the fact that initializat...more >>

C# Generic with Constraint, Custom Constructor?
Posted by at 10/1/2007 8:21:38 PM
Hello. I am trying to use c# generic to define a class. class MyClass<T> where T: new(){ } In this definition, MyClass can create T objects with a default constructor. Is there any way to set the constraint such that MyClass can create T objects with some custom constructors (provided ...more >>

Can't modify members because it is a 'foreach iteration variable'
Posted by bbg at 10/1/2007 8:10:00 PM
I am getting this error when I tried to modify one field inside foreach loop. public struct myStruct { public int a; public bool b; //... } private List<myStruct> MyStruct = new List<myStruct>(); //... foreach (myStruct ms in MyStruct) { if (ms.a == 3) { ms.b = true; /...more >>

Dragging data to Excel using DoDragDrop
Posted by Bruce_Stough at 10/1/2007 7:53:28 PM
I am currently using Control.DoDragDrop to drop a text string into Excel. I use the following code DataObject dd = new DataObject(); dd.SetData(DataFormats.Text,"\\\\ws-it-bstough\\ShareFolder\\Test.wav"); DoDragDrop(dd,DragDropEffects.Copy); The code works as expected but it will always ...more >>

Get duration for MP3 file?
Posted by Gustaf at 10/1/2007 5:45:28 PM
I've been googling for this for a while now, and it appears it's not at easy as it sounds, due to MP3's variable bitrate option and other things that goes above my head. Hopefully, there's a simple solution, that doesn't include learning hardcore C and writing my own MP3 decoder. All I want ...more >>

Memory allocation and zeroing out...
Posted by Atmapuri at 10/1/2007 5:41:16 PM
Hi! It seems that every memory allocated by the garbagge collector is zeroed out (an array is set to all zeros). Is there any way to allocate memory via garabage collector without having that automatic zero out feature? In my case that zero out is adding a serious performance penalty. ...more >>

Writing Byte Array to Disk
Posted by Garth Wells at 10/1/2007 5:11:52 PM
I've got code that allows me to render the contents of a byte array to the screen, but I need to write the contents to disk. Suggestions? Thanks ...more >>



Need generic enumerator when calling string.split()
Posted by Dave at 10/1/2007 4:37:23 PM
I'm calling string.Split() producing output string[]. I need direct access to its enumerator, but would greatly prefer an enumerator strings and not object types (as my parsing is unsafe casting from object to string frequently). Basically generics and not its non- generic counterpart. stri...more >>

Writing bitmap properties?
Posted by David Veeneman at 10/1/2007 3:48:07 PM
I'm opening a JPG file to read and write its EXIF properties. I'm using very simple code to open the file: myBitmap = new Bitmap(filePath); Reading and writing the properties is working fine, but when I go to save the file, I'm getting an exception that reads "A generic error occurred...more >>

when update database, i must wait few second!
Posted by Tark Siala at 10/1/2007 3:36:17 PM
hi i'm using VS.NET 2005 +SP1 C#, and i connect access database by ADO.NET 2.0. i'm using Dataset to (insert,update,delete) and in get data i use (Datareader), but my problem when i do this: 1 - insert data (by dataset). 2- get data (by datareader). when i run this commands i can't get latest...more >>

destructor not being called
Posted by Andy Fish at 10/1/2007 3:15:12 PM
hi, i have a class called foo that has a method called ~foo (well it might not be a method but I'm not worried about the actual semantics here) from what I can tell this makes it a destructor which means it should get called when the object is disposed of by the runtime. presumably this ...more >>

Referencing your other assemblies in projects
Posted by Dave Anson at 10/1/2007 2:56:55 PM
What is the recommended practice for referencing assemblies in a project from other solutions? I am using Visual Studio 2005 Team System. I have several assemblies in another solution which will be referenced in my project. How should i reference them. e.g. 1) Should I get both soluti...more >>

Sql Connection
Posted by DaveP at 10/1/2007 2:12:01 PM
Can you have Persistent Connection (always open) in Dot.net I have multiple calls i have to make back to the server would like to keep the connection open... or is this a mute point since pooling is handling cached connections Tks DaveP ...more >>

Unable to cast MSMQ body to an object
Posted by Bill Wright at 10/1/2007 1:53:03 PM
Hi, I built an assembly with a class, NodeBuildCommand, in the namespace "Tendril". I use that assembly on one computer to send a NodeBuildCommand object in the body of a System.Messaging.Message. This works without error. On the receiving computer I use the same assembly and then try to cast...more >>

Sql and c#
Posted by DaveP at 10/1/2007 1:31:36 PM
hi all. i have a Situation where i have a offline table using dataset and (sqlAdapter) this table has many rows...i need to line a id column to another ID2 Column Back at the database i dont want to select 1 by 1 select from the database looking for examples of getting the data from the...more >>

Interface question
Posted by tshad at 10/1/2007 12:58:11 PM
I am trying to understand Interfaces and why I would use them. I have an example from a book that is explaining it. I just can't seem to see why I would use it. In my example, it has 2 interfaces: IDisplayable and IComparable (Predefined). In the Students class part, he is moving the s...more >>

How to use of a template class object?
Posted by teel at 10/1/2007 12:24:03 PM
Hi there, I finally wrote a template class for a parameter, which is listed below. I'd like to use the parameter to store int, float or enum object, and to use it with a property, thus I don't want to worry about it's type. Let's say I've got a class Screen defined as follows: public class...more >>

Best practice to work with multiple DB connections
Posted by Venkat at 10/1/2007 12:12:30 PM
Hi, We have a windows application developed in c# and SQL Server 2005. Our application need to execute more than one command (ExecuteReader and ExecuteScalar) at a single time. Till now we have we use with only one connection created during start up of application and will be displose/clo...more >>

control picturebox ScrollBar position
Posted by at 10/1/2007 12:04:28 PM
hi all, how can i control the position of vertical or horizontal scrollbals of a picture box. i load a picture in a picturebox , by default the vertical of scroll bar is at position 0 ; how can i set it in Middle state of picturebox by programming. so thnx for any help ...more >>

datetime compare
Posted by ChrisB at 10/1/2007 11:42:17 AM
Hello, I was wondering what the easiest way is to compare two DateTime objects and not have the time components be included in the comparision. For, example, if time1 = 10/01/07 9:00 am, and time2 = 10/1/07 10:00 am, time1.CompareTo(time2) == 0 should evaluate to true. Thanks, Chris ...more >>

C# Generics
Posted by uAsking at 10/1/2007 7:16:02 AM
Can anyone tell me what is wrong with this: namespace Test { public class A {} public class B : A {} public class G<T> where T : A {} public class F : G<B> {} public class Test { private G<A> a = new F(); private G<A> b ...more >>

How does timer work?
Posted by Chris at 10/1/2007 4:43:04 AM
1. What is a difference between System.Windows.Forms.Timer and System.Threading.Timer ? 2. How does it work? How is elpasing time counted? I.e interval is set to 10ms and a timer starts working - elapsing time is being counted. When it takes 10ms the tick event is raised. When the new time i...more >>

graphics help
Posted by Ringo at 10/1/2007 1:31:40 AM
I need some help. I have an app that talks to a sonar board via the serial port. In my sp_DataReceived I gather all the data and put it into arrays. Then I want to draw the data in a pictureBox. I wrote a function called Draw_sonar2 that does all the drawing. It usually works but sometimes crash...more >>

Update records using SqlDataAdapter
Posted by Matteo Migliore at 10/1/2007 12:59:33 AM
Hi. I writed a method that takes two DataTable with same schema and return a third DataTable that: - insert new rows from "compare" DataTable - delete rows contained in "source" and not in "compare" DataTable - update rows from "compare" -------------------------------------- public stati...more >>

protect my code
Posted by Alain R. at 10/1/2007 12:00:00 AM
Hi, I already asked about this topic few months ago, but i did not get any answer which satisfied me, therefore i'm asking it again. I would like to know how i can protect my code (C#.NET) from being decompiled and abuse. in C++, we write in "Win32 native" so you are not able to see any ...more >>

How to LOCK a table for INSERT and UPDATE, but not SELECT for duration of SqlTransaction?
Posted by sticky at 10/1/2007 12:00:00 AM
Hi I need to be able to lock a table against INSERT and UPDATE, but not SELECT, for the duration of a transaction. The transaction will be defined at the application level in c#, and then use stored procedures to make multiple selects and then an insert. What is the best way of doing this? ...more >>

Copy a Datacolumn from a table to another
Posted by Manuel at 10/1/2007 12:00:00 AM
Hi to all, I'm trying to copy a Datacolumn from a table to another, but with this code: destTable.Columns.Add(srcTable.Column["colname"]); I got this error: Column 'colname' already belongs to another DataTable. Anyone can help me?...more >>

Using activex control
Posted by zion at 10/1/2007 12:00:00 AM
Hello, I would like to use C# activex dll in my asp.net website. Within Visual studio enviroment it works good, but in browser I can't see the control.. the secutity level in my IE is Low and I have all permissions in website directory. Thanks ...more >>

custom format for date and decimals
Posted by roundcrisis at 10/1/2007 12:00:00 AM
Hi there; I m trying to find a way to create some sort of helper or something so all dates and numbers are displayed in a format (perhpas taken froma config file or database) for example in an XML file have date format "dd/MM/yyyy hh:mm" and decimals with 2 places How can i do this whitout c...more >>

ASPNET control dynamic event handling
Posted by Jason Huang at 10/1/2007 12:00:00 AM
Hi, In my ASPNET 2.0 web form application, I have a Table control T1 which contains some LinkButton controls. But we don't know the number of the LinkButton yet, cuz the number of the LinkButton is based on the SQL query during the run time. My question is how do we handle those Click event...more >>


DevelopmentNow Blog