PlausiblyDamp
Administrators-
Posts
7016 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by PlausiblyDamp
-
I don't remember anyone claiming this was a democracy, this is a site owned for commercial reasons by iNet Interactive, the day to day running however is left to the badged members (Expert, Leader etc.) Any badged member is effectively speaking for the forum as a whole by the simple fact they are the public face of the forum to the members. Bearing in mind this forum is accessed by people of all nationalities, genders and ages any member should carry himself with a certain amount of decorum and restrict their use of profanity - badged members more than anyone. I'm not disputing the quality of his code or the technical competence either - I've personally moved his posts to the Code Library section because of the quality and usefulness. However how would you feel if you personally were just starting out learning how to program (14 year olds and younger have posted here) - or that your son or daughter (for those of us who have them) was just learning and stumbled upon this forum, asked for help and got a response that basically says 'you are a moron for using vb'; or a simple request got hijacked into an anti-vb tirade, or responses came back littered with profanities (and attempts to work round the profanity filter) all condoned and performed by a 'Leader' of the forum - would you be encouraged to return and ask further questions? Would you feel this was something you wanted to contribute to? Badged members are in a position of responsibility to deal with offensive posts whether reported as such or just determined by us to be so - having such a 'responsible person' posting the messages themselves would hardly give a favourable impression... Surely a better way to further an on-line community is to encourage people to seek answers for themselves, provide help where possible and if you feel that an alternate method or language would be more suitable then there are ways of getting your point across that do not resort to insults and abuse.
-
Rather than writing to a file and then attempting to send the file to the client you could just write direct to Response.OutputStream, just continue to set the content type correctly and it should work fine.
-
Display Seconds (double) as HH:MM:SS (string?) [C#]
PlausiblyDamp replied to Shaitan00's topic in General
Bit rough and ready (plus I've hardcoded the return format which is generally a bad idea) but the following should give you a starting point... private string Test(int seconds) { TimeSpan ts = new TimeSpan(0,0,0, seconds, 0); int Hours = (int) ts.TotalHours; return string.Format("{0}:{1}:{2}", Hours,ts.Minutes, ts.Seconds); } -
Any chance of telling us what error it gives? .Net can throw several different errors any of which could indicate a different problem... I'm guessing you want the exit condition of the loop to be Do intCount += 1 Loop Until System.IO.File.Exists(Application.StartupPath & "Sidekick FilesImage ViewerScreenShot" & intcount & ".bmp") = False Also you might want to add Option Strict On to the top of your source files to catch more of these errors at compile time rather than runtime.
-
Values of textbox are not being saved in the following routine:
PlausiblyDamp replied to macupryk's topic in Windows Forms
What is TOverride in your above code and what data types are it's members? If you want to check for a null you may not need IsDBNull but rather compare to nothing e.g. if not Value is nothing then Also if you are using value types then they do not support the concept of nothing (null) anyway. -
Has this requirement been designed in by someone else or is it part of your design? If you are required to call an external function that takes one parameter could you not create a wrapper function that matches the many parameter delegate and then call the single parameter function from that?
-
It might help if you posted the relevant code from your application, it could be that you aren't closing connections down properly but are still opening new ones in their place. Normally you wouldn't expect a web application to exceed the default of a 100 connections even under some fairly heavy loads, 7500 seems excesive to say the least.
-
If you fail to remove an event handler then it simply means the event handler is fired when it wasn't required. If you remove the object the handler is attached to then there is no real consequence.
-
Could you not just use AddHandler to connect up the event handler at runtime?
-
When you said the previous code what exactly happens? If you step through the code in a debugger does it appear to loop till it no longer matches a filename?
-
The loop you are using to build the textbox contents in all of your button click handlers is adding an extra vbCrLF, this is causing the extra array element when you are doing the split.
-
Is there any reason you couldn't just use a single delegate for this? Just because the delegate has 1 or more parameters doesn't mean the handler at runtime needs to use the parameters. Could you either attach a simplified example of why this is needed or expand on the idea of why a single delegate wouldn't be suitable. Depending on how the problem is approached you may not need two functions entirely copied - possible a couple of overloads that call into a single core function may do the trick.
-
Dataset not defined Error WHat do I refference?
PlausiblyDamp replied to vbMarkO's topic in Database / XML / Reporting
System.Data.DataSet provided you have a reference to System.Data.dll -
Could you explain a bit more about why you need to do things this way? The whole purpose of a delegate is to enforce type safety when using callbacks etc. Allowing different types of delegate to be passed in violates this idea.
-
It would be a lot easier if you posted a more complete code sample like Nerseus suggested earlier. I would definately argue against all the suggestions to use shared / module level variables as a way to pass information between forms.
-
Rather than CurDir use Environment.CurrentDirectory. Also if you are using .Net 1.1 it provides a folder browser dialog you could use to get the folder rather than an open file dialog. You could just use System.IO.Directory.GetFiles() to return an array of files in the folder and simply loop through the array when next is clicked.
-
Not had chance to test if it works but you could explicitly implement the interface using System; using System.Collections; public class StringEnumerator : IEnumerator { //Fields private IEnumerator innerenum; //Properties public string Current { get {return this.innerenum.Current.ToString();} } //Constructors public StringEnumerator(IEnumerator enumerator) { this.innerenum = enumerator; } //Public methods public bool MoveNext() { return this.innerenum.MoveNext(); } public void Reset() { this.innerenum.Reset(); } object IEnumerator.Current { get { // TODO: Add StringEnumerator.Current getter implementation return null; } } }
-
Something like Dim intcount as integer Dim path As String & intCount & ".bmp" Do intCount+=1 path = Application.StartupPath & "Sidekick FilesImage ViewerScreenShot" Until System.IO.File.Exists = false not tested it (don't have VS on this pc) but the general idea should work
-
You will find that your Main method is probably marked as static (the equivalent of shared in VB) - that means it cannot access any instance members from the class. You are probably better of treating your Main routine as a a kind of bootstrapper to your program - give the clsCore class a method that is your real startup logic and in the Main create an instance of clsCore and call this method.
-
Which line are you getting the error on? Also how and where is clsOptions declared?
-
DB conn problem after several clicks
PlausiblyDamp replied to daniel2milan's topic in Database / XML / Reporting
In your FillTextBox method you aren't closing your reader if things work only on failures (the close / dispose stuff is in the Catch block). You need to make sure the connection etc. is closed regardless. Try the following in place of your try / catch block. Try Do While MyDataReader.Read txtID.Text = (MyDataReader.Item(0)) txtpass.Text = (MyDataReader.Item(1)) txtnama.Text = (MyDataReader.Item(2)) txtadd.Text = (MyDataReader.Item(3)) txtjab.Text = (MyDataReader.Item(4)) txttgl.Text = (MyDataReader.Item(5)) txtno.Text = (MyDataReader.Item(6)) Loop 'StatusBar1.Text = " Record " & TxtId.Text & " selected" Catch err As System.Exception ' StatusBar1.Text = " Selected Record Contains Null String" Finally If Not MyDataReader Is Nothing Then MyDataReader.Close() End If If Not OleDbConn Is Nothing Then OleDbConn.Close() OleDbConn.Dispose() End If End Try You probably also want to do something similar in your FillDataGrid method just in case any errors occur. -
A property is really designed to encapsulate or mimic a simple member variable of the class or structure; part of this means there should be no unexpected side effects when assigning or retrieving a value via a property - passing by reference would break this rule. It may help if you gave a bit more detail about what you are trying to do and see if anyone has an alternate suggestion.
-
Does the remote server have IIS and the .Net framework installed? IIRC it will also require Front Page extensions installed. Also you will need to have the required permissions to create and debug projects on the remote server as well.
-
ASP.Net do have the concept of application level variables which are shared between all connections. Not too sure what you mean by Web applications are fundamentally different to windows applications though and even though you can store information in this manner you need to consider performance / memory / concurrency issues as well.
-
wild cards as such are not directly supported by the .Net string handling routines. If you just want to check if a string ends with a particular value you can always just call the .EndsWith(...) method of the string variable. For more complex string matching you will probably want to investigate regular expresions as a more powerful tool.