|
Maybe I am just not up to speed w/ .NET, but when I create my Performace Counters and Category, they load just fine, I can see them in the WMI performance Monitor, however they do not display the activity that is incrementing them. WMI reports that the class has no methods. I can not seem to find any information on what those methods would be? Can anyone point me in the right direction?
|
|
|
|
|
Im trying to implement an encryption technique in my collage and i have to get the ascii number of the character to aplly the algorithem to that character ..
like in c++ for example ..
the ascii code of the a=65 and b=66 and so on ..
if any one have an idea about how to get this ascii value in vb.net .. plx reply me ..
thanx
لا اله الا الله محمد رسول الله
|
|
|
|
|
try using Val = ASC(Char) (That's if I remember correctly!)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
your answer is completely correct.
Asc() function returns ascii code for a character and Chr() function does the reverse: returns the character for an ascii code.
|
|
|
|
|
Hi!
My Problem is that i'm using MdI Form and on Mdi Form i'm Using A Toolbar that will work in same way in my entire application such as that if user press Add button on Toolbar of Mdi form then Add Function/sub of Active MdiChild Form should be called similarly some other Button works but when i'm going to do this i'm still really failed to call function of Active form (Form1) from MdiForm(Form2).
|
|
|
|
|
Hi!
My Problem is that i'm using MdI Form and on Mdi Form i'm Using A Toolbar that will work in same way in my entire application such as that if user press Add button on Toolbar of Mdi form then Add Function/sub of Active MdiChild Form should be called similarly some other Button works but when i'm going to do this i'm still really failed to call function of Active form (Form1) from MdiForm(Form2).
|
|
|
|
|
How to create setup files(installshield) after developing a program???
Ashish
|
|
|
|
|
For a simple installer, you can use the Setup Project that comes with VIsual Studio .NET. For more complex project, I HIGHLY suggest using a 3rd party product like InstallShield or Wise for Windows Installer.
For a simple project, walk yourself through HOW TO: Build an Installer by Using Visual Basic .NET[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Howdy.
Perl has a nifty virtual interface for RDBMSs called DBI - it abstracts the common functions from most DBs and wraps them with a common interface. It's slick when you don't know what DB your app will be used with.
I have a VB.Net app that needs to be DB independent as well, that is, I will not know what DB my user has at the data layer. Is there an equivalent to the Perl DBI lib for VB?
TIA.
Gus
|
|
|
|
|
Yes , it's called ADO.NET and includes such database agnostic interfaces as IDbConnection , IDbCommand , IDbTransaction plus many more.
System.Data namespace
|
|
|
|
|
I'm currently working on a project that sends a JPEG to an image correlation app. I load an 8-bit grayscale BMP and save it as a JPEG with the GDI+ libraries but it saves the JPEG as a 24-bit true color image. Can GDI+ write a 8-bit JPEG?
Here's my VB code snippet:
' Create the GDI+ bitmap
' from the image handle
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap)
If lRes = 0 Then
Dim tJpgEncoder As GUID
Dim tParams As EncoderParameters
' Initialize the encoder GUID
CLSIDFromString StrPtr("{557CF401-1A04-11D3-9A73-0000F81EF32E}"), tJpgEncoder
' Initialize the encoder parameters
tParams.Count = 1
With tParams.Parameter ' Quality
' Set the Quality GUID
CLSIDFromString StrPtr("{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"), .GUID
.NumberOfValues = 1
.type = 4
.Value = VarPtr(quality)
End With
' Save the image
lRes = GdipSaveImageToFile(lBitmap, StrPtr(filename), tJpgEncoder, tParams)
' Destroy the bitmap
GdipDisposeImage lBitmap
|
|
|
|
|
When I display a date from the database I get the date and time. I've been able to create a binding object with events to get rid of the time in about half of the cases.
Private Sub XBINDING_format(byVal sender as Object, by Val e
As System.Windows.forms.converteventargs) handles xbinding.format
e.value = Format(e.Value, "MM/dd/yy")
DIM WITH EVENTS XBINDING AS BINDING
XBINDING = NEW BINDING ("TEXT", DS, "ADATE")
TXT1.DATABINDINGS.ADD(XBINDING)
This works fine if the value is not null. So, I put a try - catch trap to just display the database field directly if the above routine fails.
On about half of the date fields this works, the other half get an error that dosn't seam to have anything to do with the date problem
"Additional information: Argument 'Expression' is not a valid value."
If I comment out the routine everything works find. (Except for having the time in my textbox.
The work "Expression" isn't in any of the code. And, the online help talks about everything but this problem.
Anyone have any ideas?
|
|
|
|
|
This is what happens when you blindly catch exceptions. Instead, check if the value is null yourself, and deal with it explicitly in your code.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hi!!
can anybody help me in establishing connection of oracle 8i with VB.Net
i need code for this purpose if anybody can give me that???
|
|
|
|
|
i believe there is a set of oracle data classes available on msdn. run a search there to have a look for them. otherwise you can always use the oledb namespace.
check for connectionstrings here.
good luck!
-jim
|
|
|
|
|
I use OleDb myself. But it's rather slow. You can find tons of example for that. Or you can try using the wizards for database adapters.
|
|
|
|
|
Looking for a way to develop new graphical / user controls in C# or VB.NET and put them onto existing VB 6 forms.
Current project is a VB exe with many forms - long term goal is to port to .NET but interim solution is to develop new code in .NET while we migrate over.
Problem is I can't find a way to add new controls to the form... Is this possible?
It is possible to open new .NET forms from VB and reference .NET class libraries.
|
|
|
|
|
It is possible to do but requires a bunch of extra work to do it. Basically, your components need COM Callable Wrapper around them. Start by reading Exposing .NET Framework Components to COM[^] on MSDN. There are many options available to you, but what's best depends on your .NET component and VB6 implementations.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply, I will take a look at the link.
Are you aware of any examples that show this being done?
|
|
|
|
|
There are examples, but you really have to search for them. Read up on COM Interoperability.
You can check out this[^] example here on CP. It's written in C#, but should translate to VB without too much trouble. Make sure you read the comments at the bottom of the article too! There are some pitfalls getting this to work! You've got a bunch of research to do!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I know I'll get hell for this one....How do I print a PDF file from vbnet?
My code is below which populates a crystal reports document and saves it as a pdf, how can I print it now?
Dim sc As New PP.BusinessLogicLayer.Schedule()
sc.ScheduleStamp = Session("Sch")
sc.StudyNo = txtStudyNumber.Text.Trim
sc.AQ = Session("AQ")
sc.PrintTopSheet()
Dim CRDoc As New ReportDocument()
CRDoc.Load("C:\w\x\y\z.rpt")
Dim logonInfo As New TableLogOnInfo()
Dim i As Integer
For i = 0 To CRDoc.Database.Tables.Count - 1
logonInfo.ConnectionInfo.ServerName = serverName
logonInfo.ConnectionInfo.DatabaseName = databaseName
logonInfo.ConnectionInfo.UserID = uid
logonInfo.ConnectionInfo.Password = pwd
CRDoc.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo)
Next
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim Fname As String
Fname = "\\a\b\c.pdf"
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = CRDoc.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
CRDoc.Export()
|
|
|
|
|
You have to shell out to Acrobat Reader to print it. The command line is:
"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" /p /h "<fullPathToFileHere>"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave, I have a 2 question from here.
Dave Kreskowiak wrote:
"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" /p /h "<fullpathtofilehere>"
What do you mean by /p and /h ? Because in my application, i did not use these two argument. I just access the acrobat executable file and run the file base on its path.
Dave Kreskowiak wrote:
C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe
If i install windows on Drive D: and my program file would be D:\Program Files and the code is fix to drive C: how could we write code that could check which is the system drive for our windows??? It contain an error if I use:
"%programfiles%\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" "<fullPathToFileHere>"
Can you give me some solution?
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
The man from SCN-CO wrote:
What do you mean by /p and /h?
THese are command line parameters that Acrobot Reader uses to tell it to Hide itself (no visible form or interface) and Print the file specified on its command line.
The man from SCN-CO wrote:
If i install windows on Drive D: and my program file would be D:\Program Files and the code is fix to drive C: how could we write code that could check which is the system drive for our windows??? It contain an error if I use:
"%programfiles%\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" ""
It's just an example. How you adapt the code is up to you. An example of getting the path to Program Files would be:
Dim path As String = Environment.GetFolderPath( Environment.SpecialFolder.ProgramFiles )
You could also read the Registry at the following key to find the complete path to AcroRd32.exe:
KHEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\5.0\InstallPath
or
KHEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\6.0\InstallPath
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, thank you Dave. I have to find another document about accessing the registry from vb.net before I work with this code.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|