|
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
|
|
|
|
|
Hi Dave, according to your comment and my research, now I found a document from http://www.codeproject.com/vb/net/registry_with_vb.asp[^] about accessing the registry. This will speed up my project, Thank you a lot
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi out there!
I need your help! I am developing a Visio ActiveX application and I can not find the way to call another instance of my application. The ActiveX Drawing Control is a SDI, but I don't want two or more drawing controls in my application, just more instances. Can someone help me???
Thanx!
|
|
|
|
|
I've created a datagrid that pulls data from a sql database based on the option chosen in a dropdown. My problem is with the paging feature. If a result I choose shows pages 1 and 2, and I go to the second page then try to choose another option from the dropdown that shows a single page it blows up. The error message is: "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount"
Is there anyway to reset the page index or page count so choosing a new option will take me back to page one? Thanks,
Ralph
|
|
|
|
|
Try to check the information from here[^], it might be give you some idea.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
hello..
this is the first time i'm developing client-server application
using VB and SQL server
now i'm testing the application with my server
the connection made with SQL Server using this
"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=dbDesa;Data Source=MSSYA"
the application will be ok in stand alone mode
i need to deploy the complete application to another server
so i assumed, the connection string above can't be used if the application install in another server
can somebody help me with the simple example to solve this
|
|
|
|
|
In my opinion, The Initial Catalog won't change but the Data Source might change base on the server name for each machine. As far as I know (local) variable is use to represent for each server name.
shaf_sar wrote:
"Provider=SQLOLEDB.1Persist Security Info=False;User ID=sa;Initial Catalog=dbDesa;Data Source=MSSYA"
So your code should become to:
"Provider=SQLOLEDB.Persist Security Info=False;User ID=sa;Initial Catalog=dbDesa;Data Source=(local)" or "Provider=SQLOLEDB.Persist Security Info=False;User ID=sa;Initial Catalog=dbDesa;Data Source=local"
Try to check at http://www.connectionstrings.com/[^] for more information. For your database in sql server try use sp_detach_db and sp_attach_db store procedure to deploy it to the other machine. If you have SQL server book online then you can choose have a look at it for reference.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
The man from SCN-CO wrote:
As far as I know (local) variable is use to represent for each server name.
A more typical way to represent it would be to use Data Source=. .
Having said that, if it's a client / server app, then it's unlikely that the datasource will be the local machine. What I typically do is form a connection string dynamically based on settings (usually stored in the registry), with a UI to allow Dumb users to sort it out. If i'm dealing with techies, I tend to use the Datalinks dialog for configuring connections:
<br />
Dim oDL as New Datalinks<br />
<br />
strConnectionString = oDL.PromptNew<br />
oConnection.Open strConnectionString<br />
<br />
which displays the DL dlg and returns the conn string - useful if not sure what users want to connect to, but does allow them to do silly things like form a conn string for Oracle on the local host, when they need SQLServer on a remote machine...but like I said - tend to reserve that for savvy users! Note that given a ADODB::Connection object, can also call PromptEdit, which makes the dlg default to the current settings....
In terms of deploying the DB, I tend not to use attach and detatch, but rather backup and restore to a different machine, or SQL Script the whole smash - swings and roundabouts really, but my preference....
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|