|
I don't have any code.
can you help me please?
|
|
|
|
|
Hello everybody
This is the code for saving data in my acess database.
it works but the problem is that i can't save the flexgrid data.
Can anyone of you help me solving this????
Call DB
With ar
.Open "Select *From tblSupplies", strConek, adOpenStatic, adLockOptimistic
.AddNew
!Time = txtTime
!Date = txtDate
!User = txtUser
!VTotal = txtVTotal
!Qty = txtQTY
!Nr = txtNr
!ProdName = FG1.TextMatrix(FG1.Rows - 1, 2)
!Supplier = txtSupplier
.Update
MsgBox "Quanitities of product are being updated.", vbInformation, "POS"
End With
End Sub
|
|
|
|
|
What exception you are getting? As per your code you should have atleast 1 row and 2 columns in the flexgrid. The syntax for using TextMatrix property looks correct. I can help if you can provide more details about the rows and columns in it....
|
|
|
|
|
Form-Load i have insert this code :
With Me.FG1
.ColWidth(0) = 0
.ColWidth(1) = 1000
.ColWidth(2) = 4380
.ColWidth(3) = 1100
.ColWidth(4) = 1500
.ColWidth(5) = 1500
.Row = 0
.Col = 1
.Text = "Nr."
.Col = 2
.Text = "Product"
.Col = 3
.Text = "Quantity"
.Col = 4
.Text = "Price/Unit"
.Col = 5
.Text = "Price"
End With
txtTime.Text = Format(Now, "HH:mm")
txtDate.Text = Format(Now, "dd/mm/yyyy")
FG1.SelectionMode = flexSelectionByRow
End Sub
|
|
|
|
|
Hello everybody,
I want to extend the Trace method in order to write to different target files using the 'Trace.Writeline' command.
Imports System.Runtime.CompilerServices
Module mdlTraceListenerExtensions
<Extension()> _
Public Sub WriteLine(ByVal tr As Trace, ByVal LogType As Integer, ByVal message As String)
If Not tr Is Nothing Then (Do-what-has-to-be-done)
End Sub
End Module Everything compiles without errors, but the new overload doesn't show up in intellisense. Could someone pls. tell me where I'm going wrong?
Thanks,
Mick
|
|
|
|
|
Did you remember to import the module containing the extension method in the code where you're trying to call it?
Also, I'm not sure about VB, but I know that in C#, if you're trying to call an extension method on "this" (which in VB would be "Me"), you actually have to specify "this.MyExtensionMethod()" instead of just calling the method as if it were an instance method: "MyExtensionMethod()"
|
|
|
|
|
Thank you, ekolis - I didn't do that!
But obviously that was not all I had to do - my 'Trace.Writeline(...)' calls still only showed the 4 common overloads. Following the other hints, too, I instantiated the trace class and the instance was extended, so that I could see my extension in IntelliSense finally.
Unfortunately, one major reason why I chose the Trace class was, that it usually doesn't need an instance: After adding the listener to the TraceListeners collection, all the modules can simply call the 'Trace.Writeline(...)' method, which doesn't throw any errors once there were no listeners added. Creating an instance, on the other side, throws an error once the instance variable goes out of scope.
I solved the practical issue by creating different instances now, but still I'm curious if there's really no other way to extend the .NET Trace class. Any further hints appreciated!
|
|
|
|
|
I tried it and it seems to be working. Did you Import the correct Namespace into your code file. Here is what I did:-
The Extension
Imports System.Runtime.CompilerServices
Namespace MyExtensions
Module mdlTraceListenerExtensions
<Extension()> _
Public Sub MyWriteLine(ByVal tr As Trace, ByVal LogType As Integer, ByVal message As String)
If Not tr Is Nothing Then
End If
End Sub
End Module
End Namespace
And the usage:-
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Text
Imports System.IO
Imports CodeProjectVBTest.MyExtensions
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer = 19
Dim tr As Trace
tr.MyWriteLine(19, "Hello")
End Sub
End Class
I changed it to MyWriteLine just to ensure I had the correct one, but it works also using WriteLine. maybe you can see where you went wrong from this, otherwise, sorry, I cannot see where you went wrong.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thank you, Wayne - that was of great help, too! Pls. see my other remarks @ekolis above.
|
|
|
|
|
Have you tried calling the method by its fully qualified name and passing in the required arguments?
i.e
mdlTraceListenerExtensions.Writeline(tr,logtype,message)
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Thank you, Simon! Pls. see my remarks @ekolis above.
|
|
|
|
|
Extension methods are instance methods, they can't be static/shared. See MSDN[^].
|
|
|
|
|
Hello Everyone,
iam searching for a methode to get the calling number to a vb.net project.
i will get the number to search it on our erp/crm database that i can get the customerno from it.
May anyone have a idea?
|
|
|
|
|
Have you tried the Lync SDK documentation?
Lync 2010 SDK Documentation[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hello,
I'm trying to create a customised bandobject such as the one located here:
Extending Explorer with Band Objects using .NET and Windows Forms[^]
I downloaded this code, compiled it successfully, registered and etc... But I'm having trouble getting this to work with the Taskbar in Windows 7. It is working in IE9 perfectly, but not with the taskbar.
Any help would be really appreciated, as i've been stuck on this for a couple of weeks
Cheers!!
|
|
|
|
|
So what have you tried? what isn't working?
Is the issue the conversion from c# to vb.net?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hello All,
Does any one know How to connect vb .net data grid view to a ms access database files
|
|
|
|
|
|
hi
iam sorry my english not soo well
but i make acount in this websit
becouse it is very good and helpful
and I need it to make my project for my last year in college
the second reison that i like how you answer the question
can you tell me how do you do that??
i mean how google opened in this way ??
blz answer me quickly
|
|
|
|
|
|
I have been searching here in the VB forum for some clarification which I was unable to get. So if I have missed something that has already been posted please point me in the proper direction.
I am upgrading some software from VB6 to VB2008. According to the free "Upgrading Microsoft Visual Baisc 6.0 to Microsoft Visual Basic .NET" book states in chapter 11 page 241 that for Left, Right, Trim, Mid, etc can return a NULL in the VB6 environment. However, in .Net this is not allowed for a string to contain a Null value. One of the suggestions the book and migration tool suggests is to use the "$" after the function. Example: Left$, Right$, you get the point.
My question to all you out there is should I be doing what the book suggests to add the "$" to these functions prior to running the migration wizard that comes in VB2008? Are null strings still not allowed in VB2008 or future .net frameworks? Or is adding the "$" a waste of time?
Can someone please give me some clarification if I am on the right path by updating these functions prior to the migration?
Thanks in advance!
|
|
|
|
|
.NET strings can certainly be 'null' ('Nothing' in VB).
The point the author was making (checking my own copy of that book), is that the old VB6 functions accepted arguments that may be Nothing, while the ones with $ after it did not. After upgrading to VB.NET, the VB.NET versions of those functions will throw an exception if you pass Nothing to them. For this reason, he suggests to try to isolate the issues before upgrading. Either way, you'll have to go through this, but the more issues you can resolve before upgrading, the less overwhelming the upgrade will be. I did a number of upgrades for clients a few years ago and I can tell you that this is true (and the book you're using is excellent).
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
IIRC In VB6, if a string is assigned Empty , it just reverts to a zero length string "" . I am sure you cannot assign Nothing to a string.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Thanks David. I appreciate that. This clarification helps me now how to navigate through all these string modification functions.
Thanks again.
|
|
|
|
|
The $ were added to add some explicit typing. In VB6, almost all library functions use variants (object references) rather than an explicit type; even if the argument in question only ever accepts a string, the parameter was still declared without a type.
Adding the $ to the Left/Right/Mid functions forced their type to string, so they accept and return only a string. Apparently (I did not know this), the non-string versions accepted a Nothing value for the objects they were passed? This surprises me, as VB6 always raised an error when nothing was passed.
|
|
|
|