Thanks Eddy!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Thanks Eddy!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Hey Eddy, If all columns have defaulted values, wouldn't simply pressing tab on that row cause the new (blank) row to be added below? Why would a combo need to be selected or a text field need to go into edit mode to force the new row? I tried to force a cell into edit mode after defaultvaluesneeded, but it causes a re-entrant condition, so the users is forced to do this. Not a huge deal, but am a little confused when all the values are present.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
The bright side - it's Friday :) I have a datagridview that is databound with a bindingsource to a strongly typed dataset. There are 5 columns: 2 text fields, 2 combos (that have a datarelation to child tables) and a checkbox. If I click to add a new row and manually type\select values - every thing works as expected. Meaning, as I am filling in data, there is another blank row below that is added. To help streamline data entry, I want to specify default values for the fields. If I attempt to default values via dgv_DefaultValuesNeeded or the bs.AddingNew: All the default values are displayed correctly - but a new blank row isn't added to the end of the datagridview. The last visible row (has all values defaulted correctly) but there isn't a blank line below? If I double click a combobox (don't even change the value - just double click it) or click the checkbox, then the change is reflected properly to the bindingsource and a new black line is added below? I'm not sure what is going on. The comboboxes are set properly because the DisplayMember values are correct. If I click a previous row (without clicking the checkbox or selecting a combobox) the new row is removed as well - which makes it seem like it's not actually being added to the bindingsource during the AddingNew event. Very stumped on this. Curious if anyone else has run into this. Probably missing something overly simple.
Private Sub bsPlantLocSub_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles bsPlantLocSub.AddingNew
Dim strTemp As String = GetNewDefaultValue_LabelPrefix()
dsLocSetup.DataTable\_PlantLocSub.PlantLocationIDColumn.DefaultValue = \_Default\_PlantLocID
dsLocSetup.DataTable\_PlantLocSub.LabelPrefixColumn.DefaultValue = strTemp
dsLocSetup.DataTable\_PlantLocSub.LocationSubColumn.DefaultValue = "Location:" & Strings.Right(strTemp, 4)
dsLocSetup.DataTable\_PlantLocSub.ComponentStatusColumn.DefaultValue = "IC"
dsLocSetup.DataTable\_PlantLocSub.SysLocOnlyColumn.DefaultValue = False
bsPlantLocSub.MoveLast()
End Sub
I had also tried this in the bs.AddingNew - same behavior as listed above.
Dim dv As DataView = TryCast(bsPlantLocSub.List, DataView)
Dim drv As DataRowView = dv.AddNew
Dim strTemp As String = GetNewDefaultValue\_LabelPrefix()
drv("PlantLocationID") = \_Default\_PlantLocID
drv("LabelPrefix") = strTemp
drv("LocationSub") = "Location:" & St
I'm trying to debug whether or not a SSRS app is leaving open sql connections. I wrote a test app that uses a custom SSRS reporting object (written in VB.net) that calls reports in a loop. Each time the reporting object is destroyed and recreated. The server is 2008 R2 and the SQL server is 2008 R2. I have Performance Monitor open on the server with the following counters added in: ReportServer:Service - Active Connections SQLServer:General Statistics - User Connections SSRS.ActiveConnections is displaying 97 current connections. SQL.UserConnections is displaying 38 current connections. If I open Management Studio and use the Activity Monitor, selecting all databases - there are exactly 38 connections. If I run sp_who2 and remove the lines that are for the master DB and sa account, there are again 38 connections (prior 64) I'm very confused on the different #s being reported in the counters. Can anyone shed light into this? Is the ReportServer:Service - Active Connections actual DB connections or connections to the service? Should the SQL.UserConnections include SSRS report connections?
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
I tried your suggestion but was unsuccessful.
Process.Start("C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe", """" & "C:\Program Files\CompanyApp\System\dbDAL.dll" & _
"""" & " /codebase", "AdminAcct", pw, "Domain")
The exit code = 100. Nothing errors off, but the assembly isn't registered correctly and can't be instantiated. If I run the SDK command prompt in adminstrative mode and run the same command and arguments, then the object and be instantiated correctly. Despite specifying the admin account, UAC appears to be blocking the registering. Sigh.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Vista\Win7 - Is it possible to shell and specify an account to run the process under? Scenario: our company has a program that is a launcher app (kinda like a fancy version of click-once). Based on the arguements passed in, it determines what program the user is trying to run and what files need to be updated (controls, .dlls, etc), pulls them down from a shared directory and registers them (regsvr32 or regasm). After that process is done, the program that was requested is launched via shellex. In Vista and Win7 the regsvr32 and regasm functionality is broken because of UAC. The user has admin rights to only 1 folder in the Program Files directory (that is the location where the .dlls, etc are pulled down to). Is there a way to perform a shell (so that regsvr32 can be run) using a admin account (specifying user and password in code)?
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Sounds like a plan. Thanks!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Is it possible to copy a file to a destination that includes a shortcut link in the path? For example, below the \Staged\ is actually Staged.LNK that points to a diff. server. I normally would use the UNC path but am being asked to do this specifically. User has full rights on the directory as well. 'Statement fails. System.IO.File.Copy("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml") 'If I add-in Staged.LNK, the statement fails, without .LNK, VB creates an actual folder called Staged and copies the file into that folder vs. using the shortcut path (to a diff. server). My.Computer.FileSystem.CopyFile("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml")
Thanks for any help or comments.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Outstanding. Thanks for the clear explanation and example.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Could someone explain how to properly use the .contains and .find methods on generic list? For example, I created a list(of reportparameter) below and fill it with some dummy test values. I can't get either the .contains or find methods to work.
Dim params As New List(Of Microsoft.Reporting.WinForms.ReportParameter)
params.Add(New Microsoft.Reporting.WinForms.ReportParameter("Param1", "ParamValue1", False))
params.Add(New Microsoft.Reporting.WinForms.ReportParameter("Param2", "ParamValue2", False))
params.Add(New Microsoft.Reporting.WinForms.ReportParameter("Param3", "ParamValue3", False))
'Compiles, but never returns true. Is it correct to create a new param to execute .contains?
If params.Contains(New Microsoft.Reporting.WinForms.ReportParameter("Param1")) Then
Debug.Print("")
End If
'This doesn't compile, not sure of the correct way to perform a find
If params.Find(New Microsoft.Reporting.WinForms.ReportParameter("Param1")) Then
Debug.Print("")
End If
Sorry if this is a dumb question - having a blonde moment today.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Hey Dave, Saw your post Friday but forgot to reply. Yeah, I had tried ACT Friday, but didn't have much luck with it for this particular app. Thanks for the response though.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Our company is attempting to roll out Windows 7 (SP1) to new client boxes. There is one very large app that is causing the UAC box to pop up asking for administrative rights. Is there a utility or way to determine what section of code is triggering the UAC to popup? The application is very large and it would be nice to narrow down what area is requiring elevated rights. Thanks for any pointers or guidance ahead of time.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
I have that being done already (load and form_closing), but I wanted to cover the scenario in which a developer stopped the app via stop debugging button and immediately shuts VS after that. No biggie, I'll just make it known. Kinda a special case scenario.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Thanks for the answers, just wanted to make sure I wasn't overlooking something. It would be nice to have a post debug (like the pre/post build events) events, but how often would you really use them. Really hate to rely on devs. having to run a bat file or something else, because it's only human to error, but that's the only real option here. Thanks again.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Hey Luc, I'm familiar with the Debugger.IsAttached because I have some debug.print statements that occur during various routines. I'm feeling rather blonde today. I created a new WinForm app from scratch in VS2010. Stuck this code in
Private Sub Form1\_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
MessageBox.Show("Look ma, I'm closing")
End Sub
If I start the app and close it with the X in the caption bar, woot! If I start the app and close it with the Stop Debugging button in VS on the debugging toolbar, it's just not called? Am I totally overlooking something?
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Closing is not called. When stopping the app with the "Stop Debugging" button in Visual Studio (take your flavor, 2005 or 2010) instead of closing the app through the form, the dispose, finalize and Form_closing events are bypassed. You can verify this by putting breakpoints on each and seeing if your app stops there.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Is it possible to tell when a WinForm app is being closed from Visual Studio when a developer uses the "Stop Debugging" button? I'd like to perform some file cleanup, etc whenever the app shuts down, but when the app is closed from VS itself vs. the close button the form, the closing, dispose, etc is not called. Just wondering if someone has run into this and what they may have done. Thanks for any suggestions or comments.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Agreed with the comments above. Just wanted to get a feel for if I was way off base.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
There is a debate going on at work right now. Basically we are going to be creating some new tier objects; for the sake of simplicity, just assume basic stuff like a business tier, data tier, etc). The business tier will have objects like a Orders object (that will return order info) a customer object (that will return customers), etc, etc. Is it typical for someone to want to create tier objects as an executable vs. using .dlls? What would be the pros to using an executable in a tier instead of a .dll? Also, can you pass back collections, datasets, etc from an .exe to another .exe? Admittedly, I've never tried. The proposed architecture: Client.exe would call a tierobject.exe would call a datalayer.dll I can think of many reasons why I would think doing this would be a bad idea, but I am also trying to remain open-minded. Thanks for any insights to the gurus out here.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Was my question clear enough or can this not be done? Not a critical question, just curious if it could be done.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison