dalterio's Q&A profile
Visual C# How do I format a date time string input from a file?
I know how to use DataTime.Now.ToString("format string"); But I've got a date string coming into my app and I want to format that string. My input date format is yyyymmddhhmm. I have tried to use IFormatProvider but no matter what I did, I got an "Invalid Date Format" error. string myDate = textBoxMyDate . ToString ( ). Trim ( ); IFormatProvider format = new System . Globalization . CultureInfo ( "en-US" , true ); string expectedFormat = "yyyyMMddHHmmss" ; DateTime myDateTime = DateTime . ParseExact ( myDate , expectedFormat , format , System . Globalization . DateTimeStyles . AllowWhiteSpaces ); labeld . Text = myDateTime . ToString ( ); Ca ...Show All
SQL Server Problems with Timeout expired
Hi I have a SQL Server database which has a number of tables and views. Using SQL Server Management Studio Express I can open most of the views without a problem. However, some of the views cause an SQL Connection Error but not every time I open them. Error Source: Net SqlClient Data Provider Error Message: Timeout expired. The timeout period expired .... I have looked at the help given for this error but have come to the conclusion that none of the suggested causes are relevant as most views open without a problem. It would appear that I need to increase the timeout value but I can't find where I do that. It must be simple.. ...Show All
Visual Studio Express Editions about vb
do all programs created with vb express have to have netframe works to cuz with the program i created i ziped it and sent it to a a friend and it says they need net frame works inorder to run I did some looking around and found this expresshttp://msdn2.microsoft.com/en-us/library/aa480239.aspx You can use the publish tab in the project properties to setup prerequisits and include installer and framework in your setup. ...Show All
.NET Development What is the right way to instantiate/dispose a Control?
Hi, In Windows Forms application I am trying to dynamically create and dispose Controls. However, while testing it I ran into the fact that the way I do it leads to a stable GC Handle leak (one per instance). Here is the code that seems to produce a leak: for ( int idx = 0; idx < 5000; idx++) { Control tmpCtrl = new Control (); tmpCtrl.Dispose(); tmpCtrl = null ; } This results in exactly 5000 extra GC Handles (according to performance counter). What am I doing wrong Thank you, Leo. Control.Dispose() just releases the window handle. The GC handle doesn't get released until the garbage collector runs. This is perfectly normal. To verify, call GC.Collect( ...Show All
Windows Forms TableAdapter SQL
Hello everyone, I had a question with regard to the new VS 2005 TableAdapters. They allow you to build "canned" SQL Queries and remane them FillBy1 or whatever. I also see that you can pass in parameters. So you push a button to run the query. I don't want to do that. I want to pass a complete, already built, Query to the TableAdapter and have it run it. We generate a complete SQL query using a sophisticated search engine. I want to be able to get to the CommandText property and put in my own SQL, but I don't seem to be able to bring up and use that property. It is literally a showstopper for us if we can't put in our own SQL. I have exhausted documentation and spent a lot of time searching the Web and I don't see this d ...Show All
SQL Server crossjoin problem?
i need to calculated the number of participants during a specific period for a give club. the member table contains the following info: member id, club id, starting date, ending date, etc. i have created four named calculations: starting year, starting month, ending year, ending month. starting year and starting month are part of the hierarchy starting period while ending year and ending month belong to the hierarchy ending period. i defined a basic measure: count and a calculated measure: numberofparticipants. the calculated measure is defined as: sum(crossjoin([starting period].currentmember.parent.firstsibling.firstchild:[starting period].currentmember, [ending period].currentmember:[ending period].currentmember.parent.lastsibling ...Show All
Game Technologies: DirectX, XNA, XACT, etc. mesh clone and dispose bug
this is a strange one... Mesh mesh = Mesh.FromFile( "tiger.x", MeshFlags.SystemMemory, device, out materials ); Mesh newMesh = mesh.Clone( MeshFlags.Managed, mesh.VertexFormat, mesh.Device ); mesh.Dispose(); // Dispose the original newMesh.Disposed == true <--- what -- the new one is now also disposed mesh.UnmanagedComPointer and newMesh.UnmanagedComPointer are not equal what going on here ob. the original and the cloned are referenced somehow... Yes strange but if you follow the code in a tool like reflector you can see exactly where is happens. I don't expect this is an issue in XNA since its a different code base. There is no mesh.clone in XNA since D3DX is missing and meshes are handl ...Show All
.NET Development Cannot convert from 'anonymous method' to 'System.Delegate'
Hello all, The Form.Invoke method is waiting for a delegate as parameter. I wanted to use an anonymous method instead of a delegate but I receive a compilation error : Cannot convert from 'anonymous method' to 'System.Delegate' I find this quite strange as an anonymous method will be generated as a delegate in MSIL and so as class of type System.MulticastDelegate. So i think it should be able to convert it. Is it because it doesn't know the signature of the delegate it must build or for another reason If it's because of that, I was wondering if this will be solved with type inference of C# or not. Thanks, Pierre-Emmanuel Dautreppe Jarodtweiss wrote: Is it because it doesn't know the signature of the de ...Show All
Windows Search Technologies Outlook 2007 will not search
I have installed WDS 3.0 and still when I run outlook 2007, i can not search and dispay what I am looking for regardless if it is a contact or email or what ever. Example: From the phone list, Contact search I type Jon. The only thing displayed is "Outlook cannot perform your search" This goes for all searches. Craig, There is one other issue you may be experiencing. Are you finding the "Outlook cannot perform your search" message when you run very simple searches - example: Dave If so, are you able to retrieve results when you run more complex searches For example, "Windows Desktop Search" If so, you might be running into an issue with 3.0 beta. When queries return ...Show All
Game Technologies: DirectX, XNA, XACT, etc. How to create mpeg from mages
How can i create mpeg movie from a list of images.... any link to a related tutorial See http://msdn2.microsoft.com/en-gb/library/ms712636.aspx for the msdn documentation about multimedia. Basicaly, AVIStream... functions does a lot of the job for you. There are good samples using windows m ultimedia functions API on www.codeproject.com . ...Show All
Visual Studio Express Editions Saving Information
Hello, I a making a program that will be opened once a day probably and some information will be imputed. How can I save the informaition to be used at a later date. I basically need to use something that is like a variable accept that the variable will be saved and after the program is closed and opened again it can be used. thanks Average Joe Your example is: 1.) more difficult to support 2.) more likely to have errors, 3.) is slower and less efficient and 4.) requires more memory and far more machine cycles 5.) is not parsimonoius ie; it's a "Rube Goldberg" 6.) Certainly everything does not have to be standard, but there's goodness to standardize simple things. That s ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Vista install problems
XNA won't install on Vista RC 1 5736. I'll try on a daily build tomorrow in the office. Are you going to support Vista in December Yeah... I'm a dev on linxu and let me tell you, the XNA support for linux in beta 1.1 and 2.0 has been terrible. I'm dissapointed, like you say it's unsupported but I was able to copy the files over. It's true I can copy them over in Beta 2.0 as well, but they still arn't running any better. Very dissapointed. ;) Seriously people, if I was working on the XNA team I wouldn't want to do anything for you. There is a give and take that goes on in beta. On one hand the XNA team gets to hear feedback on the product and learn how to make it better. On the other hand we get t ...Show All
.NET Development Using asymmetric algorithm to protect your application
I have a web application, it is a CRM and I want to protect it checking the max number of license saved into the DB. For example if a customer have a 10 users license then into CRM cannot be registered more than 10 users. Number of max users is saved into the DB but I want to encrypt this data so an user can't modify manually it. I want to encrypt it with an asymmetric key because I want the CRM can decrypt data but only my persoanl win32 keygenerator can encrypt it (if web application cannot decrypt data is because the string saved into the DB is not valid then the login isn't permitted). The problem is that all asymmetrics algorithms have a public key to encrypt data and a private key to decrypt it. I want an algorithm that has a public ...Show All
SQL Server Restoring a database
Hullo, I am trying to restore a database rs2005sbsDW from the hard disk but it gives me the following error message. TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ ADDITIONAL INFORMATION: The media family on device 'C:\Documents and Settings\Administrator.UHRC\My Documents\Microsoft Press\RS2005SBS\Setup\Database\rs2005sbsDW.MDF' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) For help, click: http://go.microsoft.com/fwlink ProdName=Microsoft+SQL ...Show All
.NET Development Complex SELECT query
Hi All, I have a query regarding the optimisation of a "SELECT" query. The probem is that there is a table having 1,00,000 of records. I have to make a "SELECT" query on them and display them in a datagrid as a report. The problem here is that i am using simple "SELECT" (SELECT * from tablename) query. and it is taking too much time. is there any optimize way so that the query will execute in less time. Thanks in advance Google uses a cluster of server which don't hold the whole result. That's why they are so fast... Google is also never loading all 1,000,000 records. Just a few of them and does perhaps a count(*) to get the approx. amount of results... ...Show All
