|
In VB6 look at the Command$ statement. It returns to you a string containing all the command line args sent to your app.
|
|
|
|
|
Thankyou!
That does just I job I need it to. I knew it would be something simple.
Thankyou again
|
|
|
|
|
hi to all,
I like to create a crystal report in manual manner.
using window form design
|
|
|
|
|
I m generating a crystal report in vb. and an error is coming. Please help me how to solve it?
Dim mystrpur As String
mystrpur = "SELECT IPurMast.`Date`, IPurMast.`Party`, IPurMast.`Amt`, " & _
"IPurTran.`Item`, IPurTran.`NetQty`, IPurTran.`Rate`, IPurTran.`Amt` " & _
" From `IPurMast` IPurMast INNER JOIN `IPurTran` IPurTran ON IPurMast.`Amt` = IPurTran.`Amt` AND IPurMast.`PurNo` = IPurTran.`PurNo` where IPurMast.`Party` = '" & txtParty.Text & "' AND IPurMast.`Date`>= #" & DTPickerS.Value & "# AND IPurMast.`Date`<= #" & DTPickerE.Value & "# "
CrystalReport1.SQLQuery = mystrpur
CrystalReport1.Formulas(0) = "Bill_no = '" & txtBill.Text & "' "
CrystalReport1.Formulas(1) = "Start_dt = '" & DTPickerS.Value & "' "
CrystalReport1.Formulas(2) = "End_dt = '" & DTPickerE.Value & "' "
CrystalReport1.Formulas(3) = "Party_name = '" & txtParty.Text & "' "
CrystalReport1.ReportFileName = "c:\PurReport.rpt"
CrystalReport1.Action = 1 '****Error is in this line
CrystalReport1.WindowWidth = 100
'Erro is *****
error run time error '20599'
can't open sql server
With Regards
Alok Singh
|
|
|
|
|
|
hi,
i have to complete a program today and i stuck on one last problem. i have an access database and an image table with images as ole object. i found some codes in the www to fill my picturebox with these images but it didn`t work.
i tried to fill a dataset with the image column and set the picturebox.image to the column with the following code but it did not work.
<br />
Dim pictureDataset As New Data.DataSet<br />
<br />
HauptAnweisung.CommandText = "Select IMG_DATA AS BILD, IMG_PRID AS ID FROM T_IMAGE WHERE IMG_PRID = '" & besucherId & "'"<br />
<br />
HauptDataAdapter.SelectCommand = HauptAnweisung<br />
<br />
HauptDataAdapter.Fill(pictureDataset)<br />
<br />
bild.Image = pictureDataset.Tables.Item(0).Rows(0).Item("BILD")<br />
can you please help me to get the picture into my picturebox?
thanks michael
|
|
|
|
|
I have approximately 50 labels on an asp.net page written in VB.NET 2003. I use these labels to indicate when an error has occurred by changing the color to system.drawing.color.red when the user tries to submit the page.
Before I perform this validation (there are good reasons why I don't use the native validation controls) I want to make the label invisible so that they don't appear unless an error has been detected.
I tried the following (which obviously didn't work)!
dim LabelCollection as new Collection
dim x as label
for each x in LabelCollection
if x.forecolor.equals(system.drawing.color.red) then
x.visible=false
end if
next
When I debug this code it reaches the "for each" statement but skips over the rest of the code block, i.e. it doesn't appear to find any labels in the collection.
Can anyone help with this process of iterating through a collection of controls?
What have I missed?
|
|
|
|
|
Peter Stanford wrote: dim LabelCollection as new Collection
dim x as label
I'm confused. By what piece of magic did you expect this collection to contain anything ?
The form has a Controls collection. But because a web page is heirarchical, all the controls in it also have a controls collection. You need to iterate over it recursively to find all the labels.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks, I understand recursion, what I can't find is an example of the syntax to use for this particular situation. None of the online help or forums like this one provide anything other than the answer you've just given, i.e. "just do this".
With respect, if I knew how to "just do this" I wouldn't have asked the question!
|
|
|
|
|
Well, like I said - the form has a Controls collection, and so does each control
private void SetLabels(ControlCollection ctrls)
foreach(Control c in ctrls)
{
if (c is Label)
{
// Whatever
}
SetLabels(c.Controls);
}
(somewhere else)
SetLabels(this.Controls)
Sorry, I don't 'do' VB.NET, I give answers here because I know the framework, from using C#. Hopefully, you can convert this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian,
That's all I was looking for! I can work it out from here.
Best regards
|
|
|
|
|
Thanks Christian,
That's all I was looking for. I can work it out from here!
Best regards
|
|
|
|
|
I'm using VB.net with Framework.
How to monitor the mic level of the default soundcard? I would like to be able to set a treshold value (0-100%) and when the mic level is greater than that a message box would appear. It would be important that the detection would be fast (with as short delay as possible) and consume CPU resources as little as possible.
I found some code in VB6 and C but could not translate them in VB.net.
Thank you!
|
|
|
|
|
Is there a way n VB.net to count a certain number of XML nodes. Say for instance that I had an XML document that held a particular number of nodes named <employee>. Is there a function I can call to tell the exact number of nodes named <employee>?
|
|
|
|
|
If the XML is in an XmlDocument, or any other DOM implimentation, SelectNodes("//Nodename") will return a collection of all nodes with that name, // in XPath means to look everywhere. The collection has a Count or Length property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi, this is chandu,
I am developing an application which includes Datareports in VB with Access. I am getting the report on user input for the first time. But when i am trying to get another record it is giving the error message like
Msgbox "Operation can't process as the object is already open"
please soleve this problem.
Please give the code.
Thank you
|
|
|
|
|
Help! I am using something I don't understand and need some direction.
I am trying to use "WININET.DLL" to ftp a file. I know the function FtpPutFile returns false but I don't know why. How can I find out why? Below is a code snippet of what I am doing.
All help is greatly appreciated!
Public Function bolFtpUpload(ByVal...............<br />
bolFtpAction = FtpPutFile(intNetConn, _<br />
strLocalFile, _<br />
strRemoteDirectory, _<br />
intTransferTypeFlag, _<br />
intContext)<br />
If bolFtpAction = False Then<br />
"Transfer failed " <br />
Else<br />
"Transfer Succeeded "<br />
End If<br />
End Function<br />
<br />
Private Declare Function FtpPutFile Lib "WININET.DLL" _<br />
Alias "FtpPutFileA" (ByVal intFtpSession As Integer, _<br />
ByVal strLocalFile As String, _<br />
ByVal strRemoteFile As String, _<br />
ByVal intFlags As Integer, _<br />
ByVal intContext As Integer) As Boolean
|
|
|
|
|
|
Hello everyone.
At work we are using PDF file to store some expenses. It's a form that sales people use and then submit it. After someone actualy rekeys it in Excel (don't ask me why).
I would like to animate process with VB.NET solution (if someone knows solution in C# I can look into translating it to VB.NET as long as it works), meaning that PDF files will be read (all form entries) and transfered to the database (no Excel).
What I need is the following:
1. Can I read PDF file and parse the form?
2. What I can use (object)?
If someone has an example I would really appreciate it.
Thank you in advance.
-- modified at 16:27 Friday 6th October, 2006
|
|
|
|
|
There are toolkits you can buy, and some free stuff at SourceForge for PDF.
If you can control how the PDF is written, PDF is compressed, but doesn't have to be. If you had an uncompressed PDF, they do tend to insert word breaks in odd places, but it would be parsable.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you. I've used iTextSharp (SourceForge) before to create PDF files but I thought it cannot read PDF. When you say control how PDF is written you mean I know what the fields are, etc.?
Thank you.
|
|
|
|
|
Hi Guys
I was wondering if anyone knew an approach to retrieve a rectangle that would contain the points of a polygon? I had a crack at it as below:
<br />
Dim size As New SizeF(400.0F, 500.0F)<br />
Dim points(5) As PointF<br />
<br />
points(0) = New PointF(20.0F, 20.0F)<br />
points(2) = New PointF(92.0F, 25.0F)<br />
points(3) = New PointF(115.0F, 60.0F)<br />
points(4) = New PointF(127.0F, 90.0F)<br />
points(5) = New PointF(130.0F, 167.0F)<br />
<br />
Using image As New Bitmap(CInt(size.Width), CInt(size.Height))<br />
Using graphics As Graphics = graphics.FromImage(image)<br />
Dim path As New GraphicsPath<br />
Dim region As New Region<br />
<br />
path.AddPolygon(points)<br />
region.Union(path)<br />
<br />
Return region.GetBounds(graphics)<br />
End Using<br />
End Using<br />
However this returned a bizzar rectangle {X=-4194304,Y=-4194304,Width=8388608,Height=8388608} regardless of the coordinates.
Any help, greatly appreciated!
Thanks
Tom
|
|
|
|
|
You can do this several different ways. In all cases, you keep track of the lowest and highest values for the points involved. You can either use a custom Structure to do this and not keep track of the points themselves, only the result, or you can hold the points in a custom implementation of an Array, ArrayList, or List class so you can add and remove points and update the tracked values as the changes are made.
But, basically, the first call to this class/structure would set the upper and lower bounds of the bounding rectangle.
_lowX = newPoint.X : _highX = newPoint.X
_lowY = newPoint.Y : _highY = newPoint.Y
After that, subsequent calls would simply do something like this:
_lowX = Math.Min(_lowX, newPoint.X)
_lowY = Math.Min(_lowY, newPoint.Y)
_highX = Math.Max(_highX, newPoint.X)
_highY = Math.Max(_highY, newPoint.Y)
I knew I had something like this around here. I'll modify it for what you're looking for and post a quick article on it later tonight.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Here, try this. It's based off something I used for a custom graphing component. A couple modifications and it was all set to go:
Imports System.Collections.Generic
...
Public Class BoundingRectangle
Inherits List(Of Point)
Private _lowX As Single
Private _lowY As Single
Private _highX As Single
Private _highY As Single
Public Shadows Sub Clear()
_lowX = 0 : _lowY = 0 : _highX = 0 : _highY = 0
MyBase.Clear()
End Sub
Public ReadOnly Property Rectangle() As Rectangle
Get
UpdateBounds()
Return New Rectangle(_lowX, _lowY, _highX - _lowX, _highY - _lowY)
End Get
End Property
Public Sub New()
MyBase.New()
Me.Clear()
End Sub
Public Shadows Sub Add(ByVal p As Point)
MyBase.Add(p)
End Sub
Private Sub UpdateBounds()
' If we have no points in our list, the bounding rectangle is (0,0)-(0,0)
If MyBase.Count = 0 Then
Me.Clear()
Exit Sub
Else
' If this is the first point we have, it defines the starting bounding rectangle
With MyBase.Item(0)
_lowX = .X : _highX = .X
_lowY = .Y : _highY = .Y
End With
End If
If MyBase.Count > 1 Then
' We have more than one point, find the new bounding rectangle.
For i As Integer = 1 To MyBase.Count - 1
With MyBase.Item(i)
_lowX = Math.Min(_lowX, .X)
_lowY = Math.Min(_lowY, .Y)
_highX = Math.Max(_highX, .X)
_highY = Math.Max(_highY, .Y)
End With
Next
End If
End Sub
End Class
I can't get the article written tonight, so this will have to do for now. It's primarily going to be about creating your own custom typed collections, with added functionality, like tracking and returning a bounding rectangle!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave
Thanks for the time you put into this, very helpful. I have to say, I considered this loop/test method originally, but assumed there would be an approach somewhere in the framework that would do the task. Glad my fruitless search was not down to my incompetence!
Cheers again.
Tom
P.S. Worked like a charm!
-- modified at 4:46 Monday 9th October, 2006
|
|
|
|