Jump to content
Xtreme .Net Talk

mike55

Avatar/Signature
  • Posts

    734
  • Joined

  • Last visited

Everything posted by mike55

  1. Good morning all, We have a procedure that requires us to validate all input for text fields; if the input contains certain characters or key words, we must force the user to re-enter alternative data. Some of the characters that we look for at the start of sentances are: ' ; / > -- < admin @ declare = Some of the characters that we look for at the end of sentances are: one > The keywords that we look for are: @@ xss __ (double underscore) NULL varchar ‘’ (double single quote) ascii '; cursor exec (followed by space) -- char( src I have added the regular expression validator to my web page and have entered the following custom validator: The validator does not fire for any of my illegal characters, how can I set the above custom validator to "not equals"? I know that I can use the Regex.IsMatch function within the code, but thought that by using the regular expression control may be safer. Mike55.
  2. I am using a number of calendar extenders on a page. the layout that I am using is as follows: <div class="myDiv"> <label>Date Rescinded</label> <asp:TextBox ID="txtBNRescinded" runat="server" CssClass="FormItemStyle" ValidationGroup="view2" Width="90px"> </asp:TextBox> <asp:ImageButton ID="iBtnBNRescinded" runat="server" ImageUrl="~/Images/Calendar_scheduleHS.png" /> </div> The css that I am using is: .myDiv { text-align: left; } label { float: left; text-align: left; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 0.9em; font-style: normal; color: #000000; width: 17em; padding-left: 6px; padding-right: 6px; } p { text-align: left; height:2em; } When I click on the button, the calendar appears as per normal. However, when I go to select a date, the entire controls goes blank and then disappears. Any suggestions? I have tried to enclose the whole thing within a <p> tag. However, this only results in a javascript errors: "Object required". Mike55.
  3. Solution: Private Sub ReloadSelectionCriteria(ByVal userSelection As Hashtable, ByVal parent As Object) Dim myC() As Control For Each entry As DictionaryEntry In userSelection myC = parent.Controls.Find(entry.Key.ToString, True) CType(myC(0), ComboBox).SelectedIndex = entry.Value Next End Sub
  4. Fixed my initial problem: Private Sub ReloadSelectionCriteria(ByVal userSelection As Hashtable, ByVal parent As Object) Dim myC() As Control For Each entry As DictionaryEntry In userSelection myC = Controls.Find(entry.Key.ToString, True) CType(myC(0), ComboBox).SelectedIndex = entry.Value Next End Sub I now have an additional issue, the form that I am using is an instance of the parent form and both of them remain open on screen. When I cycle through the hashtable, the above code is simply looking at the parent form. How can I re-target it at the child form? Mike55.
  5. Hi I am using the following code: Private Sub ReloadSelectionCriteria(ByVal userSelection As Hashtable) For Each entry As DictionaryEntry In userSelection CType(Controls(entry.Key), ComboBox).SelectedItem = entry.Value Next End Sub to loop through all the keys in a hash table. All the keys are the names of a valid combobox displayed on screen. What I am trying to do is to reflect the values chosen on the comboboxes on the parent screen through to the child screen. However, with the above code I am getting a NullReferenceException. Any suggestions? I believe that the problem is that my code cannot find the control on the windows form. Mike55.
  6. 1. XMLWriterTraceListener 2. TextWriterTraceListener 3. DefaultWriterTraceListener Ok, I am going through the MCTS book for exam 70-536, I am currently looking at chapter 10, lesson 2 "Debugging and Tracing". The lesson talks about using Trace listeners and how they can be implemented using either code or in the .config file. I have a basic web application, so I have tried to implement the XMLWriterTraceListener in my web.config. I would intend to try out the other 2 listeners also. Now, to apply the changes to the config file only, the following changes need to be made: <system.diagnostics> <trace autoflush="true" indentsize="5"> <listeners> <add name="xyz" type="System.Diagnostics.XMLWriterTraceListener" initializeData="output.xml"/> <remove name="Default"/> </listeners> </trace> </system.diagnostics> The alternative approach is to do the following in code: Trace.Listeners.Clear() Trace.Listeners.Add(New XMLWriterTraceListener("C:\output.xml")) Trace.Autoflush = True Trace.WriteLine("This is a Test") None of the above two code segments worked for me in my web application, for the second code segment, I got an error message: "Listeners is not a member of System.Web.TraceContext". I then switched my two code segments to a sample windows application. The changes to the app.config coupled with the line: Trace.WriteLine("hello world...") did not appear to work. When I used the second code segment (having removed the changes from the config file), the tracing worked. Have I missed something with regards to the app.config file? Should the changes to the app.config file have worked in my web project? Mike55.
  7. Hi all I have a dateset whose contents can be changed by the user. Usually the user would click the save button when they are finished making the changes. However, if they forget to click on the save button, I want to simply offer them the opportunity to do so when the FormClosing event is fired. Here is my code so far: Private Sub frmGeneralQueries_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Select Case mintReport Case frmMain.mcTotalByOrganisation If Not dsPRTRDisplay.Tables("TotalByOrganisation").GetChanges.Rows.Count = 0 Then If MessageBox.Show("Your changes have not been saved. Do you want to Save them?", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Yes Then AllowSaveChanges() End If End If End Select End Sub The above code works in the event that there was a change that the user had not already save, however, I am getting problems if no changes exist. I know that I could use dataset.haschanges, however, there is no guarantee that the dataset in question would only have one table in it. Error message is: NullReferenceException - Object Reference not set to an instance of an object. Any suggestions? Mike55.
  8. Need the extra columns as they contain timestamp and audit details. One of the columns that I bring back is binded to DataGridViewComboBoxColumn that contains three values. When the value is changed, I need to timestamp it and record what user made the changes. The user can then hit a save button that transports the updated dataset to the backend and calls the dataadapter.update method thus updating the database.
  9. I am binding a dataset to a datagridview. My dataset returns about 7 different columns, of which I only want 3 to be visible. To enable me to hide the additional columns, I have added the following code: 'Organisation Name dCol.HeaderText = "Organisation Name" dCol.Name = "OrganisationName" dCol.DataPropertyName = "OrganisationName" dCol.ReadOnly = True dgvResults.Columns.Add(dCol) 'License Code dCol = New DataGridViewTextBoxColumn dCol.HeaderText = "License Code" dCol.Name = "LicenseCode" dCol.DataPropertyName = "LicenseCode" dCol.ReadOnly = True dgvResults.Columns.Add(dCol) 'Total Waste/Emissions dCol = New DataGridViewTextBoxColumn dCol.HeaderText = "Total Waste/Emissions" dCol.Name = "Total" dCol.DataPropertyName = "Total" dCol.ReadOnly = True dCol.Visible = false dgvResults.Columns.Add(dCol) I then have a refresh button that allows me to retrieve a new version of the data and automatically binds the data to the datagridview control. The problem is that some of the columns that I have specified as Visible=false are showing up. Any suggestions on how I can check if the column already exists or simply delete the column in question? Mike55.
  10. Hi I have a datagridview control on my form, into that grid I add a number of columns depending on the data I want to display. The majority of the columns are: DataGridViewTextBoxColumn, however there are a number of DataGridViewComboBoxColumn to be added. The DataGridViewComboBoxColumn will have 3 option: "Not Done", "Satisfactory", and "Not Satisfactory". I want to add an eventhandler that is fired when any of the cells in the column have there data changed by the user. My reasoning is that I must save the change to the database at some stage. Can anyone suggest what eventhandler I should be adding? Mike55.
  11. Application.EnableVisualStyles works for the majority of the control. Will play around with it and see how it works out. Mike55. Note: Just after finding the exact solution, go to the main project and look at its properties window. Under the application tab there is a checkbox "Enable Application Framework", this needs to be checked. Once checked, this will enable the "Windows Application Framework properties" which will allow you to check the checkbox "Enable XP visual styles". Mike55.
  12. I'd say both; for example when you view the converted windows form in the designer, buttons have that rounded effect/presentation and the default tab control has an xp type colour style. However, when I run the application, the buttons and tab control are presented as if they were still in .net framework 1.1. Mike55.
  13. Hi I have upgraded a windows application to .NET Framework 2.0. When I look in the designer the GUI Theme appears correctly, however, when I run the application the GUI Theme from .NET Framework 1.1 is used. Is there anyway I can have the 2.0 Framework used at all times? Mike55.
  14. I have the following SQL statement: SELECT tbMeasurement.MonitoredEntityCode, CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_1' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_1' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_2' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_2' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_3' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_3' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_4' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_4' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_5' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_5' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_6' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_6' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_7' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_7' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_8' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_8' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'EMISSION_POINT_9' THEN tbMeasurement.NumericResult END AS 'EMISSION_POINT_9' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'FUGITIVE_TOTAL' THEN tbMeasurement.NumericResult END AS 'FUGITIVE_TOTAL' ,CASE WHEN tbMeasurement.MonitoredLocationCode = 'ACCIDENTAL_TOTAL' THEN tbMeasurement.NumericResult END AS 'ACCIDENTAL TOTAL', tbMeasurement.SampleID, tbMeasurement.ParameterCode, tbParameter.ParameterDescription, tbMeasurementExtraData.M_C_E, tbMeasurementExtraData.MethodCode, tbMeasurementExtraData.Description FROM (tbMeasurement INNER JOIN tbParameter ON tbMeasurement.ParameterCode = tbParameter.ParameterCode) INNER JOIN tbMeasurementExtraData ON (tbMeasurement.ParameterCode = tbMeasurementExtraData.ParameterCode) AND (tbMeasurement.SampleID = tbMeasurementExtraData.SampleID) AND (tbMeasurement.MonitoredLocationCode = tbMeasurementExtraData.MonitoredLocationCode) AND (tbMeasurement.MonitoredEntityCode = tbMeasurementExtraData.MonitoredEntityCode) As you can see I as using a Case statement to create a new column for each type of emission point found and for Fugitive and Accidental Totals. What I am also trying to do is to replace the null values returned for Fugitive and Accidental Totals with a 0. I have tried using an inner case statement but that doesn't seem to work, any suggestions? I have also tried the replace statement, no effect. Mike55.
  15. Solved the problem, it would appear that I must register the name of the "CustomKey" rather than the Key name. Mike55.
  16. Allowed both of those accounts. I believe that what I am trying to do is not allowed by windows 2000 server. Trying to get access to a 2003 server and I am going to repeat the same steps and see from there. Mike55.
  17. Getting a Parser Error Message: Failed to decrypt using provider 'Rawhide'. Error message from the provider: The RSA key container could not be opened. Mike55.
  18. Thanks for the reply Nate. "Network Service" is only available from Windows 2003 server onwards. I also tried to register the account using the aspnet_regiis -ga "Network Service" command but got back an error message telling me that the account does not exist. Mike55.
  19. I am using a windows 2000 server on which I am deploying a simple web application with some of the web.config elements encrypted. I have generated a machine level key container using the following: Aspnet_regiis �pc �CustomKeys� �exp I have exported the key to my server using: Aspnet_regiis �px �CustomKeys� �C:\temp\CustomKeys.xml� �pri and Aspnet_regiis �pi �CustomKeys� �C:\temp\CustomKeys.xml� I have granted access to the Custom Key Store to the ASPNET account using: Aspnet_regiis �pa �CustomKeys� �ASPNET� However, when I try to do the same for the "NT Authority\Network Service" account I am prevented from doing so. Apparently "NT Authority\Network Service" does not exist for Windows 2000 server. What should I be using instead? Mike55.
  20. We will be performing a large ETL on a night basis starting in the next month or so. The job will collect data from a database in or main office, and then transfer that data to a hosted database server located in another part of the country. We have been assured by the infrastructure team that the network connection between both locations is secure and has been encrypted. Do I need to worry about encrypting the data transfered during the ETL, or is it even possible to do so? Mike55.
  21. I have two database servers, one is SQL Server 2000, the second is a SQL Server 2005 (Standard Edition). In the 2000 server, I have a database from which I need to take data on a regular basis and copy it to a particular database in 2005. In the tables that I am copying from I have a column titled "ETLStatus" which can either be NULL or 'T' where 'T' indicates transfered data. If a row is inserted or updated, the "ETLStatus" is set to NULL. I then run a select statement where the "ETLStatus IS NULL" and proceed to perform a SSIS Lookup operation on the 2005 database. If I find data during the lookup, I then perform an update operation on the 2005 database. If I don't find data during the lookup, I perform an insert operation. I have all my select, update and insert statements in a Sequence Contrainer, thus allowing me to do a Begin and Commit Transaction. One of the tables that I am processing has 250,000 records (give or take). The problem that I am having is that I seem to lose my connection with either the source or destination as I am performing the operation. In other cases I get the following error: "An OLE DB error has occurred. Error code: 0x80004005.". Any suggestions on how I could get over these problem. One option that has been suggested to me is to do a loop of 500 records at a time; not sure how practical this is...
  22. Hi all Working on a substantial web application at the moment. Give the large volumn of data being made available to customers via our web site we need to carry out a large amount of Stress, Soak and Load testing. Can anyone recommend some suitable tools, our application has been developed using SQL SERVER 2005 and Vb.NET (2005)? Mike55.
  23. Found the problem, for the control in question I need to give full permission to the user "Network Service". Mike55.
  24. Ok, I have checked the permissions on the folder, the only thing that I can see is wrong is that the read-only checkbox is ticked and greyed-out. I have tried to untick the checkbox but when I reopen the properties of the folder the checkbox is again ticked and greyed out. Mike55.
  25. I have an infragistics UltraChart and I am using the OS "Microsoft Windows Server 2003 Web Edition". The method that is being used with UltraChart is to create an image of the chart in a folder within the project every time the chart is requested and then the images is displayed on the screen. So far in testing and during developement the entire process worked as the OS used with "Microsoft Windows XP pro". Is there restriction with the Web Edition of Windows Server 2003 that would prevent me from writing files to the hard-drive with asp.net application? If so, can such restrictions be lifted, or bypassed? Mike55.
×
×
  • Create New...