|
you can see the difference in the 'Watch window' itself..
during debugging, select any variable from the code and right click in the watch window and select the add watch option. you can see many options inside.
morover watch displays the value, type and context of the variable, but imm window shows only the value. also, imm window doesnt have the variety options that is provided by the watch window... got it?
|
|
|
|
|
The immediate window let's you query variables and execute individual statements while in design mode. You can read more here[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hakmeh Mohannad wrote: how can i make this possible
Learn how to write sql statements. Make sure you keep your code safe from injection attacks...
|
|
|
|
|
friend...for this, first learn to write simple queries..
for this case, only a simple select query will be enough, but first u must hav a table to store the uname and passwd... so first try those..
-- modified at 4:45 Saturday 5th May, 2007
|
|
|
|
|
|
I have a compare to sort the order of SubItems in a ListView and it works great, but... If the ListView shows Groups nothing is sorted. Here's the compare function from my class. How can I make it work when Groups are shown?
<br />
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _<br />
Implements IComparer.Compare<br />
<br />
Dim ItemA As String<br />
Dim ItemB As String<br />
<br />
Try<br />
ItemA = CType(x, Windows.Forms.ListViewItem).SubItems(_Column).Text<br />
Catch<br />
ItemA = ""<br />
End Try<br />
<br />
Try<br />
ItemB = CType(y, Windows.Forms.ListViewItem).SubItems(_Column).Text<br />
Catch<br />
ItemB = ""<br />
End Try<br />
<br />
If _Ascending Then<br />
Return [String].Compare(ItemA, ItemB)<br />
Else<br />
Return [String].Compare(ItemB, ItemA)<br />
End If<br />
End Function<br />
Cheers
|
|
|
|
|
Hi
I am trying to create BMP file to print on Epson Receipt printers using OPOS. Epson printers only allow - BMP File which are Monochrome, 16 color (4 bit ) or 256 Color (8-bit) and should be uncompressed format.
I tried working 1bppIndexed Bmp. However the printer does not seem to except it. Currently the technique I am using is saving the image first as "GIF" ( 8 bit ) and then again saving it as bmp. However would like to know any techniquie for saving Uncompressed monochrome ( 1 bit ) bmp in Vb.net
Thanks
Satish
|
|
|
|
|
I have two arrays. The first holds titles, the second holds text to see if the titles should be in a different case or bold. These names are then displayed in a Combo Box. Please bear with my simple example but it is about the only way to discribe what I want to do.
vNames = Array("Smith", "Hudson", "Jones")
VString = Array("H","I","h","i")
So I want to search the above vNames array for the vString, and if so I need it to be set to bold
This is what I was thinking:
For i = 0 To 2
For j = 0 To 1
If InStr(vNames(i), vString(j)) <> 0 Then
cmbName.FontBold = True
End If
Next j
Next i
But when I do this all three names are in bold, when my thinking is just the first two names should be bold.
Thanks in advance for any advice,
Dan
|
|
|
|
|
I'm assuming you're using VB6. This won't work because the FontBold property of the ComboBox is for all of the items in the ComboBox, not ones you pick. It's either all of the items are bolded, or none of them.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I am actually using vba for Word 2003, which I believe is much closer to VB6 than to anything else.
And you are right about it doing the whole list. One the name is picked it is added to a Word document text form field, what I believe I will need to do is this: set my txtName.Value, test for the string, then bold if need be.
Thanks for the reply.
Dan
|
|
|
|
|
The reason why they are all bold is because you are changing the combobox font to bold not the individual entry to bold.
|
|
|
|
|
Thanks for pointing this out. I think I have found a way to handle this with the selected value, not the combo box.
Dan
|
|
|
|
|
Hi guys
A little background info:
I receive XML files with the same data in different formats. The data from these XML files has to be stored in 3 different SQL tables.
What I am trying to do is write a generic code in VB.net that will read these XML files and may be based on some schema definition populate the XML data in the 3 different tables.
I have written code that does not refer any schema definitions and is good only for one XML format any ideas on how to write generic code to do so??
Any help would be appreciated.
Thank you in advance
Ziaous
|
|
|
|
|
I am not sure on the specifics of your problem, but depending on how the xml data is written, you could read it into a dataset using the schema.
<br />
<br />
dim data as new dataset()<br />
data.readXmlSchema("Schemafilename")<br />
data.readXml("xmlfilename")<br />
<br />
and the data will now be in (a) table(s) in that dataset, like I said this will not work for a lot of xml data, but it is a start.
|
|
|
|
|
Hi Kevin
I have no issues loading or paring an XML file, what I am trying to do is depending on the given xml schema definition or DTD the code should be capable to load the XML table in the appropriate table.
Right now I read an XML file in VB.Net pass it to SQL code and there I have hard coded attribute paths that help me select data from XML file and insert into the table, like:
Insert Into StoreInfo(StoreNumber,StoreName)
SELECT distinct StoreNumber,StoreName
FROM OPENXML (@XmlDocId, '/Root/Data/StoreInfo',1)
Now, instead of using this method I want the code to read XML file as well as a schema def. and create a dynamic insert query that I can pass to the database...
I hope that makes sense.
Thanks
|
|
|
|
|
If you are using SQL-Server then you may be able to use Microsoft's SQLXML component to do this less painfully.
|
|
|
|
|
|
I have a vb.net application in which i have an add-in in the powerpoint. Now when i insert a new slide and right click on the "click to add title" or "click to add subtitle" i get a context menu pop up. I want to add my own menu items to this pop up. Can anyone suggest me how to do tht. I will be writing the code to add the menu items in the right click event of the pptapplication i.e
Private Sub pptApplication_WindowBeforeRightClick(ByVal Sel As Microsoft.Office.Interop.PowerPoint.Selection, ByRef Cancel As Boolean) Handles pptApplication.WindowBeforeRightClick
End sub
I dont want to create a new context menu. I want to add the items to the existing context menu. someone pls help
chakor
|
|
|
|
|
So many times a day are you going to ask this question?? The more you do this, the more you will most likely get ignored.
It takes to research some of this stuff, especially doing Office Interop. The base of developers doing work in Office is very small, so it's not real likely that your post will get answered unless you go to a forum that specializes in it, like this one[^] on MSDN.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I have a .NET (2.0) application that is on a shared network. I have used caspol (Microsoft .NET Framework 2.0 Configuration) to grant FullTrust permission to the application. When I execute the application on Windows XP it works fine. If I run in on Vista I get the following error:
The description for Event ID 1000 from source Application Error cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
EMS.exe
34.0.131.0
463909e3
KERNEL32.dll
6.0.6000.16386
4549d328
e0434f4d
00000000000233ac
The substitution string for insert index (%1) could not be found
After stepping through the code and creating a test windows app I found that this line is causing problems:
AddHandler Application.ThreadException, AddressOf eh.OnThreadException
What is Vista doing differently and why would this line cause my application to fail?
Here's the full code for a simple windows app that will fail:
Imports System.Threading
Public Class Main
Public Shared Sub Main()
Application.EnableVisualStyles()
Dim eh As New CustomExceptionHandler
AddHandler Application.ThreadException, AddressOf eh.OnThreadException 'If you remove this line the app will run on Vista
Dim frm As New Form1
frm.ShowDialog()
End Sub
Private Class CustomExceptionHandler 'To Handle Application.ThreadExceptions
Public Sub OnThreadException(ByVal sender As Object, ByVal t As ThreadExceptionEventArgs)
ErrorHandler(t.Exception)
End Sub
End Class
Public Shared Sub ErrorHandler(ByVal ex As Exception)
'Error Handler code here
End Sub
End Class
Thanks,
Sean
|
|
|
|
|
First, it looks like you're assuming that this exception handler will handle any exception that is thrown by your app. This is not the case. The documentation on ThreadException is a bit confusing, but it throw this exception during the processing of window messages, and only AFTER the first form is created. It won't catch every possible exception that isn't already handled.
I think it crashed because you didn't use Application.Run to start a message pump to show the startup form.
I don't have a dev environment setup on Vista, so I can't test anything. I think you have to change this, which , BTW will LEAK RESOURCES because, since you displayed the form using ShowDialog() , you're not disposing of the form when you're done with it. This is not necessary if you display the new form using Show() instead:
Dim frm As New Form1
frm.ShowDialog()
To this:
Application.Run(new Form1())
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks for the reply. I'll check my code to make sure the ThreadException is working.
However, I changed my code to this below and I still get the error:
Imports System.Threading
Public Class Main
Public Shared Sub Main()
Dim eh As New CustomExceptionHandler
AddHandler Application.ThreadException, AddressOf eh.OnThreadException 'If you remove this line the app will run on Vista
End Sub
Private Class CustomExceptionHandler 'To Handle Application.ThreadExceptions
Public Sub OnThreadException(ByVal sender As Object, ByVal t As ThreadExceptionEventArgs)
ErrorHandler(t.Exception)
End Sub
End Class
Public Shared Sub ErrorHandler(ByVal ex As Exception)
'Error Handler code here
End Sub
End Class
This doesn't even open a form and it's crashing on Vista.
Any ideas?
|
|
|
|
|
No idea. Like I said, I don't have anything to test it on.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
First post I think so be nice! I have created a dll file using the systems.collections.generic namespace. I have built the dll file in V Studio 2005. I can now reference the dll from 2005 but not V Studio 2003. V Studio 2003 states the dll is invalid (me thinks poor backward compat from MS!) I know the generics was intoduced in .net 2.0 and is not available in any previous framework. I cannot upgrade out applications to 2005 at present as there are too many in the site. I know little about the application pools, is this the only way to get round the problem? Any suggestions as to how I can create a generic class to house a collection in 2003 would be greatly appreciated.
Kindest Regards
TSB
TonySmithBrewster
|
|
|
|