|
It would seem if I want to update a record I will have to do it with a custom sql command for each record I want to update. As there is no key fields in the excel table I have no idea how to specify and update command either. I guess that is why the command builder couldn't come up with anything. I thought about deleting all the records in the excel database and writing back all the modified records from the datatable but then I read that the jet engine would not allow me to delete records from an excel db so I didn't even bother to try. My only choice now as far as I can see is remote control of excel or building another excel table and adding the records to that. I do not wish to do remote control of excel. It all would have been so much easier if I could have stayed connected to the excel spreadsheet read the record looked up the necessary data and written changes to the records then done a skip to get the next record and repeat.
|
|
|
|
|
hi
I lost my source code which was on my thumd drive now is it possible to get the source code from the exe file which is only pcs left from my project on my desktop. If so can someone please help
Thank you
steve Haris
|
|
|
|
|
You can NOT retrieve the source code from a Visual Basic 6 application, because it is converted into machine language (unlike .NET EXE which is reversable since it is interpreted by the CLR). The most you can get out of a VB 6 application is what they call a semi-decompile, which is the actual form elements (like textbox, combo, etc) using an application such as this one:
http://www.decompiler-vb.net/[^]
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
if I had an app which was developed in vb.net and does similar function would i be able to get the source code out of it like actuall function etc.... I was able to get the funtions name and stuff but not the way the function was written ??
if so could you please shade some light in how to archive that goal
thanks
|
|
|
|
|
S.Haris wrote: if I had an app which was developed in vb.net and does similar function would i be able to get the source code out of it like actuall function etc.... I was able to get the funtions name and stuff but not the way the function was written ??
if so could you please shade some light in how to archive that goal
thanks
Hi,
Assuming that the .NET application has not been Obfuscated, you can get all the code, including functions, classes and form elements (100% of the code) back. One of my favorite .NET decompilers is Dis#, which will can give you back C# or VB.NET code out of .NET exe or dll (depending on which one you choose). It can be downloaded here:
http://www.netdecompiler.com/[^]
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
as far as i know i dont think its been Obfuscated but on second hand how could i bee sure thats it has not been is there any way to tell
if so can you please shade some light I I dont mean to be a compelet Leacher... Sorry If I am being one...
|
|
|
|
|
S.Haris wrote: as far as i know i dont think its been Obfuscated but on second hand how could i bee sure thats it has not been is there any way to tell
Download the trial version of Dis# software and try to open it. If it opens it without a problem it means its not Obfuscated.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
You could always try using the suggested tool and see if it successfully completes and produces usable code..
Michael Davey
|
|
|
|
|
Apologies.. didn't see that the conversation had gone over the page!
Michael Davey
|
|
|
|
|
DigiOz Multimedia wrote: Assuming that the .NET application has not been Obfuscated, you can get all the code, including functions, classes and form elements (100% of the code) back.
Does that include comments and #ifdef'ed out sections? What reason exists for throwing all the source code into an executable? What purpose does it serve?
|
|
|
|
|
supercat9 wrote: Does that include comments and #ifdef'ed out sections?
You get the equivalent of the original code back. I don't believe you can get the comments back though, because the CLR just ignores those. Not sure about #ifdef.
supercat9 wrote: What reason exists for throwing all the source code into an executable? What purpose does it serve?
You don't throw the source code into the executable, the source code is used to compile the executable.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi,
in general a decompiler returns a synthetic source code that, when compiled again,
results in the same EXE/DLL. It will not include parts the compiler did not need,
such as comments, code snippets ignored by preprocessing, redundant statements, etc.
And it will not necesserally look like the original:
- variable names may be fictitious (local variable names typically are not present in EXE);
- program flow control may look different (for, while, ...) but will be equivalent
- the optimization may have moved lines around;
etc.
A .NET decompile will resemble the original much closer, since there is a lot of metadata
in the assemblies; decompiling a debug build may look very similar to the original,
except for the comments. In fact, compile then decompile is one way to translate a
source file to another programming language (e.g. VB.NET to C#), again loosing comments.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
A .NET decompile will resemble the original much closer, since there is a lot of metadata
in the assemblies; decompiling a debug build may look very similar to the original,
except for the comments.
Okay, that makes sense. So it's not really storing the source--just enough information to figure out what the code is up to, plus (if debug information is enabled) a full symbol table.
BTW, why did compilers get in the habit of throwing debug information into a .EXE file? When debugging one could just as easily have the information in another file, and when not debugging it's not only useless bloat but it may also undermine any secrets stored within the application.
|
|
|
|
|
supercat9 wrote: why did compilers get in the habit of throwing debug information into a .EXE file? When debugging one could just as easily have the information in another file, and when not debugging it's not only useless bloat but it may also undermine any secrets stored within the application.
A lot of development systems (such as Visual Studio) give you a choice (Debug/Release,
several switches) about the amount of debug info in an EXE/DLL. They typically use extra
files (.PDB) for symbol definitions, and only use source files for showing the current file/function/line. Needing/wanting all these files is fine on the development machine,
it is troublesome on other machines where early testing shows some problems (files missing,
files out of sync, ...).
In .NET more info must be present in the EXE/DLL because of reflection: by default one can
interrogate an assembly as to what classes, fields, methods it is holding. Obfuscating
hides that information and would disable reflection, except for the names that are specially
flagged for this purpose.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
sample code from intro to vb using .net (dana l.wyatt)
is as follows
********************************
Private Sub btnShowAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowAll.Click
If lstAnimals.SelectedItems.Count < 1 Then
Exit Sub
End If
Dim s As String
Dim index As Integer
s = lstAnimals.SelectedItems.Item(0)
For index = 1 To lstAnimals.SelectedItems.Count - 1
s &= ", " & lstAnimals.SelectedItems.Item(index)
Next
MessageBox.Show(s, "Selected Animals")
End Sub
***************************
and it works
but in my program it doesnt
I have to add .ToString to avoid
Cast from type 'DataRowView' to type 'String' is not valid.
but then it prints "System.Data.DataRowView" instead of the value member I need
**************************************
my code
If ListBox1.SelectedItems.Count < 1 Then
Exit Sub
End If
Dim s As String
Dim index As Integer
s = ListBox1.SelectedItems.Item(0).ToString
For index = 1 To ListBox1.SelectedItems.Count - 1
Console.WriteLine(ListBox1.SelectedItems.Item(index).ToString)
Next
MessageBox.Show(s, "Selected Animals")
any assistance would be greatly appreciated
also get invalid cast when try this
Private Sub btnShowAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowAll.Click
Dim s As String = ""
For index As Integer = 0 To lstAnimals.SelectedItems.Count - 1
Dim drv As DataRowView = CType(lstAnimals.SelectedItem(index), DataRowView)
s &= drv.Item("name or index of field") & ControlChars.CrLf
Next
MessageBox.Show(s, "Selected Animals")
End Sub
|
|
|
|
|
I am using VB6 and am trying to copy the text from a form to the windows clipboard and paste it into another program (ie MSWord)
In my program I have a button, when clicked it runs, pulls the data of my
Clipbpard.SetText COPY_MY_DATA.TEXT
this appears to copy the text in the COPY_MY_DATA field. If I ctrl-v to another field with in my program I can past the data.
But
If I alt-tab to word and ctrl-v I get something totaly differant
How do I updated the windows clipboard so I can paste to any application?
|
|
|
|
|
Have you solved this problem?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Yes thanks
Im my form I fill in my "CopyThisData" multiline text box.
Then I have a button that runs:
Clipboard.Clear
Clipboard.SetText CopyThisData.Text
When I Alt-Tab to MSWord and Ctrl-p I get the text that was copied.
Though, some times when I paste into word I dont get anything so I need to click the "Copy" button in my program again
|
|
|
|
|
If proper use of an object requires explicit disposal any time it's going out of scope, is there any way to have the system make a note of times this fails to occur, in such a way as to provide useful information about the stranded object? My understanding is that the finalize method is not supposed to do anything with any sort of managed object, so logging would seem to be difficult.
Also, is there any practical way to discover if the 'primary' reference to an item becomes stranded, even though secondary references exist? For example, suppose I have a class that's supposed to fire an event in response to something else occurring. When an instance is created, it sets a pointer to itself in some other object that will know about the occurrence. Even if the primary reference to that instance goes away (which would cause any event therein to fail) the other object would still point to it. Is there any good way to detect this condition and flag it?
|
|
|
|
|
I have a suggestion that touches your second topic: the WeakReference Class allows you
to hold a reference somewhere (say in a ArrayList/List) to items without keeping the gc
from collecting them. its IsAlive property will tell you the actual object status.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks. I just did a search on "weakReference" and found a very helpful article on this web site (knowing the right words to search for helps a lot).
http://www.codeproject.com/dotnet/garbagecollection.asp
I'm still not sure the best way to log objects which get finalized before being disposed. I would guess that it should be possible to use some static variables to report that such things happen; perhaps that would be a good place to start.
|
|
|
|
|
Hi, adding a finalizer for the purpose of logging would disrupt the normal operation of the
memory management too much (objects with finalizer are handled differently, their disposal
is more expensive). So what I do occasionally is keep a list of "important" objects
using weak references, then periodically check what's Alive in the list.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hmm... that actually sounds like that might be a better approach anyway. If my pool of objects contains weak references to the objects in question, then any time it discovers that an object in the pool has been deleted it could log an event and do a cleanup. The object itself would have a tight reference to the pool, but that shouldn't be an issue. Thanks for the suggestion.
|
|
|
|
|
-1- Is there any way to find out if data is available from a stream other than by trying to read it and getting a timeout exception? The stream will most likely be the basestream of a socket or serial port.
-2- If not, is there any way to stop the timeout exceptions from filling up the immediate window?
-3- What is the best way to set up a buffer stream for simultaneous non-seek reading and writing? When I go to output data to a stream, I'd like to at that time read the data from the stream and store it into a log file and into a buffer stream so that the it can be read at leisure. I just coded a rather clunky class to do that, but that's probably the wrong approach.
-4- If I want to make incoming data available to multiple handlers, some of which will want events when it comes in and some of which would be happier with input streams, what's the right approach?
|
|
|
|
|
I dont understand much about what you are trying to do, but have used a StreamReader to input from files. I use the .Peek command to tell if there is data before reading, as follows ..
Dim sr as New System.IO.StreamReader(txtFileName)
While sr.Peek <> -1
txtRecord = sr.ReadLine
End While
Sorry if this is irrelevant. I am a relative newbie
|
|
|
|