Andrew Mackie's Q&A profile
Visual C# Timer ticker is called after timer is disposed
Hi everyone, I have a System.Threading.Timer that update a progress-bar on a form. The problem is sometimes the update method still is called after the timer and the form are disposed and get following msg: An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Windows.Forms.dll Additional information: Cannot access a disposed object. The related code: private volatile bool WaitFormDisposed = false ; System.Threading. TimerCallback waitDelegate = new System.Threading. TimerCallback ( this .DoWork); this .waitTimer = new System.Threading. Timer (waitDelegate, null , 500, 500); EndWait() is called from outside the form: public void EndWait( object sender, EventArgs ...Show All
Visual Basic Single APP Instance VB.NET 2005
Hi I need to make my App a single instance, and pass arguments I have a Main Module : Public Sub Main( ByVal sArgs() As String ) How can I use sARgs with ONLY one App instance i.e., I want to pass Arguments to the running instance I use VS.2005..Visual Basic Thanks in advance You could always enable the Application Framework, which has this feature built-in to allow you to create a single instance application. ...Show All
SQL Server Unexpected results of stored procedure
hi, hvae a little trouble with thos procedure. When executed it always adds 2 to the value of fields Telefon and Mobil. Can anyone help me, please Kurt ALTER Procedure opdaterbruger ( @Initialer nvarchar(100), @Mailadr nvarchar(100), @Telefon float(8), @PlusNet float(8), @Mobil float(8), @pnmobil float(8) ) AS UPDATE Brugere SET Mailadresse = @Mailadr WHERE Initialer = @Initialer IF (@Initialer= '0') OR NOT EXISTS ( SELECT * FROM PNetlokal WHERE Bruger = @Initialer) INSERT INTO pnetlokal ( Bruger, Kortnr, Telnr ) VALUES ( @initialer, @Plusnet, @Telefon) ELSE UPDATE PNetLokal SET TelNr = @Telefon, KortNr = @PlusNet WHERE Bruger = @Initialer IF (@Initialer= '0') O ...Show All
Visual Studio Express Editions Can't Download!
I'm a total newbie to this forum so I'm sorry if this is in the wrong section. I've downloaded the Visual C++ setup from microsoft.com. I unpack the setup, wait for the install components to load, run through the setup (only selecting the graphical IDE to install), choose my install directory (left as default) and click install. It says that it is downloading .NET framework & the the IDE after that. I then get an error message saying that .NET framework cannot be downloaded. Yes, I am connected to the internet, & Yes, I have BITS & it's dependancies enabled. Can anyone help You could try downloading the complete vc++ express download as an iso file from: http://msdn.microsoft.com/vstudio/ex ...Show All
SQL Server A problem about ADO!
i visit db with ado interface, but now i hava a sql like below: select * into #t1 from measureInfo; select * from #t1; drop table #t1; it can't execute with ado. Does Ado not support sql operation like this thks Yes.. You can do this...execute the below query it will work.. Set NOCOUNT ON; select * into #t1 from measureInfo; select * from #t1; drop table #t1; ...Show All
Visual Studio Team System Generate script for 2000 and 2005
Hi, The database I'm building needs to run on 2000 and 2005. I have the project set to SQL 2000. Now I have a script that grants execute permissions. It checks the server version and based on that executes a script for 2000 or for 2005. Like this: DECLARE @version CHAR(1) ; set @version = SUBSTRING(CONVERT(CHAR(20), SERVERPROPERTY('productversion')),1,1) IF @version = '8' -- SQL Server 2000 BEGIN DECLARE @sql NVARCHAR(4000) DECLARE @db SYSNAME ; SET @db = DB_NAME() declare @u SYSNAME ; SET @u = QUOTENAME('NT AUTHORITY\NETWORK SERVICE') set @sql ='SELECT ''GRANT EXEC ON '' + QUOTENAME(ROUTINE_SCHEMA) + ''.'' + QUOTENAME(ROUTINE_NAME) + '' TO ' + @u + ''' FROM INFORMATION_SCHEMA.ROUTINES ' + 'WHERE OBJECT ...Show All
Windows Forms Updating a specific row in Access database
Hi, I have another question regarding my database application. After my other question being answered here , I was able to populate a listbox with data from a column of an Access database. I now need to edit a specific item of the listbox and then update it in the database. The idea is the following: below the Listbox is a Textbox and a button labeled 'Update'. The user selects an item from the listbox and then writes something in the textbox below. When the Save button is pressed, the content of the textbox replace the value of that specific item in the database. How can this be achieved Or is there an easier way similar to what I have in mind And I don't have a DataSource associated with my project. (please refer to the code for ...Show All
Visual Studio Team System Team Explorer requires login
Two of my support people have an issue with Team Explorer requiring them to login each time the app is opened. They do not have VS, just Team explorer as they are software testers. Each time they open the app, they are prompted for their username and password. Once they supply their domain credentials they are allowed to use Team, so I dont know how it could be a permissions issue. I have a couple of dozen support people using the exact same configuration, and only these two are effected for some reason. Any thoughts or ideas Thanks in advance. MikeH Which version of OS your support folks (that are having this issue) running You can try adding http://<yourservername> and/or h ...Show All
.NET Development looping through recordsets using .net
Hi, I am trying to loop through 2 sql tables and update one table with data from the other if a condition is true. I know how to do this with vb but not with vb.net and can't find any help or examples. I have established a connection to the server to get the data but don't know how to loop through it and make the necessary updates. Can someone give an example Here is what my vb function looks like below, I would like to be able to transform this into vb.net and use in a script task in my sql package. Dim db As Database Dim rec1 As Recordset Dim rec2 As Recordset Dim test2 As Boolean Dim AppID As String Dim SortKey As String Set db = CurrentDb Set rec1 = db.OpenRecordset("qryScoresAll") Set rec2 = db.OpenRe ...Show All
.NET Development add parameters to oledb
I'm trying to do something very simple... not for me :) I just want to select a MarketCode from a 1st combobox and fill a 2nd combobox with names I tried this Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load daMarketCode.Fill(DsMarketCode1) End Sub Private Sub ComboBox1_SelectedIndexChanged( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboMarketCode.SelectedIndexChanged Dim cmdSelect As System.Data.OleDb.OleDbCommand cmdSelect = Me .daAgentName.SelectCommand cmdSelect.Parameters.Add( "Market" , OleDb.OleDbType.WChar) cmdSelect.Parameters(0).Value = Me .cboMarketCode.Text Me .cnOp ...Show All
Visual Basic MAKING .NET CONTROLS - OCX VB6 COMPLIANT
Hi all, I have to create a .NET control. It have to run in a vb6 app. I'd like to use it like a standard OCX control. I've found in the net that it's possible. there's anyone who can tell me in which way I can do it It's simple: have a .net control and import it in a VB6 controls list by "add control". and have it working right. Dario TIA for any suggestion! I have found that although it is possible to create a windows control and register it as an activex com control that apparently works under various applications using the template at http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,3dd24f92-a52c-4bb0-8121-c2e6e2cc4f93.aspx it may in effect be unreliable ...Show All
Windows Forms DataSet row changed
I have a dataGridView component connected to a dataset. I can load the dataset and it populates the dataGridView fine. My problem is that I want to know as soon as a user has updated a row (made changes and moved focus from the row) or inserted a row (started a new row, inserted data in one or more columns, and moved focus from the row). I have tried events like the RowLeave event of the dataGridView with checking the HasChanges method of the dataset, but the combination has strange (to me) timing issues with determining when the change was really made. What is the correct event to use and method to call to know when the user has lost row focus on a dataViewGrid and the method that will tell me ASAP on loss of focus if data in the dataset ...Show All
Visual Studio Team System Failed to load adapter
Hello, I get the error below in the event log. I have looked through the other threads but have not been able to find a working solution. An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff. Technical Information (for the administrative staff): Date (UTC): 9/1/2006 12:50:19 AM Machine: TOOLS01 Application Domain: /LM/W3SVC/4/Root/Warehouse-1-128015454095818883 Assembly: Microsoft.TeamFoundation.Warehouse, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727 Process Details: Process Name: w3wp Process Id: 7520 Thread Id: 4716 Account name: [ActiveDirectory Domain Name]\TFSSer ...Show All
Visual Studio Tools for Office Can't install VSTO 2005 SE on Office 2007
What this doesn't address is that one can't install the VSTO SE package without already having the first version installed. This requires an Office 2003 SP1 product. The only Office 2003 item we used was Outlook, but since that was part of our Exchange 2003 license (even though it included all the secondary office appliations - ie - scanning, etc.), it won't allow us to install the original VSTO 2005 product. We purchased the Office 2007 upgrade so we are currently running the full 2007 Small Business license. So we now have a situation where we just bought the development environment for which we intended to run only the VSTO SE upgrade, since we have no need for 2003 support, only 2007. Sounds like it should work, but the point is we can ...Show All
Visual Studio 2008 (Pre-release) Bind to current object (this)
Hi, Is there a syntax available to bind to the current object Something like: <Label Text="{Binding Name, RelativeSource={x:Static RelativeSource.Self}"/> I want to display the contents of the Name property in the current object (ie. the class in which this code resides). In other words, I want to avoid setting DataContext = this in my constructor. Thanks, Kent you could do < Window x:Class = " WindowsApplication1.Window1 " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Title = " My Title " Name="window1" > < L ...Show All
