TJMFAM's Q&A profile
Visual C# DrawString into the Center of an image
Hi all, I'm trying to Draw a string on an image but i want to draw it on the center on the image, But DrawString finction draw form top left corner. Can any one help me to do this Regards, Thank you Brendan Grant for the answer but another question: I made a code to a barcode, I made aclass return an image to draw the barcode and the other text i need in the label then print it through a PrintDocumnet I draw the image: private void printDocument1_PrintPage( object sender, System.Drawing.Printing. PrintPageEventArgs e) { using ( Graphics g = e.Graphics) { Font fnt = new Font ( "verdana" , 8); g.Draw ...Show All
Visual Studio Team System Duplicate Project Names
I am running TFS Beta 3. I have a situation where I have cancelled the creation of a new project (during the phase of it downloading the templates) and now I can't re-create the project with the same name. It says it already exists, although its not available as an Add Existing Project either. Is there anything I can run on the server that will validate all existing project data in the database Regards Graham Thanks for the info Michael. Unfortunately in the end I needed this server working as planned so I simple uninstalled TFS and STS, removed their databases and reinstalled. All is working now ;-) G ...Show All
SQL Server Logging from a custom source adapter
I'm having alot of trouble figuring out the proper way to log from inside my custom source adapter. I couldn't find my useful information in MSDN, it mostly applies to logging from inside a script task. I'd like to log my messages along with all the other SSIS package log entries, which I have going to the dts log table. I'm assuming I should be using some functionality from Microsoft.SqlServer.Dts.RunTime, probably the LogProvider. Can anyone advise Try ComponentMetadata.FireError() ComponentMetadata.FireInformation() ComponentMetadata.FireWarning() etc... -Jamie ...Show All
SQL Server Slow Startup from Idle
Is it possible to stop the server from going to sleep when it is idle to improve responsiveness to new connections Could you describe your problem it a bit more detail Are you connecting to the express instance using "user instance=true" in the connection string Do logins seem to take longer if the instance is idle some particular amount of time ...Show All
Visual Studio how to inject files into a target?
Is there a way to inject source files into a target before the build starts in VS2005 I want to do some external processing and perhaps add source files to a target when the project is built. I tried this doing it in BeforeBuild/PreBuild but changes to the target were not read until the next build. Is it accurate to say BeforeBuild/PreBuild are executed earliest in the build NOT before the build. I'm looking for a pre pre-build hook. How exactly are you "injecting" these files I'd have to know more about your situation, to really go into it but I'll give it a shot. It seems like there are some conditions that must be met before you ad ...Show All
SQL Server Distributed Transactions ?
Hi There I realize this is probably a basic question or at least i hope so but i cannot get distributed transactions working. BOL is just driving me in circles. I am running SS2000, MSDTC is up and running on the server. I have added a trigger to a table where on insert or update the triggers fires and inserts a row to a remote server. When i execute the update or insert i get the error: Cannot start a distributed transaction. I have tried stating BEGIN DISTRIBUTED TRANSACTION before the update but i get the same error, i have also read up on SET REMOTE_PROC_TRANSACTIONS, but this is not a remote sp. Can anyone please reccomend a good link a ...Show All
Visual Basic Shell Method
How can I load a folder up in the windows explorer Your first line, should be... Dim sFile As String = Me .TextBox.Text.ToString() Don't forget to add the .Text before the .ToString(). If that doesn't help, debug the code, and check the value of sFile at the If statement. ...Show All
SQL Server Standard email body in automated reports
Hi, I currently have subscriptions set up on several reports to automate the emailing of the reports to various employees in my company on a fixed schedule. What I would like to know is if there is a way to modify the contents of the email body that gets sent, I would like to put a logo as well as contact details in the body of the email that gets sent off for each report. Can anybody let me know if this is possible Thanks in advance PS. The subscriptions I have set up are both normal subscriptions and data driven subscriptions It is not possible to do layout of the e-mail body. All you can ...Show All
Windows Forms DatagridView column format for passwords
How can I change the column format from an Datagridview to display the password char (same as UseSystemPasswordChar in a TextBox) I have a column of type DataGridViewTextBoxColumn, but there isn't this property. Anonymous561786 wrote: Handle the CellFormatting event of the grid. If you are in the right column (password) show "*". Private Sub grid_CellFormatting( ByVal sender As Object , ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles grid.CellFormatting If (e.ColumnIndex <> -1 AndAlso grid.Co ...Show All
Windows Forms Detecting state of DataGridView
I have the classic problem of what to do with changes to a row that have not yet been committed when the user does a save. I'm using a DataGridView control in Virtual Mode (which is a truly sweet feature.) User edits a cell and doesn't move to another cell / row ( ) so that the change is not "committed" i.e. not pushed to the changed value back into the grid and its underlying data structure. He then does the save command. The problem is that the old value rather than the new gets saved. I should use the dgv leave event to do force the push, but 1) How can I detect the need to do the force 2) What is the recommended way to ...Show All
Visual Studio Express Editions Building a code editor w/color
Is there a way to duplicate/simulate the code editor color highlighting that VB uses I know I'll have to use the rich textbox class. Have tried some but so far I get mixed results. Has anybody tried and succceded doing something like this jb.. hi, i found this couble of days ago i don't know if this what you asking for or not http://www.codeproject.com/csharp/twosbide.asp but its C# not vb, anyway you can take it as guidance hope this will help ...Show All
.NET Development Client requires callbacks
Hi, I've been developing an application for transfer files between server and client. The remotable object is hosted in IIS on server. The client uses a Windows application for transferring files. The client requires callbacks from server during transfers. This is required for displaying progress bar showing the amount of bytes being transferred. I've used the following configuration files for Server and Client and it works fine on my own compute. But when I add the Server portion on a different computer accessible through Internet, it gives me an error "Could not connect to the remote machine because the target machine active ...Show All
Windows Forms DataGridView doesn't keep column order
I have a DataGridView on my form that I bind to a BindingSource, which in turn is bound to BindingList<MyStruct>. MyStruct is a custom struct with three public properties (say A, B, C). I set up the columns for my DataGridView in code, by adding the appropriate columns in the order in want them (A, B, C). However, at runtime, the grid displays&nb ...Show All
.NET Development Convert Integer value to byte Array
Hello I have an integer value and byte array variable like this : int intSize = 11522; byte [] _Size = new byte [4]; How can i to convert the integer to byte array Thanks one way: _size[0] = intSize & 0x000F; _size[1] = (intSize & 0x00F0) >> 8; _size[2] = intSize & 0x0F00 >> 16; _size[3] = intSize & 0xF000 >> 24; or _size[0] = intSize & 0x000F; _size[1] = (intSize >> 8) & 0x000F; _size[2] = (intSize >> 16) & 0x000F; _size[3] = (intSize >> 24) & 0x000F; or ...Show All
Visual Studio Tools for Office Can the server document do the following (Microsoft Word VSTO 2005):
Hi There is a web application that is currently producing large complex reports, many pages long, and the reports include labels, and values behind the labels; there are no charts. We are planning to use Microsoft Word 2003 and or 2007 when finalized and stable for the report viewing part. The reports today are done HTML, there are tons of technologies that we can use for reporting, but at the end, the most usable tool when it comes to printing is Microsoft Word. The data is entered using Microsoft InfoPath, ASPX pages, Microsoft Word itself (for rich formatted contents), as well as data coming from other systems. The applica ...Show All
