Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. So if you add the msm through the add merge module option it doesn't give you anything in the properties window? Just tried it here and it worked first time - just expanded the top entry (MergeModuleProperties) and the option for a lisence key was there. Or are you adding it some other way - you also mention adding assemblies, which ones and how are you adding them (and why)?
  2. If you right click on the setup project in solution explorer and go to the add menu there should be an option for merge module.
  3. If you just want the time you are better using Date.Now.TimeOfDay rather than the legacy vb6 TimeValue function.
  4. For Each c As Control In Me.Controls If Not TypeOf c Is Button Then AddHandler DirectCast(c, Control).GotFocus, AddressOf control_GotFocus AddHandler DirectCast(c, Control).LostFocus, AddressOf control_LostFocus End If Next
  5. Closing the StreamWriter will also close it's underlying Stream - you will be getting the error when you try to seek on the underlying MemoryStream.
  6. You could dynamically wire up the event handlers in your form load event like... Private Sub control_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Dim c As Control = DirectCast(sender, Control) 'handle the lost focus here End Sub Private Sub control_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Dim c As Control = DirectCast(sender, Control) 'handle got focus here End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each c As Control In Me.Controls AddHandler DirectCast(c, Control).GotFocus, AddressOf control_GotFocus AddHandler DirectCast(c, Control).LostFocus, AddressOf control_LostFocus Next End Sub
  7. DateTime.Now should return the current system time.
  8. Did you try the suggestion I posted near the top of this thread?
  9. Depends on what you are wanting to do to the rows later. A dataset is an easy way to return the information but it can be quite large in memory. You may want to just populate an array or a collection with the relevant data and return that.
  10. Could you post the parts of your code where you actually call the routines to generate the keys? Are you generating the keys everytime or storing them somewhere in between executions?
  11. Catch ex as exception will catch all managed exceptions, if you are calling into unmanaged code (which you are) it is possible for non .net errors to occur. Try using either catch 'no exception specified or hooking the application domain's unhandledexception event Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf BadThingHappened End Sub Public Sub BadThingHappened(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs) 'see if it ever hits this block End Sub
  12. Could you post the code from the page - it makes it a lot easier for people to help if they have something to look at.... Also in your aspx page what <@ > tags have you got at the top of the page?
  13. What was the error logged into the system's event log? That can often highlight the problem if it is do do with the system configuration.
  14. Did you also rename the folder under IIS? If so you will need to make sure it is still configured as a virtual folder under the IIS MAnager.
  15. The internet is inherantly stateless, once the server has sent a page to the browser it no longer cares about the browser and the page is discarded. When you submit the page back to the server it has to recreate the page from fresh - including runnning all the page_init, page_load events before it will execute control events.
  16. If you bring up the project's properties there should be an option for Startup Object - make sure this is also set to the new form's name.
  17. The following should work (does assume the year will alway be four characters long though) Dim s As String = Date.Now.Year.ToString().Substring(3)
  18. Out of interest why would groupboxes not help in this case? It seems an awful lot of effort to mimic what the controls already do.
  19. Just cut and pasted your code into a new project and it ran fine here. Could you post some more of the calling code or is it just that one line?
  20. Rather than create a user control you could create a new class and inherit from the existing combobox. You would then need to override the relevant events. Not tested the following at all but it should give you the idea Public Class ReadOnlyComboBox Inherits ComboBox Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs) Text = "" End Sub End Class
  21. What is the exact error message you get when trying to run the applicarion?
  22. Just the way the data is presented, a combobox takes up less screen area until you select the drop down. Also combo boxes can allow you to type values not contained in the list itself but a listbox always restricts you to the values provided.
  23. As Mutant stated earlier assemblyinfo.cs provides standard ways of entering some of this information - if you fill in the attributes there this information will be accessable through code and also appear in the .exes propertypages in explorer. Also just as an aside if don't go the AssemblyInfo.cs route you may as well mark the strings that don't change as const to make them constants rather than variables. One thing you could do is mark the others readonly - this means you can assign values to them within the constructor but not modify them afterwards. i.e. public class soSystem { static soSystem() { //assign values to readonly values here ApplicationTitle= "Test"; //etc } // Properties public readonly static string ApplicationTitle = ""; public const string ApplicationVersion = "V"; public const string ApplicationCopyright = "Copyright © 2004"; public readonly static string LicenseUser = "Unknown User Name"; public readonly static string LicenseCompany = ""; public readonly static string LicenseSerialNumber = ""; } you would just have to use your own code to set the values. Personally I would use the assemblyinfo for those attributes that are not needing to be dynamically assigned (although possibly providing wrapper methods in your soSystem class to provide a single logical point of access)
  24. imgAbout.Image=this.Icon.ToBitmap(); should do the trick
  25. You would be much better of using parameters rather than concatenating strings - parameters are much easier and less prone to common exploits (Search for SQL Injection for an example). The following should work - not near vs at the moment so I haven't tested it. Dim mykeyword As String = txtKeyWord.Text Dim MySQL as string = "Select * from employees WHERE surname = ? Order by id_employee" Dim myConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & server.mappath("employees.mdb") & ";") Dim ds as DataSet=New DataSet() Dim Cmd as New OleDbDataAdapter(MySQL,MyConn) Cmd.Parameters(0) = myKeyword Cmd.Fill(ds,"employees") myDataGrid.Datasource=ds.Tables("employees").DefaultView myDataGrid.DataBind() MyConn.Close()
×
×
  • Create New...