Paulyz's Q&A profile
Visual C# Inserting a record using databound controls
This seems like it should be simple. I'm probably missing something obvious.. but here goes... How do I have a form for entering a new customer ( for example ),using databound controls on that form I'm not opening a dataset to start with, so I can't just insert a record into that dataset. I suppose I could do a select saying something like "where customerID = -1" ( which would return zero rows ), and then insert a row into the empty dataset, but that seems kind of ugly. Is there a "right" way to do this My appologies if this is a stupid question. Thanks, Kirk Hi, See: http://msdn2.microsoft.com/en-us/library/ms233812(VS.80).aspx Thanks ...Show All
Visual C++ Files paths withing VS 2005?
I guess I'm not smart enough to figure out how to get the file path of a file opened inside VS 2005. With VC6 you could get a file's properties and there view the path. I guess Microsoft determined that wasn't usefull so its not in VS 2005. So is it possible to get the path of a file opened in VS or is a yet another thing that makes me wish I could go back to VC6 For files not part of the project, make sure you have this option turned on in tools-options-environment-documents: Show Miscellaneous Files in Solution Explorer. then just press ALT+ENTER while file is highlighted in solution explorer. Or vote on these: https://connect.microsoft.com/VisualStudio/feedback ...Show All
SQL Server SPLIT AN ARRAY!
dear friends, I have a stored procedure that receives a parameter like ' 123#67#1#89#52#' I need to insert each number (123, 67, 1...) in a table... How can I do it using the best performance Thanks!!! Cheers!!! Jean, But I need is to extract each field in a while, and insert each extracted value in one table. The example you gave me is not too long for my case Thanks!! ...Show All
Visual Basic COMBO BOX DISTINCT RECORDS
Can anyone Knows How to show distinct records in Combo box with data control Thanks If your using the data binding for the combobox then you should do something like Dim d3 As DataTable = dt.DefaultView.ToTable(True, "City") To create a new datatable which is based upon the Unique city fields in a datatable called dt. The result is a datatable called d3 which contains only unique city fields and which you can then use for you databinding by setting as the datasource property of the combobox. ...Show All
Visual Basic Windows Service - Out of Memory Exception
I have created a windows service using vb.net which uses a filesystemwatcher to monitoe files in a specifc directory, if images are added to the directory they are resized and saved in a remote directory. The original file is then backed up and deleted from the image directory. The code is as follows Friend Shared Sub ResizeImage(ByVal path As String, ByVal filename As String) Dim asr As AppSettingsReader = New AppSettingsReader Dim sRemoteDirectory As String = CType(asr.GetValue("RemoteDirectory", GetType(String)), String) Dim sBackupDirectory As String = CType(asr.GetValue("BackupDirectory", GetType(String)), String) ' Dim img As Image = ImageFromFile(path) (This was put in as an alternative but p ...Show All
SharePoint Products and Technologies When I edit a document it opens as Read Only
Hi: Does anybody knows why if one user is administrator of a site and edits a Word or Excel document, it opens as Read Only He is opening the document with the 'Edit with Microsoft Office...' but he cannot save the document, and it is necessary to delete and upload it again, and he has to do it every time he wants to modify it. Regards. We recently had a similar situation with two users at my company. All Word, Excel, and PowerPoint documents suddenly started opening in read only mode. We also found the "Explorer View" in the document libraries did not work and could not use Windows Explorer to view WSS site. Both users were running Windows 2000 with Internet Explorer 6 (IE 6) in SPS 2003 e ...Show All
Visual C# static method - Is there any workaround?
I think most know we cannot declare a static anything in an interface. However, let's say I have this: public sealed class MyClass { private MyClass(string someText) { m_someModifiedText = someText; } private readonly static m_someModifiedText; public static MyClass Create( string someText ) { string modifiedText= ModifyText(someText); return new MyClass(someText); } private string ModifyText(string someText) { string modifiedText = someText; //do something to modify text return modifiedText; } public static string UsefulText { return m_someModifiedText; } } Now, this "sample" is just to keep it simple, but PLEASE just consider the concept rather than what the ...Show All
.NET Development Convert HTML entities to chars?
Hello people, I'm parsing some HTML in my current application, but there's a small problem with some characters. So, I want to convert all HTML entities in a string to their real characters, like: Ç -> C Is there a class that can help me do this I would like to avoid writing my own, since that would be pretty boring. Thanks in advance, Dan Soendergaard Denmark No, I haven't tried it. In the minute you replied me, I found the HttpUtility class in the System.Web namespace, which contains a function called HtmlDecode, it can do the job. But thanks anyway :) - Dan ...Show All
SQL Server XML source drops data - can I fix in XSD?
XML looks like this: < xml version="1.0" standalone="yes" > <hist key="ABC"> <r date="2006/04/21" time="08:53:04" seq="1029">123</r> <r date="2006/04/21" time="09:21:40" seq="1613">123.25</r> <r date="2006/04/21" time="09:37:22" seq=" 89">194.21</r> <r date="2006/04/21" time="09:37:22" seq=" 91">194.21</r> <r date="2006/04/21" time="09:37:22" seq=" 93">194.22</r> <r date="2006/04/21" time="09:37:22" seq=" 95">194.22</r> </hist> In SSIS it reads all t ...Show All
Visual Basic Trouble preventing duplicate instance of application
Hi, Regarding preventing or allowing a second instance of my application to run...I need the user to have a choice, so coded up the following. Friend Class FormSplash ... (the splash form is active for < 2 seconds) FormSplashLoad() ... If (closeCuz2ndInstance()) Then Application.Exit() End If ... continue with initializations ... close splash and open subsequent form(s) Function closeCuz2ndInstance() As Boolean 'Check to see if another instance of this program is already running. 'If so, ask user what they want to do. 'Reply True iff there are other instance(s) and the user wants to close. Dim openAnyway As Boolean If (PrevInstance()) Then openAnyway = MsgBox(& ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Generating Universe with System.Drawing.Bitmap before Xna.Texture
Hi. I've done a code that can show a generated "constillations" (sp ) like in outer space, known as a "Star Generator" which generates stars in a bitmap. Here's the code which I'm about to show: All I get when applying this is a "Index was outside the bounds of the array" error. Any idea's, I even tried applying the surface directly on to the new texture surfac which does not produce errors ...Show All
Visual Basic Cant we use FileSystemWatcher in Windows Services? Error "Not of a valid form"
Hi, I have added a FileSystemWatcher to my Service program and build and installed it successfully. But when i start the service it says, Error. "Not of a valid form" Can this object be used only on a valid form Or am I making any stupid mistake This is the code I have written. Public Class FlashTrapperService Dim WithEvents fswFTWatch As System.IO.FileSystemWatcher Protected Overrides Sub OnStart( ByVal args() As String ) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. fswFTWatch = New System.IO.FileSystemWatcher() username = My .User.Name username = username.Remove(0, username.LastIndexOf( "\" ...Show All
Game Technologies: DirectX, XNA, XACT, etc. problem with "your first game: Microsoft XNA game studio express in 2d" tutorial
Hey, i just started using the xna game studio express beta 2 today and i decided to try out the tutorial. I thought i did everything correctly but when i debug it, it gives me an error for the line " spritebatch = new SpriteBatch (graphics.GraphicsDevice);" it says "InvalidOperationException was unhandled" and im not really sure what to do. any help with fixing this would be greatly appreciated, thanks. From here , I don't see that it supports 1.1 or 2.0 shaders. It looks like it might be nVidia's version of shaders as it mentioned nVidia Shading Rasterizer. ...Show All
Visual C# Find the right library at runtime
Hello, Im writing a program that checks several company's websites for prices and compares them. Since every website is different, i have a different library with specific methods for each website. I want to be able to add libraries later on without having to change the source of my program. What i wanted to do was specify the library names in xml, use that to make an arraylist of websites, and use reflection to use those libraries. However, the program can't find the libraries unless i add the right reference before compiling. Is it possible to add libraries and use them without having to add a reference and recompiling my program Thanks in advance, Stijn I still haven't gotten this completely right... ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Anitaliasing when rendering to sprite
I'm hoping someone can help me get antialising working in my game. I figured out that when rendering directly to the screen I can set antialiasing using these fields at the top of my render function. myDevice.RenderState.MultiSampleAntiAlias = true ; myDevice.PresentationParameters.MultiSampleType = MultiSample.SixteenSamples; myDevice.PresentationParameters.MultiSampleQuality = 8; I've been building a library though, where every asset has it's own render function, and the screen is rendered to a RenderTarget2D and displayed on a sprite, and I cannot for the life of me antialias the 3D objects in my screen. I tried setting these fields in the game render function, on the render functions of all the individual objects, on th ...Show All
