like_antani's Q&A profile
.NET Development Debug into FCL?
Is there any way for us to debug into FCL (er, of cource if source code in c# or MSIL is there, that would be much better) I'm asking this because I do think all my code is right (I've used that code for almost 1 year, and only this time it's not working), but it stuns inside FCL, and then tells me "Time Over". Not really, you can debug the native code generated by the JIT compiler. Raw stuff though, no annotation whatsoever. A useful tool to try to figure out what the FCL method might be doing is Reflector . ...Show All
Visual C# StreamWriter not writing to file
public StreamWriter writeFile; string filename = logDirectory+DateTime.Now.Year+DateTime.Now.Month+"_Ftp.log"; writeFile= new StreamWriter(filename, true ); writeFile.Write("text to write"); This above code does not work for some reason...can anyone tell me why This code is suppose to append some log text each day to the file and a new file is created every month. You need to close the StreamWriter. Ideally you should wrap the output code in a using statement, since StreamWriter implements IDisposable: string filename = logDirectory+DateTime.Now.Year+DateTime.Now.Month+"_Ftp.log"; using (StreamWriter writeFile = new StreamWriter(filename, true ...Show All
SQL Server Help with an error message
I keep getting this error message when I try to restore a database backup that I have made. System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Databases\GTT_Data.MDF" failed with the operating system error 5(error not found). (Microsoft.SqlServer.Express.Smo) What I have done is created a backup of my sql sever database and I am now trying to restore it into sql server express for someone to play around with without it affecting my actual database. This is where the error messages are coming from. Please help It took me an hour to find out that. When you backup database on one machine and then restore it on another it could happen that *******.mdf files is situated in different folders. Then you ...Show All
SQL Server Transact-SQL equivalent of MySQL LIMIT
In mySQL for example i could have: ORDER BY ID DESC LIMIT 5,25 where it would start from 5'th row found and return up to 25 rows. How do i achieve the same in Transact-SQL The LIMIT 5, 25 part. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE PROCEDURE getMessages -- Add the parameters for the stored procedure here @username varchar ( 10 ), AS BEGIN -- Insert statements for procedure here SELECT ID , Sender , ...Show All
Visual Studio Debugger opens wrong files
I am running a relatively large unmanaged VC++ solution (~110 projects) in Visual Studio 2005 which builds a handful of dependant libraries, unit tests, and a couple sample executables. As one might imagine, this solution contains a number of files in different projects which share the same name ("test.cpp", for instance). When stepping though code, the debugger has the tendancy to bring up the wrong file. I can set a break point in a given file which is respected by the debugger, but it then proceeds to follow the execution path, correctly following line numbers but in the wrong source file. This behavior suggests to me that maybe the system is using some kind of hash based on file name which has some-how fallen out of sync with the files ...Show All
SQL Server What is the best algorithm to use?
I am new to DM and I am not sure which algorithm would be best to use. I am trying to build a custom comparitor application that companies can use to compare themselves against other companies based on certain pieces of information. I need to group a company with 11 other companies based on 6 attributes. I need the ability to apply weightings to each of the 6 attributes and have those taken into consideration when determining which 10 other companies each company is grouped with. Each group must contain 11 members, the company for the user logged in and 10 other companies that it will be compared against. At first I thought that clustering would be a good fit for this but I can not see a way to mandate that each cluster contain exac ...Show All
.NET Development reading file encoding
I use a StreamReader to open a txt file that i dont know the encoding page. Its possible to detect the encoding page of a txt file and open then Unless it starts with a BOM , no, there is no way. ...Show All
Visual C++ DateTimePicker Control : How to set back color?
Hi, I'm using C++/CLI 2005. I'm trying to customize a " DateTimePicker " control by changing it's background color. For the calendar part, no problemo. I've just set the " CalendarMonthBackground " property to the desired color and it worked like a charm. Now I had to soon realize that my "input" part of the control, if I can call it this way, still have that same white background color. I've tried to use the " BackColor " property but it had no effect at all. Still stuck with that same "white" background... How can I change it Any clue Thanks in advance, Stephane Have you seen remark from ...Show All
SQL Server Left join returns values where I was was expecting nulls
I have a query which is returning a different result set when it is run against identical tables in 2 different environments. The query is like: Select F.LicenseeID, IsSpecialLicensee from FactTable F left join View_SpecialLicensee SL on F.LicenseeID = SL.LicenseeID The Create Statement for the view is like Create View [dbo].[View_SpecialLicensee] as Select LicenseeID, LicenseeName, IsSpecialLicensee = 1 from DimensionLicensee where LicenseeName like '%ibm%' or LicenseeName like '%cisco%' or LicenseeName like '%hp%' In my test environment, I get the query result I expected: LicenseeID, IsSpecialLicensee 1 , 1 - (where LicenseeName = 'IBM') 2, null - (where LicenseeName = 'Juniper') 3, 1 - (where LicenseeName = 'Cisco') 4 ...Show All
SQL Server Transaction Log Analyzer on a 64bits box
Hello, Would someone recommend me a tool able to analyze a transaction log coming from a SQL 2005 running on a 64 bits box Thanks, Olivier ...Show All
Visual Basic problem adding menu item
i have db connection that loads 2 fields, name and directory then i need to add the 2 records to a menu so i have file.dropdownitems.add(name, nothing, process.start(directory)) but VB is telling me that system.diagnostics.process cannot be converted to system.eventhandler what am i doing wrong can someone point me in the right direction ! thanks in advance!! "file.dropdownitems.add(name, nothing, process.start(directory))" To add two records, use the .addrange method. Here is an example: Me .MnuFile.DropDownItems.AddRange( New System.Windows.Forms.ToolStripItem() _ { Me .MnuFileNewDatabase, Me .ToolStripSeparator5, Me .mnuFileOpen, Me .ToolStripSeparator4, _ Me .mnuFileClose, M ...Show All
Windows Forms Handling unique column constraint errors
Hi Folks, I have a unique column contraint (Indexed, non-clustered, Not-Null, Not PK, the column value is nvarchar type(50)) on a dataset. I am trying to figure out how to check for the unique value before submitting update back to database. I want to trap the user entry if it violates the constraint, and supply a message dialog so the user can make corrections before re-submitting the update. The message only needs to let the user know that the textbox entry they have attempted to save is already in the database, and they should try some other unique entry. So far, I haven't figure out how to raise the error, or trap it for processing at the application level. However, the table simply does not save the violating entry; nor does ...Show All
.NET Development Login failed
I tried the following code Sub CreateDataAccessObjects( ByVal db As Database) ' Create relational datasource Dim ds As New RelationalDataSource( "THYROID" , "THYROID" ) ds.ConnectionString = " Integrated Security=SSPI; Provider=MSOLAP.3;Data Source=localhost;Initial Catalog=THYROID" db.DataSources.Add(ds) ' Create connection to datasource to extract schema to dataset Dim dset As New DataSet() Dim cn As New SqlConnection( " Integrated Security=SSPI; Data Source=localhost;Initial Catalog=" & CbDatabase.Text) ' Create the customers data adapter with the ' calculated column appended Dim daCustomers As New SqlDataAdapter( &quo ...Show All
Visual Studio Express Editions STD lib link error 2019
Why am I getting a LNK 2019 error for this code: #include <fstream> void INITIALIZE::loadSettings( bool loadDefaults) { std::ifstream *pStream = new std::ifstream; pStream->open( "./config.cfg" , ios::in); } Thanks in advance. M. B. Now that the ice storm is over, and the power is back on after five freaking days - I can let you know that the problem was a bad custom install on my part. Strange though, because the files were actually on the disc and the environment was pointing to them. Oh well, anyway, I uninstalled the IDE and the SDK, and the update to .net 2.0. I then cleaned up the trash with norton's windoctor,  ...Show All
SQL Server Is there a 64Bit SQL 2000?
We have SQL 2000 but are getting new 64bit servers, can we upgrade to a 64bit version of SQL 2000 or do we need to go to 2005 I assume the 32bit SQL 2000 will run on x64 hardware Craig Any ideas where on MSDN I can download the SQL Server 2000 64bit version I checked here: http://msdn2.microsoft.com/en-us/library/aa496089.aspx , but there is no download link. Thanks. Nathan ...Show All
