MarcoSartore's Q&A profile
Windows Forms Change file ownership of an output file.
My program generate a data file, (e.g .txt) What I want to do is RIGHT AFTER the file is generated, it will 1) change the file ownership to an admin account ( i have the admin username and password) 2) change the permission to readonly for everyone(domain user). This ways, I am sure the data file is safe and the data is correct. Thanks, Terrence I want to take the owner as well. So I do this. fSecurity.SetOwner( new NTAccount ( "domainName\\admin" )); However, I got this error message. "The security identifier is not allowed to be the owner of this object" Thanks. ...Show All
Visual Basic Create Web-like Forms as Windows App
I have used VS 2005 to create a family-based web site ... about 100 pages/forms consisting of mostly text with some graphics thrown in for interest. I have no intention of putting this out on a publicly-accessible server but instead had anticipated burning everything onto CD's and then distributing that to family members so that they could view the site on their own machines (XP Pro SP2) using IE. In inquiring on this forum how to do that I am told that that is not feasible and that instead I should have created a windows app and simply deployed that app to the family (via CD). That's fine except for one thing ... I don't know how to create a web-like app as a windows app. For example, as I create the app I want to be able to easily highli ...Show All
Visual Basic HowDoI Get listviewitem from another app
I want to capture information about selected listview items from a listview in a different application. I know that the sendmessage api can do that. I want to get the item text and I am having trouble getting that with the sendmessage api because it requires a pointer to a structure. Can anyone help with the best way to do this using vb.net2005 Thanks, Engineerik You can start here.... http://www.microsoft.com/communities/default.mspx and specifically I would check the windows SDK newsgroup: http://msdn.microsoft.com/newsgroups/topic.aspx url=/MSDN-FILES/028/201/015/topic.xml ...Show All
Smart Device Development Changing Colors of Datagrid
I have a VB.NET application running on a HHP handheld (Windows Mobile 2003). I would like the backcolor of the rows of the grid to appear as a particular color depending on their value. For example: If Cell = 1, then Backcolor = Red. If Cell = 2, then Backcolor = Blue. From reading other posts i understand I have to inherit the dataGridColumnStyle and override the paint method. I have no idea how to do this. Could someone provide a few lines of code to demonstrate At the moment all I have is this, which only colours the selected cell. Private Sub grdResults_CurrentCellChanged( ByVal sender As Object , ByVal e As System.EventArgs) Handles grdResults.CurrentCellChanged Dim currentCell As DataGridCell ...Show All
SQL Server "Incorrect syntax" exception when prefacing SP names with "dbo." and named parameter issues
We're currently trying to evaluate SQLJDBC 2005 1.1 June CTP's support for database mirroring automatic failover. Unfortunately we're getting unexpected exceptions for calls that work fine w/ jtds that our blocking our ability to perform these evaluations without us making substantial changes to our codebase. The first issue is with the name used when calling a stored procedure -- SP names that start with "dbo." give us the following error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '.'. src:{call dbo.xyz( , , , , , , , )} The call will work if we change the SQL statement to {call xyz(...)}. I don't understand why we would need to do this, especially given that the documentation for the dr ...Show All
Visual Basic DLL Creation
I want to create a DLL for editing HEX Data I want that if it is referenced for editing any bytes you need write this line: WriteB (File , Seek, Byte) File= Files to open with FileStream ( Imports Sytem.IO is necessary obviously) Seek= For moving the pointer in a offset Byte= Byte to write in the Offset Now if i want to edit a byte i need write this code Dim str As New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.ReadWrite) str.Seek(&H18D, SeekOrigin.Begin) str.WriteByte(CByte("&H" & ComboBox3.Text)) And i want to create a Function in the DLL Imports System.IO Public Class Class1 ' Start Function Public Function Nome_funzione As CallType ......... ...Show All
Visual Studio 2008 (Pre-release) Updating a self-hosted service
Context I'm designing a windows service to run a self-hosted scenario of services that are loaded from GAC. I've created a "drop" folder, in which to drop the .dll of the service I want to host. My service watches this folder and when a file has been dropped in, I install it into the GAC and load the ServiceHost. Now, my trouble is that when I'm "updating" an existing hosted service, it does not reflect the updated code that I've installed to the GAC, even though I close the ServiceHost and create a new service host from the GAC. It seems to cache to original service somewhere until I actually restart my Windows service. Question Is there a way to dynamically change the hosted service without ...Show All
SQL Server T-SQL overlapping time
I have a table with following fields CURRENT_DAY FROM_DATE TO_DATE 1 1899-12-20 09:00:00.000 1899-12-20 10:00:00.000 1 1899-12-20 09:50:00.000 1899-12-20 11:00:00.000 1 1899-12-20 12:00:00.000 1899-12-20 02:00:00.000 I need the count of records that overlap with each other. [OR] 1 if there is overlap, 0 if there is no overlap. I am new to sql, thanks for any help. Yog I used the cross join, but its slow..i am sure there is a better way of doing this..not getting the idea. SELECT count(*) FROM TABLE1 S1 CROSS JOIN TABLE1 S2 WHERE ( S2.FROM_DATE BETWEEN S1.FROM_DATE AND S1.TO_D ...Show All
Visual Basic Statup in Vb.net 2005
I'm not able to assign Sub Main() as the start up for my windows project in VS 2005. It is taking a form by default. Is there any way of calling sub Main as startup instead of the form Thank you. I copied the Sub Main code in Application events and its processing as before. I had one more question if you dont mind. In VS 2003 VB.NET projects, one could see the values of variables during debugging in Local or Auto windows. How do I see the variable values now in VS 2005 I dont see anything in immediate window. ...Show All
Visual Studio Express Editions pulling data from one table then saving to another?
Hello World, As the title suggests im populating textboxes and comboboxes from a table in an ms access db, I have created another table in the same database and i would like to save the data im pulling from table1 to table2.. this means that my data will be repeated in the new table so is probably not the best idea performance wise so im stuck on how i do this i need the data in table2 (invoice data) to work together with table1 (customer data) im I doing this the right way or is there an easier way to go about this Any help in this matter would be great :) I understand the basics of the code but the insert and the reference to an sql connection, is that for MS Access as well Thanks! ...Show All
Windows Search Technologies Combined IFilter + ISearchProtocol
http://addins.msn.com/devguide.aspx defines two technologies for integrating with WDS: IFilters and protocol handlers. One of our applications stores various data and documents internally within one file. The user creates one or more of these files on the Windows file system. We'd like to expose the data in these files to WDS. So we would implement IFilter and register it for our file extension. But these files can contain a lot of data, so it wouldn't be all that useful to return all the text as one monolithic item to WDS (all that WDS could report is that the search phrase exists somewhere in our file, right ). Now, we also intend to make the data and documents within these files accessible via URLs (using a asynchronous plugga ...Show All
SQL Server Percentage/Proportion
I'm new to Analysis Services 2005 and MDX. I'm trying to create a calculated member that contains the proportion of cases (using [Measures]. ) for each dimension in the cube. The following code gives me the percentage of the total number of members in each dimension. This is what I need for attribute hiearchies (single-level), but for user-defined hiearchies (multi-level) I want the percentage of the above level. For example, in a time dimension, I want the proportion of cases in each year (this works) and the proportion of cases in each quarter of a given year (this doesn't work). CALCULATE ; CREATE MEMBER CURRENTCUBE .[MEASURES].PercentCases AS CASE WHEN IsEmpty ([Measures]. ) THEN NULL ELSE (( [DimLocati ...Show All
Smart Device Development Programatically changing IPaddress
I am building an embedded WindowCE device that will 'serve' data to various clients and need to change the IP programatically based on a message from the client. I know where the registry keys are (I currently use them to determine the current IP setting) but changing these keys directly does not appear to effect much. Thanks ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Asteroid Defense. -- That's an EXE!!!
In this game you are a ship protecting a planet from incoming asteroids. Controls: 360 controller: Left Joystick -- Move ship left and right. A -- Shoot Right or Left Trigger -- Change Weapon. Keyboard Left and Right Arrow Keys -- Move ship left and right. Up and Down Arrow Keys -- Change Weapon Space -- Shoot The weapon you are using is shown in the top left corner. The stronger the weapon you use, the less points you get for destroying an asteroid. Levels progress at timed intervals and more and more asteroids come down. You lose when one of them reaches the planet. Screenshot: http://www.rocketsoft.gm-school.uni.cc/uploads/ADScreen.JPG Game File: http://www.rocketsoft.gm-school.uni.cc/uploads/AsteroidDefense1.1.rar All in ...Show All
Visual Studio Team System Failed to create team project
Hi Suddenly, when I try to create new team project , I got the following error: TF30162: Task "WITs" from Group "WorkItemTracking" failed. 2 days before I successfully created projects. Operations that I took when I tried to solve this problem: 1. grant administrator authorization to all tfs services . 2. re-loaded process templates . 3. restart the tfs machine . 4. make sure that all related services started . 5. browse tfs's web services (all of the *.asmx) to make sure they are available . Unfortunately, The error still occurs. Note: I didn't do any significant thing during the last couple of days beside of creating one team project and loading files into source control. What should I do Below logs that des ...Show All
