Answer Questions
Fusion1224 System.Threading.Thread & ThreadPool
Hi, All! If it’s possible please answer me on one question: ThreadPool is created on application start but it doesn’t work until I call ThreadPool.QueueUserWorkItem () method. But if I don’t use ThreadPool and use System.Threading.Thread myThread = new Thread(new ThreadStart(OnStart)); myThread.Start(); then whether will be myThread belong to default ThreadPool Or it will be independent from everyone Or all of threads must belong to created ThreadPool always In http://blogs.msdn.com/yunjin/archive/2005/07/05/435726.aspx Yun point that all of assesible for user-code thread belong to ThreadPool Please let me know your meaning about this problem. Anatoly Rozhyn , Ukraine As far as ...Show All
cverdon DataReader Loop and Dataset Question
I am looking for the best way to do this very common need of getting data from one table to another. Both tables are in sql server 2000, different databases. I am opening a SQLDataReader (for performance), then need to load them into a Dataset. From the Dataset there are SQLCommandBuilder and SqlDataAdapters available to give correct INSERT/UPDATE syntax for the destination table (on a seperate instance of SQL Server 2000) I got the data in the reader, opened the needed objects to pull the data over. I dont want to loop through every row of the DataReader because the schemas are the same (between source and destination table). How can I load the DataReader into the DataSet that is connected with the SQLDataAdapter without ...Show All
Cameron D PageBreak Issue
Hi, I am trying to create an excel xml using xslt and am having an issue with adding certain xml input components after the pagebreak. As an e.g ..here is my input file : <ROWSET> <ROW> <SECURITY_NAME>AUD/USD 07/19/2006 DEUTB-L</SECURITY_NAME> <TRANSACTION_TYPE>BUY FORWARDS</TRANSACTION_TYPE> <TRADE_DATE>06/14</TRADE_DATE> <SHARES>92400</SHARES> <COST>69348.97</COST> <PROCEEDS>68063.23</PROCEEDS> <GAIN_LOSS>-1285.74</GAIN_LOSS> <GPS_TXN_ID_CODE>200606150E1P0001</GPS_TXN_ID_CODE> <REPORT_NAME>CHCLM</REPORT_NAME> <ACCOUNT_CODE>250</ACCOUNT_CODE> <ACCOUNT_NAME>STRATEGIC GLOBAL FUND: P ...Show All
Hans1982 WinFX and Interop
Hello everyone! Right i was wondering since WinFX (.Net 3) is part of the Subsystem in Windows Vista if its possible to use the Managed API framework to communicate with other running applications using User32.dll in .net 2.0 i have to use Interop to import the dll and manually managed the code. But since WinFX is a subsystem surely there is already a managed API for User32 or something I cant find anything about the new WinFX features or documentation on the new procedures, namespaces and classes. Does anyone have any links or ideas to some form of documentation or anything of interest Thanks Thanks for the article link. Why do Microsoft continue to make silly mistakes Since .net 3 isnt actually any ...Show All
dba_sql Attributes and inheritance on fields/properties/methods
Hi there! I'm trying to work out how (if at all) attributes are inherited on overriden fields properties and methods. According to this msdn page , they are inherited, but how do you retrieve these attributes Here's some code I'm testing with... I've discovered that the static method Attribute.GetCustomAttribute works as you would expect with inherited attributes, just in case anyone else is having the same problem. It would still be helpful to understand why the above doesn't work like this though. TaylorMichaelL, I could freakin kiss you. I've been grappling with this exact problem for almost a week, and your post solved it right away. Thank you! 大家好,我 投入 网 技 , 大家在以后的日子里多多指教哈哈 1)注 的 示名 ...Show All
Radith faulting module kernel32.dll, version 5.0.2195.6946
Hello! My application crashes with the following line added to the event log: Faulting application launcher.exe, version 12.4.0.0, stamp 45a778f9, faulting module kernel32.dll, version 5.0.2195.6946, stamp 40d78cce, debug 0, fault address 0x0002bbf3. The source is .NET Framework 2.0 Error. The same program runs fine on many machines, but crashes on a Windows 2000 computer with a freshly installed .NET 2.0. I saw some posts with this problem, but there was no solution :( Thank you very much for any suggestions! - Make sure that you have all fixes, updates for Win 2000 having SP4 installed in it - Try reinstalling .Net Framework 2.0 HTH, ...Show All
DavidAragornHouse compact access 2007 database
Does anyone knows how to compact an access 2007 database with .net The previous code with JRO.JetEngine is not working for 2007 format. We used that code for previouse db but not working for the latest one. I haven't tried using JRO to do this myself, but does your connection string specify the new database engine for Access 2007 (not Jet OLEDB) I believe that you have to use the Access 2007 Application object: How to: Compact and Repair a Database I also have an application that needs to CompactDatabase and run on any machine regardless of their Office version (if any). Can the files be distibuted to users (MSACC.olb and ACEDAO.dll) with my application Thank ...Show All
lawlessSaturn [OTP]How to overcome the problem associated with querystring ?
Hi .. i have developed a website. As usual im using quertystring to passs value from one page to another . EX:If im moving from page ABC.aspx to PQR.aspx with some querystring Till here everythinh works fine . my problem starts here say i reached PQR.aspx name="Sachin" it will show all the data related to name="Sachin" but if somebody in querystring changes name="Nitin" it shows data related to nitin . i Dont want user to get details of other users . rather if somebody changes tehn he shud be redirected to say Login.aspx PLs provide me some tips or C# code Looking forward for ur reply thanks Sachin Question regarding asp.net ar ...Show All
.Net General [Best Practice] Verify a value is part of an enumeration
What would be the best way for verifying, upon converting an int to an enumerated type, that the value actually exists in the enumeration Ideally, this would work with [Flags] and non-[Flags] enumerated types. A case statement would work, but is clearly undesirable, unless one does some sort of code generation. Perhaps checking int.TryParse((EnumeratedType){int value}, out dummy).ToString()) would work, but that seems awfully kludgy. I'm not particularly thrilled with using reflection to test enum values, so I think I'm back to either manually coding verification routines or using some sort of code generation. What would be really nice is an option to have the compiler turn Enum.IsDefined into the most ...Show All
ZaaM IT Ultra-fast deserialization/serialization
Hi, I'm wondering if there is a way to speed this up: I have objects that implement the following methods: public void Serialize(System.IO.BinaryWriter writer) { writer.Write(this.price); writer.Write(this.size); writer.Write(this.dateTime.Ticks); } public MyObject Deserialize(System.IO.BinaryReader reader) { return new MyObject(reader.ReadDouble(), reader.ReadInt32(), new DateTime(reader.ReadInt64())); } That's what I use for serialization & deserialization. Currently I manage to write 10,000,000 objects in 5.5 seconds, however my Raid 0 drives can write up to 140MB/s, so I think there should be some upside left (10mio objects result in 195MB file). I guess the problem is that the .Write ...Show All
V.E VB.Net Datatables and Identity Fields problem...
ok im adding a new row into a datatable , the table on the database has an identity field. When the row is added the database updates correctly and i get a new value in the identity field as expected. What doesnt seem to be happening is the new identity value isnt being reflected in the datatable. When i query the table later on in the application theres only a DBNull value where the new ID should be. Heres the code im using to update the datatable, how would i make the new identity field appear in it Theres no obvious datatable.refresh method and its a pretty large table anyway, id imagine it would be a bit wastefull to have to reload it all every time i add a new record to it. is there a way to get the new identity value set in th ...Show All
J-Chen How to handle data in different tables?
I was wondering if someone could point me to a tutorial that might help me I have an application that I'm developing that will display a tabbed form which needs to contain data from different tables. For example, my database has a contact table with typicall information and then it also has a lead table which contains information if the contact is a sales lead. They are linked together by a common contactID column. There are a few other normalized tables also like an AlternateAddress table. My first problem was that I could only get the binding source to connect to a particular table. This was a problem cause the data that I need to modify is normalized across a few different tables. My solution to that problem was to create a view ...Show All
Angry Coder problem when reading keys from app.Config
Hi, I'm experiencing problems when trying to retrieve keys from the app.config-file using C# VS2005. This is the contents of app.config < xml version="1.0" encoding="utf-8" > <configuration> <configSections> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="ConfigManagerTest.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission ="false" /> & ...Show All
MLyons10 How to code an NT Service (in C#) so it can be run from the command line as well?
HI, I'd like to create an NT service that I can also run from a command line. I am using .NET 2.0. I tried the following code, but keep getting "Invalid Handle" exception on Console.Readline... The same code used to work under .NET 1.1!! Any help is much appreciated! public static void Main( string [] args) { if (args.Length > 0 && args[0].Equals( "console" )) { MyService service = new MyService (); service.OnStart(args); Console .ReadLine(); service.OnStop(); return ; } else { ServiceBase [] ServicesToRun; ServicesToRun = new ServiceBase [] { new MyService () }; ServiceBase .Run(ServicesToRun); } } in that case i would sugg ...Show All
JonEagle how to add more than one namespace reference to root?
When I am building an XmlWriter I can use the following to create the root node. xw.WriteStartElement( "svg" , " http://www.w3.org/2000/svg " ); How can I add another namespace reference to the root node eg xmlns:xlink= h ttp://www.w3.org/1999/xlink Alternatively, is there xsl syntax that could do this via a transform Thanks, Tad See: http://windowssdk.msdn.microsoft.com/en-us/library/73z46xs1.aspx xw.WriteAttributeString("xmlns","xlink", null ," h ttp://www.w3.org/1999/xlink "); You can write out the namespace declaration as an attribute as in the following example: const string svgNS = "http://www.w3.org/2000/svg"; const s ...Show All
