Trilobyte's Q&A profile
Visual Studio Express Editions Button Click within a for each loop
Fairly new to VB express. Is it possible to have a button click event from within a for each loop on a form i.e. the button being clicked refreshes the form and moves on to the next iteration of the loop Any suggestions welcomed. Right I have achieved what I asked for all be it in a different fashion, the solution does what I was asking for. The code is as you said works well Public Class Form1 Dim myOtherArray() As String = { "Bob" , "Beth" , "Conrad" , "Grant" } Dim thePlace As Integer = 0 'this is your global variable Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Me .thePlace < myOtherAr ...Show All
.NET Development How to fully close an MDB File?
Using C#, I've built an export engine in my WinForms app that successfully writes data into a series of tables in an MDB file. At the end of the operations I dispose of the connection object - ie. "conn.Dispose();" But yet, until I close my app, the MDB's companion "LDB" file doesn't disappear. What else do I need to do to get the LDB file to disappear as soon as the export is complete Robert It's possible that connection pooling may be keeping the database open for a short period of time. That may explain why the .LDB file is still present. It's also possible that you may have other or implicit connections from your application. In a networked multi-user scenario this is also ...Show All
Visual Studio Express Editions Is there a kind of union structure in C Sharp?
I want to use "union" structure in C#,but can't find it! Can u help me Thanks in advance! And about how to simulate C++ union in C# is described underneath: In C++, Union expression is: union UValue { char _cval; int _ival; double _dval; } ; And in C#, to apoint where the members'd be located in the memory space, we need to use StructLayoutAttribute , LayoutKind enum and FieldOffsetAttribute , which are all in the namespace System.Runtime.InteropServices. Then, use struct to simulate the union above: [StructLayout(LayoutKind.Explicit, Size = 8 )] struct UValue { ...Show All
.NET Development Adding New row to DataTable is very slow
DataRow drNew = dsTranscript.Tables[ "TABLE1" ].NewRow(); drNew.BeginEdit(); drNew[ "col1" ] = "a"; drNew[ "col2" ] = "b"; drNew[ "col3" ] = "c"; drNew[ "col4" ] = "d"; drNew[ "col5" ] = "e"; drNew[ "col6" ] = "f"; drNew[ "col7" ] = "g"; drNew[ "col8" ] = "h"; drNew[ "col9" ] = "i"; drNew[ "col10" ] = "j"; drNew.EndEdit(); Tried both of these methods ... dsTranscript.Tables[ "TABLE1" ].BeginLoadData(); dsTranscript.Tables[" TABLE1 "].Rows.Add(drNew); and dsTranscript.Tables[ "TABLE1" ].Rows.InsertAt(drNew, dsTranscript.Tables[ "TRANSCRIPT_DATABASE_TABLE" ].Rows.Count); dsTranscript.Tables[ "TABLE1" ].EndLoadData(); The DataTable has about 15,000 rows.. but that ...Show All
Visual Studio Express Editions Removing labels (scriptwise) doesn't want to work.
I use the following code in my program to add some labels: Dim l As Label For i As Integer = 0 To 10 l = New Label l.Name = "LabelDay" & i.ToString l.Text = "Day" + i.ToString l.Top = 88 + (i * 20) l.Left = 5 l.AutoSize = True l.Visible = True Me.Controls.Add(l) Next i Now I want to remove them with: For Each c As Control In Me.Controls If TypeOf c Is Label Then Me.Controls.Remove(c) End If Next For some reason I have to run the remove function several times. Why doesn't my script remove all labels at once BTW - its code, not a script. Please forgive me. The code works perfect. Thanks. ...Show All
Visual Studio Express Editions "Invalid Email"
For some reason the registration page says my email address is invalid so i can't get the key, but its the same one i logged on with. Help Thanks!! I came across the same problem. I have had my email address for many years and it's find, but it keeps barking about it. I'm stuck as well and MS is no help unless I pay $99 for them to resolve this issue. ...Show All
.NET Development DoEvents not working?
This code doesn't seem to be working right. What I need to do is watch for left and mouse downs, and when both are down at the same time, show a window. This class should do it, but isn't working. The processMessage variable tells the mousehook to send the message to the appropriate window or to consume it. Public Class mouseComboWatcher Private WithEvents mh As WickedOrange.MouseHook Public Event ComboPressed() Public Event ComboReleased() Sub New () Me .mh = New WickedOrange.MouseHook End Sub Private leftMouseDown As Boolean = False Private rightMouseDown As Boolean = False Private comboDown As Boolean = False Private Sub mh_Mouse ...Show All
Windows Forms GridView DeleteCommand Firing Twice
I Have a gridview with a command button for delete defined. On the Datasource for the grid I have a DeleteCommand that runs a stored procedure that takes the ID field defined in grid view control. When the delete command is selected in the gridview the deletecommand stored procedure is called twice with the same ID (I have traced this). I have removed all delete events from the gridview and datasource. I have a FormView that has a selectcommand using the GridViews primary ID. I have autoeventwireup set to true. There is no code being ran before or after deletion. I did have a refresh procedure being ran after delete. When this was active Instead of the same record being deleted twice, the selected record and the record ...Show All
.NET Development Dictionary container serialization problems.
I have a dictionary datamember that I am trying to serialize and get the following error {"Cannot serialize member InstrumentUI.Tallie.UserSpecificData of type System.Collections.Generic.Dictionary`2[[System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[InstrumentUI.Tallie+UserTally, InstrumentUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], because it implements IDictionary."} Does this mean that you cannot serialize the dictionary data member. And if so is there antoher container that I could use. I need a data member that can store a byte[] as the key and hold another datamember that stores a string as the key and an in for the value. any ideas. I was using the dictiona ...Show All
SQL Server Format Parameter Error
Hi all, i am a newbie to reporting services. Hope someone can help me with this date problem. I have a parameter date which i declared as type string in the report manager. when i entered the date as eg) "31/12/2003" and clicked on the 'preview' tab in the report manager, it gives me error saying that 'Cast from string "31/12/2003" to type 'Date' is not valid.' So i use the cultureinfo function to set the date to 'en-US' format.... something like the one below: CStr( Format(DateTime.Parse( Parameters!strDateTo.Value , New System.Globalization.CultureInfo("en-US")), "dd-MMM-yyyy")) This works perfectly in my preview tab. But when i deployed to the server and when viewed on IE, it gives me ...Show All
SQL Server crystal report compatability
The company that I am working for is looking to make the upgrade to 2005 from 2000, and we will need to continue to use crystal reports 8.5 until we have everything ported into the 2005 reporting services. Does sql server 2005 support crystal reports 8.5 Thanks ...Show All
Visual Basic Correctly exit application
Which is the right way of exiting an application by clicking on an exit button I used the following code but someone is complaining that my application hangs out when he clicks the exit button. Private Sub btnExit_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnExit.Click End End Sub >Interesting view :P Seeing as the keyword "END" appears in many languages and has been doing so for a long time =\ IMO that's the only reason it's still there. ...Show All
Internet Explorer Development Favicon in IE7
Hi My site uses a FAVICON, which works well in IE7. However, I've noticed that if you create a shortcut to a webpage on your XP desktop, the FAVICON is used as the desktop icon. My favicon.ico file has 2 res images of the file, 16x16 and 32x32. However, the desktop icon picks up the 16x16 version and uses that. Is there a way to make it use the 32x32 version. Or can I get windows to use a default icon. Thanks I have the same problem! Even worse. All the other icons of different webpages work on my Internet Explorer, only mine does not. I can copy and paste the line of other webpages in my html code and still no luck. My icon works well with Mozilla though. Does anyone know the reason ...Show All
Windows Forms Doubt about Event and Delegate in multithread context
Hi to all, I'm trying to understand well the paradigm of Event and Delegates, but I've some problem that I can't explain to myself. I've tried to write a little piece of code: in one class (the publisher) I declare a delegate and an public event, so someone can subscribe to it. In another class (the subscriber) I create an instance of the publisher class, and add its method to be executed when the event is raised. If I do this using a Windows Forms, when the event is raised up, I receive the message that I'm using Cross-Threading operation that is not a good think (I know how to disable the message, but is not what I want). I've tried to update the method signature so it can match with the EventHandler signature, but seems to not work; how ...Show All
Visual C++ How to do what I already have done in Visual C++ 6.0
I have gone through a book called 'Teach yourself Visual C++ 6.0 in 21 days'. Now I have Visual Studio 2005 C++ the Express edition and I see that much has changed. I really can't do what i did in version 6.0 because to much has changed. For example in 6.0 you had a wizard ctrl W and you attached and set a variable to a control and then called UpdateData() to use the control. But how do I do that now Or let me ask how can I in the best way learn to use Visual Studio 2005 so I can do the same things I already have learnt. I have searched the help and online system and find it very hard to know which resources to read and in which order Neither do I find any good book about basic Visual Studio 2005 The book says to look in the "Mes ...Show All
