|
GuyThiebaut wrote: and examples of strong commercial applications that have been written in VB .NET.
As VB.NET code is not secure ( your end users can read it ), a better question would be 'how many web sites use ASP.NET', and 'how many contractors use .NET to write code for specific end users' ?
Note I said '.NET' and not 'C#'. In truth, VB is a nasty little language, but if you understand it, your apps are going to do the same stuff a C# app can do, so there's no real reason to move to C#, if you're comfortable with VB syntax.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I just knew you were going to chime in on this one!
Christian Graus wrote: As VB.NET code is not secure ( your end users can read it ),
Bunch of crap! Of course it's secure, 'cause noone WANTS to read it! Once someone sees it, they say "This can't be a serious app worth my time..."
It's kind of like the great PC/Mac debate. One side thinks the other size sucks. To me, I still get paid by the hour, no matter which language I use.
|
|
|
|
|
In VB6, the underscore is always visible for the hot-key when you use an & in a label. In dotnet, you need to press the alt-key to see the underscore. Any way to override that so the underscore is always visible?
|
|
|
|
|
No. This is a system setting that has nothing to do with your code.
RIght-click the Desktop and pick Properties. Depending on which version of Windows you have, click on the Effects tab (2000) or Appearance tab (WinXP). If XP, click on the Effects button. You're looking for something like "Hide underlined letters for keyboard navigation until I press the Alt key."
No, you can't override it in your app.
|
|
|
|
|
|
Hi,
I'm trying to update the values in a DataGridView. It works ok, and I can see my rows and columns being updated, but when I scroll down the grid, and hit the bottom, it throws an "object not set to an instance of an object" error - and the space occupied by the grid changes to a red cross.
I'm obviously doing something wrong, and have narrowed the problem down to this bit of code:
Dim gridrow As DataRowView<br />
<br />
Dim intItemFoundOnRow As Integer = bindingDataGridView2.Find("File Name", strSearch)<br />
<br />
If intItemFoundOnRow <> -1 Then<br />
<br />
gridrow = bindingDataGridView2.Item(intItemFoundOnRow)<br />
<br />
gridrow.BeginEdit()<br />
<br />
gridrow.Item("Columns in Database") = CountColumnsInTable(strTableName)<br />
<br />
gridrow.EndEdit()<br />
<br />
End If
It isn't anything to do with the CountColumnsInTable function, because I can replace this line with:
gridrow.Item("Columns in Database") = 9999
... and it makes no difference. I threw in .BeginEdit and .EndEdit in an attempt to get it to work, but these lines may as well not be there.
|
|
|
|
|
Just an idea - is there any chance that you are trying to read past the end of the object bound to the datagrid.
In some cases the first record in an object is 1 and in some cases it is 0 (I can't remember what is is in the case of a datagrid)
I could be way off track here.
You always pass failure on the way to success.
|
|
|
|
|
Thanks for your thoughts.
I managed to fix it. The problem was that I had created a sorted DataView, and populated the DataGridView with it - which had the effect of sorting one of the columns, which seemed to have messed up the indexing.
One thing I can't get my head around is that the grid was bound to the dataview, so the indices should, I think, have worked - irrespective of the sort.
|
|
|
|
|
Hi everyone, Pls. am trying to create a dataset component using generate dataset wizard, but my (vb.net sdk v1.1) does not have the wizard, how can i use the Dataset component by draging it on the windows form???
If you can't do big things, then do small things in big ways...
|
|
|
|
|
Are you still having trouble with this? What IDE are you using?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Sorry you did not quite answer my question.. i was trying to ask how to access an 'Access Database' thru a windows form created on VB.NET .
If you can't do big things, then do small things in big ways...
|
|
|
|
|
You did not mention what database you were using in your original post. Access databases are not really different than any other database.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello all -
this might be a basic question but I can't seem to get the answer right. I have a byte array which needs to be converted to specific data types. I am using the BitConverter class for the conventional conversion such as Int16, Int32 etc. Some of the parameters in the array cannot be converted directly to the specific integer types using the BitCOnverter methods. For example -
parameter1 is the first 3 bytes in the array and needs to be Uint32 for decoding purposes. If I use the convert to Uint32 method - it automatically takes the first 4 bytes. Is there a way to convert just those 3 bytes.
same is true for the next parameter which is only 1 byte but again needs to be Uint32.
Thanks a million
|
|
|
|
|
captainmogo wrote: parameter1 is the first 3 bytes in the array and needs to be Uint32 for decoding purposes. If I use the convert to Uint32 method - it automatically takes the first 4 bytes. Is there a way to convert just those 3 bytes.
I'm not sure if the BitConverter has anything for this. But a solution that would work is to create an array of 4 bytes, copy the 3 bytes in (ensure the remaining byte is zero) and convert it. I think the byte that has to be zero is the last one, but you might want to check that - its been a while since I've done anything at that level.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Adding to Colin's reply:
On "little=endian" systems (such as all Intel/Intel-compatibles) the first byte has the
lowest weight (so you want to clear the fourth byte).
On "big-endian" systems (such as PowerPC, VAX, and then some) it is the opposite.
That's for the representation in memory; what you do in a file is up to you (most systems
use their memory convention, making file exchange difficult between LE/BE systems).
On a wire (such as Ethernet) there are fixed conventions; Ethernet is big-endian.
If you want to write code that supports both, I guess there is a methor or property somewhere,
that tells you what endianness your system has; but I would tend to just test it once at
run-time.
BTW there are two completely different approaches to your conversion problems:
1. write the formulas; looks like threeByteInt=(((byte2<<8)|byte1)<<8)|byte0);
2. use a struct with Marshaling attributes and explicit FieldOffset to simulate
real unions (ala C/C++) or commons (ala Fortran).
|
|
|
|
|
I have copied code from another project where the very same thing works perfectly but in this particular case it just moves right past the call. The only difference between the class I used before and the one I use it in now is that the current class implements IDisposable .
Class 1 (Calling class) values
Private WithEvents _ObjectName As Object
Private Sub UpdateStatus(ByVal sender As Object, ByVal e As System.EventArgs) Handles _ObjectName.StatusChanged
'Code to run here
End Sub Class 2 (Called class) values
Public Event StatusChanged As EventHandler
Public Property CurrentStatus() As Integer
Get
Return _Status
End Get
Set(ByVal value As Integer)
_Status = value
RaiseEvent StatusChanged(Me, EventArgs.Empty)
End Set
End Property
Maybe a fresh set of eyes will see something that I dont.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Private WithEvents _ObjectName As Object<br />
<br />
Private Sub UpdateStatus(ByVal sender As Object, ByVal e As System.EventArgs) Handles _ObjectName.StatusChanged
i don't think that the Object class has StatusChanged event
|
|
|
|
|
Thanks but here is where I declare that event handler.
Public Event StatusChanged As EventHandler <br />
<br />
Public Property CurrentStatus() As Integer <br />
Get <br />
Return _Status <br />
End Get <br />
Set(ByVal value As Integer) <br />
_Status = value <br />
RaiseEvent StatusChanged(Me, EventArgs.Empty) <br />
End Set <br />
End Property
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Private WithEvents _ObjectName As Object
So what? You can declare event handlers all you want. Object will still not have an event called StatusChanged .
|
|
|
|
|
You've seen my posts before and should realize that I make my code generic. Object is just generic for the real class, I apologize that I didnt actually make up a name so as not to confuse people since Object is a class.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
CleaKO wrote: You've seen my posts before and should realize that I make my code generic. Object is just generic for the real class
That's not a good idea when asking questions about your code. Copy and Paste the REAL stuff and it makes solving your problems a whole lot easier.
|
|
|
|
|
Hi,
I'm not sure exactly about your needs... try this plz:
Private WithEvents _ObjectName As New Class2
Private Sub UpdateStatus(ByVal sender As Object, ByVal e As System.EventArgs) Handles _ObjectName.StatusChanged
'Code to run here
End Sub
hope this helps
|
|
|
|
|
You're solution was very close, actually you cant set the New value in the same line but what I was doing differently was that in the other code I was declaring my class object within the WithEvents line and in the new one I was declaring the class and then another class for the event. OOPS!
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Hi,
If you don't want to instantiate a new object in the declaration line you could do the following:
'-- somewhere in the code
_ObjectName = New Class2
AddHandler _ObjectName.StatusChanged, AddressOf SubRoutineName
hope this helps
|
|
|
|
|
How to move up and down row in gridview (vb.net)
Ashu
|
|
|
|