PlausiblyDamp
Administrators-
Posts
7016 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by PlausiblyDamp
-
Probably because nobody has mentionwed it before ;) If there is enough interest in one then one can be created.
-
The results being displayed in a new window is just how the test page does things - it isn't affecting how the results are returned when the web service is running normally. Where is the xml file the web service is handling hosted (same server? what folder? what permissions on folder?). What information are you passing to the service that could be used to identify the file in question? Without seeing any code or without further information though everything is just speculation...
-
Is images off the root folder? If so you should be able to use a path of "~/images/blue.gif" as an example.
-
Re: Generic EventArgs Assume the following sample has two custom event args that are actually useful, the only way to create the events is to declare two delegates and use these in the event declarations... public partial class Form1 : Form { public delegate void TestEventHandlerOne(object sender, SampleEventArgs e); public delegate void TestEventHandlerTwo(object sender, AnotherSampleEventArgs e); public event TestEventHandlerOne TestOne; public event TestEventHandlerTwo TestTwo; public Form1() { InitializeComponent(); } } public class SampleEventArgs : EventArgs {} public class AnotherSampleEventArgs : EventArgs { } The generic EventHandler however gives the slightly cleaner... public partial class Form1 : Form { public event EventHandler TestOne; public event EventHandler TestTwo; public Form1() { InitializeComponent(); } } public class SampleEventArgs : EventArgs {} public class AnotherSampleEventArgs : EventArgs { }
-
Collections are one of the main use of generics, however they can also be useful for utility functions. If you wanted to do a simple Min or Max kind of function for example generics can be useful... static class Utils { public static T Max(T a, T b) where T : IComparable { return (a.CompareTo(b) > 1 ? a : b); } } This can be called like string s1 = "Test", s2 = "Example"; string s = Utils.Max(s1, s2); int i1 = 3434, i2 = 3322342; int i = Utils.Max(i1, i2); but only when a valid comparison exists, otherwise a compile time error is generated.
-
Was there anything in the config file that could have caused this?
-
You get the feeling he might be trying to get us to do his homework for him? ;)
-
Explorer Integration: How to add a Virtual Folder?
PlausiblyDamp replied to Arokh's topic in General
http://msdn.microsoft.com/en-us/library/cc147467(VS.85).aspx gives the scarey details. You are going to have to get dirty with COM by the look of things. -
Compress entire folder and subfolders
PlausiblyDamp replied to kcwallace's topic in Directory / File IO / Registry
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx has a free compression library that will do zip / gzip / tar archives - effectively you could create a zip file or similar from a folder. -
Re: goodbye binary? You forgot to mention http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx if any concept deserves to be recorded in history that one does. The big problem is that the real world is often arbitrary and vague while computers like things to be precise and well defined ;) http://en.wikipedia.org/wiki/Floating_point and http://en.wikipedia.org/wiki/Fixed-point_arithmetic give some useful background reading on the problems etc.
-
Depends on the version you are using for .Net you could do something like Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim customers As New List(Of Customer) customers.Add(New Customer(1, "test")) customers.Add(New Customer(2, "Another test")) customers.Add(New Customer(3, "test again")) customers.Add(New Customer(4, "testing")) customers.Add(New Customer(5, "final test")) Dim results As List(Of Customer) = customers.FindAll(AddressOf BeginsWithT) For Each c1 As Customer In results Debug.WriteLine(c1.Name) Next End Sub Private Shared Function BeginsWithT(ByVal c As Customer) As Boolean Return c.Name.StartsWith("t") End Function End Class Public Class Customer Public Sub New(ByVal id As Integer, ByVal name As String) _Id = id _Name = name End Sub Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Private _Id As Integer Public Property NewProperty() As Integer Get Return _Id End Get Set(ByVal value As Integer) _Id = value End Set End Property End Class The above (contrived) example fills a list with a custom class and then uses a predicate filter (The beginswitht method) to return a filtered list of results. If you are using .Net 3 or later then Linq could also be used Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim customers As New List(Of Customer) customers.Add(New Customer(1, "test")) customers.Add(New Customer(2, "Another test")) customers.Add(New Customer(3, "test again")) customers.Add(New Customer(4, "testing")) customers.Add(New Customer(5, "final test")) ' Dim results As List(Of Customer) = customers.FindAll(AddressOf BeginsWithT) Dim results = From c In customers Where c.Name.StartsWith("t") Select c For Each c1 As Customer In results Debug.WriteLine(c1.Name) Next End Sub End Class Public Class Customer Public Sub New(ByVal id As Integer, ByVal name As String) _Id = id _Name = name End Sub Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Private _Id As Integer Public Property NewProperty() As Integer Get Return _Id End Get Set(ByVal value As Integer) _Id = value End Set End Property End Class
-
You could potentially use a dataview - that may save repeated database calls.
-
convert 'String' to 'System.Collections.ICollection'
PlausiblyDamp replied to SIMIN's topic in General
You could just pass ListTextBoxX.Lines rather than .Text to the method. -
Nothing to do with your English - more to me not reading the question properly ;) When you are doing the update try Dim cmdVoti As OdbcCommand SQL = "UPDATE Voti SET Voti = " & votiToAdd & " WHERE Codice = " & CLng(lvi.SubItems(4).Text) cmdVoti = New OdbcCommand(SQL, dbAccr) cmdVoti.ExecuteNonQuery()
-
Failed SQL Connection over time
PlausiblyDamp replied to joe_pool_is's topic in Database / XML / Reporting
Sounds odd! Have you tried disabling connection pooling (add a Pooling=false to your connection string) - just in case something is happening there that is keeping broken connections around? -
If you try passing in PictureBox1.Handle.ToInt32 instead does that make a difference?
-
If you step through the code are the actual variables and the MDIParent properties all being set to valid values?
-
I would try stepping through your original code to check it is doing the same things as the attached sample.
-
Is this happening all the time or just if a certain theme is enabled (Aero for example)
-
How long is it taking to serialize the data? Is this a similar amount of time compared to deserializing the data? In your data class what are you storing in the dictionary - object can incur overheads in terms of run time casting etc.
-
The version class has a CompareTo method you could use. However http://www.codeproject.com/KB/system/osversion.aspx might be worth a look as somebody else has done all the hard work ;)
-
Could you not have the UpdateCommand also select the new information back?
-
Failed SQL Connection over time
PlausiblyDamp replied to joe_pool_is's topic in Database / XML / Reporting
http://support.microsoft.com/kb/811889 has some useful information on possible causes of this error - does it make any sense in your case? Is the sql server being rebooted or similar in-between the client succeeding and failing to get a valid connection? -
What is the value of MainForm when you are running the above code? Would it be possible for you to attach a very simple project that shows this problem?
-
If a non-administrator runs your application what happens when they run the application and then attempt to save something to the windows directory? Does the Vista UAC prompt appear when the app is first run? Is this application specifically intended for editing or creating things in the windows folder?