|
yeah, I have soapUI that does a pretty good job. It was a shot in the dark really. I'm getting data back, and the correct data. The client just doesn't think I'm getting everything I should.
If it moves, compile it
|
|
|
|
|
Well then, it's either a problem with the server-side code that's retrieving the data or with the clients expectations.
|
|
|
|
|
I have been searching for a way to print a datagrid and all responses refer to a datagridviewprint class. This does not seem to exist in my version of VB2005. How can I import this into my system? Appreciate some assistance
|
|
|
|
|
Did you try searching[^] for it?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I'm new to this, so if I've done anything wrong, please tell me
I work on a pretty large VB6 application. The distribution of it is pretty problematic. My sort of "dream" is to automate the build and packaging process with some repeatable scripts (batch-files?).
I want to ship the application with the nullsoft installer system - nsis. I got lot's of referenced libraries and components (dlls, ocx) that the package and deployment wizard of vb6 gathered for me.
The problem now is to make sure that all needed libraries are installed in the correct version.
How can I make that sure?
Should I ship the dlls/ocx as cab-files? Can nsis do a kind of conditional installation of dlls/ocxs?
Thanks!
best regards
Andreas
|
|
|
|
|
Truthfully, you should be scrapping the entire VB6 project and redoing it in .NET. VB6 has been dead for quite a number of years now and community support for it is dying rather quickly.
|
|
|
|
|
Well, thanks for that advice . I wish I could do that for quite a long time.
We took the project from another developement company, and it's that huge that it can't be redone in .NET as fast as we would need. The former compapy worked on that application for 10 years and so it became pretty complex.
We have to live with VB6 there :/
regards
Amdreas
|
|
|
|
|
fancyRocko wrote: We have to live with VB6 there :/
No, you will be phased out, with VB6.
Huge applications aren't rewritten in a single action; you replace parts of it, bit by bit. It's either that, or become part of history.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Yikes! Good luck with that!
Honestly, it's been 11 years since I've touched anything VB6. I remember the Setup and Deployment wizard sucked.
As for NSIS, I really couldn't tell you what it's going to take to automate this. I think that's going to be a question for NSIS.
|
|
|
|
|
Okay. It seems that you're right. I'll try to convert the application peace by peace to .NET.
I needed your expert impact for that decision - thanks!
|
|
|
|
|
I feel for you because I used to do that work as well.
Back in the VB6 day.
We used Wise installer to create and deploy our builds, Like VB6 the version we used is no longer supported, but I still use it on my Win7 installs(for another dead language) and it has a very simple method of conditionally installing a file.
I don't use nor do I know NSIS, but it appears the equivalent functionality might be
GetFileAttributes
and/or
GetFileVersion coupled with some flow control logic.
With that in mind, Is it actually necessary to check versions of every file? Could you use a single file to be your gauge. That is, can you check the version of abc.dll or xyz.ocx and based on that version number run a completely different branch of the installer script that could update your dependencies?
One Last comment about large VB6 apps, I found that using two installs was very helpful.
The first install was a CORE installer. It installed all of the dll, ocx, exe files that were dependencies. This was a heavy(big) installer.
The second install was much lighter and it was used to install the primary components of the application. as well as update individual components from the CORE. This file was used to push out updates to the software.
Of course both files were needed for new installs.
This worked well for us because of our business model.
Last, I did have a scriptable builder for VB6, I'll dig around a bit to see if I still have it. It may be something I can share.
rum
|
|
|
|
|
Dear Friends,
i have problem by printing Datagridview content plus header and footer.
i can print exactly DataGridView , but i want to print out the content only (plain text)+ header and footer in vb.net 2010
is anybody can help me to do this !?
Your help would be greatly appreciated
Thanks in advance
|
|
|
|
|
|
Static oColumnLefts As New ArrayList
Static oColumnWidths As New ArrayList
Static oColumnTypes As New ArrayList
Static nHeight As Int16
Dim nWidth, i, nRowsPerPage As Int16
Dim nTop As Int16 = e.MarginBounds.Top
Dim nLeft As Int16 = e.MarginBounds.Left
If nPageNo = 1 Then
For Each oColumn As DataGridViewColumn In frmLedger.dgvLedger.Columns
nWidth = CType(Math.Floor(oColumn.Width / nTotalWidth * nTotalWidth * (e.MarginBounds.Width / nTotalWidth)), Int16)
nHeight = e.Graphics.MeasureString(oColumn.HeaderText, oColumn.InheritedStyle.Font, nWidth).Height + 11
oColumnLefts.Add(nLeft)
oColumnWidths.Add(nWidth)
oColumnTypes.Add(oColumn.GetType)
nLeft += nWidth
Next
End If
Do While nRowPos < frmLedger.dgvLedger.Rows.Count - 1
Dim oRow As DataGridViewRow = frmLedger.dgvLedger.Rows(nRowPos)
If nTop + nHeight >= e.MarginBounds.Height + e.MarginBounds.Top Then
DrawFooter(e, nRowsPerPage)
NewPage = True
nPageNo += 1
e.HasMorePages = True
Exit Sub
Else
If NewPage Then
' Draw Header
e.Graphics.DrawString(Header, New Font(frmLedger.dgvLedger.Font, FontStyle.Bold), Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top - e.Graphics.MeasureString(Header, New Font(frmLedger.dgvLedger.Font, FontStyle.Bold), e.MarginBounds.Width).Height - 13)
' Draw Columns
nTop = e.MarginBounds.Top
i = 0
For Each oColumn As DataGridViewColumn In frmLedger.dgvLedger.Columns
e.Graphics.FillRectangle(New SolidBrush(Drawing.Color.LightGray), New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))
e.Graphics.DrawRectangle(Pens.Black, New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))
e.Graphics.DrawString(oColumn.HeaderText, oColumn.InheritedStyle.Font, New SolidBrush(oColumn.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i), nTop, oColumnWidths(i), nHeight), oStringFormat)
i += 1
Next
NewPage = False
End If
nTop += nHeight
i = 0
For Each oCell As DataGridViewCell In oRow.Cells
If oColumnTypes(i) Is GetType(DataGridViewTextBoxColumn) OrElse oColumnTypes(i) Is GetType(DataGridViewLinkColumn) Then
e.Graphics.DrawString(oCell.Value.ToString, oCell.InheritedStyle.Font, New SolidBrush(oCell.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i), nTop, oColumnWidths(i), nHeight), oStringFormat)
ElseIf oColumnTypes(i) Is GetType(DataGridViewButtonColumn) Then
oButton.Text = oCell.Value.ToString
oButton.Size = New Size(oColumnWidths(i), nHeight)
Dim oBitmap As New Bitmap(oButton.Width, oButton.Height)
oButton.DrawToBitmap(oBitmap, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))
ElseIf oColumnTypes(i) Is GetType(DataGridViewCheckBoxColumn) Then
oCheckbox.Size = New Size(14, 14)
oCheckbox.Checked = CType(oCell.Value, Boolean)
Dim oBitmap As New Bitmap(oColumnWidths(i), nHeight)
Dim oTempGraphics As Graphics = Graphics.FromImage(oBitmap)
oTempGraphics.FillRectangle(Brushes.White, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
oCheckbox.DrawToBitmap(oBitmap, New Rectangle(CType((oBitmap.Width - oCheckbox.Width) / 2, Int32), CType((oBitmap.Height - oCheckbox.Height) / 2, Int32), oCheckbox.Width, oCheckbox.Height))
e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))
ElseIf oColumnTypes(i) Is GetType(DataGridViewComboBoxColumn) Then
oComboBox.Size = New Size(oColumnWidths(i), nHeight)
Dim oBitmap As New Bitmap(oComboBox.Width, oComboBox.Height)
oComboBox.DrawToBitmap(oBitmap, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))
e.Graphics.DrawString(oCell.Value.ToString, oCell.InheritedStyle.Font, New SolidBrush(oCell.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i) + 1, nTop, oColumnWidths(i) - 16, nHeight), oStringFormatComboBox)
ElseIf oColumnTypes(i) Is GetType(DataGridViewImageColumn) Then
Dim oCellSize As Rectangle = New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight)
Dim oImageSize As Size = CType(oCell.Value, Image).Size
e.Graphics.DrawImage(oCell.Value, New Rectangle(oColumnLefts(i) + CType(((oCellSize.Width - oImageSize.Width) / 2), Int32), nTop + CType(((oCellSize.Height - oImageSize.Height) / 2), Int32), CType(oCell.Value, Image).Width, CType(oCell.Value, Image).Height))
End If
e.Graphics.DrawRectangle(Pens.Black, New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))
i += 1
Next
End If
nRowPos += 1
nRowsPerPage += 1
Loop
DrawFooter(e, nRowsPerPage)
e.HasMorePages = False
End Sub
Private Sub DrawFooter(ByVal e As System.Drawing.Printing.PrintPageEventArgs, ByVal RowsPerPage As Int32)
Dim sPageNo As String = nPageNo.ToString + " of " + Math.Ceiling(frmLedger.dgvLedger.Rows.Count / RowsPerPage).ToString
' Right Align - User Name
e.Graphics.DrawString(sUserName, frmLedger.dgvLedger.Font, Brushes.Black, e.MarginBounds.Left + (e.MarginBounds.Width - e.Graphics.MeasureString(sPageNo, frmLedger.dgvLedger.Font, e.MarginBounds.Width).Width), e.MarginBounds.Top + e.MarginBounds.Height + 7)
' Left Align - Date/Time
e.Graphics.DrawString(Now.ToLongDateString + " " + Now.ToShortTimeString, frmLedger.dgvLedger.Font, Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top + e.MarginBounds.Height + 7)
' Center - Page No. Info
e.Graphics.DrawString(sPageNo, frmLedger.dgvLedger.Font, Brushes.Black, e.MarginBounds.Left + (e.MarginBounds.Width - e.Graphics.MeasureString(sPageNo, frmLedger.dgvLedger.Font, e.MarginBounds.Width).Width) / 2, e.MarginBounds.Top + e.MarginBounds.Height + 31)
End Sub
|
|
|
|
|
Using VB.Net I have created a composit component that inherited a DateTimePicker and that includes a MaskedTextBox as an embedded child class that overlays the DateTimePicker text box. When the user is done editing the MaskedTextBox but has created an invalid date I want the DateTimePicker calander to drop down showing the date that seems closest to what the user entered to get their attention and a confirmation.
I am firing a Delegate method in the MaskedTextBoxes OnValidating event that drops down the calendar after the MaskedTextBox loses focus. The Delegate then selects the DateTimePicker as the active control (overriding any other control selection) and does a SendKey Down to open the calendar. This works great if the target is any control other than the DateTimePicker. But if the DateTimePicker is the target the DateTimePicker gets a double Select and Down keystroke event (one from the delegate and one from the user click) and this messes up other behaviors tied to the MaskTextBox.
I need a way to determine when to fire the Delegate (i.e., when any control other than the DateTimePicker will get focus) and when to not fire the Delegate (i.e., when the DateTimePicker dropdown button was activated by click or keyboard). Is there anyway to do this that would work inside the properties ,methods or events the component can handle? Or is this only possible to detect and manage from the form?
|
|
|
|
|
I found an answer to my question. The Delegate delayed processing until after the OnDropDown event of the DateTimePicker fired. I already had an override of the OnDropDown event to set flags to track the calendar state, so I was able to use one of the flags in the Delegate to suspend it from firing when the Calendar was already being dropped dowm. For anyone's information here is how the events ended up looking:
Private m_bCalAbort As Boolean = False
Private m_bInCal As Boolean = False
Protected Overrides Sub OnDropDown(ByVal eventargs As System.EventArgs)
m_bInCal = True
m_bCalAbort = False
MyBase.OnDropDown(eventargs)
End Sub
Protected Overrides Sub OnCloseUp(ByVal eventargs As System.EventArgs)
'If m_dCalDate <> MyBase.Value Then
If Not m_bCalAbort Then
'Do Stuff
End If
m_bInCal = False
MyBase.OnCloseUp(eventargs)
End Sub
Delegate Sub MyDelegate(ByVal myControl As Label, ByVal myArg2 As String)
Friend Sub DelegateMethod(ByVal myControl As Label, ByVal myCaption As String)
If Not m_DTP.m_bInCal Then
m_DTP.Select()
SendKeys.Send("%{DOWN}")
End If
End Sub 'DelegateMethod
Protected Overrides Sub OnValidating(ByVal e As System.ComponentModel.CancelEventArgs)
m_LastEvent = LastEvents.Validating
If Not DateEmpty() And ue.GetDate(Text) Is Nothing Then ' check for an invalid date
Ping()
Dim myArray(1) As Object
myArray(0) = New Label()
myArray(1) = "Enter a Value"
m_DTP.BeginInvoke(New MyDelegate(AddressOf DelegateMethod), myArray)
ElseIf Not DateEmpty() And ue.GetDate(Text) IsNot Nothing Then
Dim tempdate As DateTime = ue.GetDate(Text)
If tempdate < m_DTP.MinDate Or tempdate > m_DTP.MaxDate Then
Ping()
Dim myArray(1) As Object
myArray(0) = New Label()
myArray(1) = "Enter a Value"
m_DTP.BeginInvoke(New MyDelegate(AddressOf DelegateMethod), myArray)
End If
End If
MyBase.OnValidating(e)
End Sub
modified 26-Sep-12 17:57pm.
|
|
|
|
|
Hi everyone,
Can anyone guide me on how to develop a small telephone tracking system through GPS in vb.net with sql database? How to approach this from a conception point of view. and what i need to take into account.
I have no prior knowledge with GPS and to implement it.
this application is to keep track of all cellphone calls thru GPS and store the data in a database for analysis. this must be done in vb.net with sql.
this is an anti-kidnapping small app.
Thanks advance.
|
|
|
|
|
waner michaud wrote: I have no prior knowledge with GPS and to implement it. ..then I suggest you start there. Windows 7 has a sensor API[^], with the C# intro here[^] (for .NET 4)
The cool part;
Location information may come from multiple providers, such as GPS, Wi-Fi triangulation, and cell phone tower triangulation.
waner michaud wrote: this is an anti-kidnapping small app. That matters little; you could still abuse the technology and do something illegal. I can't tell from here, can I?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I am new to VB.net but have been doing ok developing a personal project so far.... since yesterday... The problem is that I got stuck when trying to read the row count of a datagrid that has more than 1500 rows filled with data. The result that I am getting is form2.datagridview1.rows.count - 1 = -1. Which makes no sense since the datagrid is plenty of rows.
Something that I must say is that this datagrid belongs to form2 (a second form that pops-up and shows the datagrid when I call it from From1).
Any thoughts on what could be possibly happening?
Thanks for any advice or comment on this matter.
PS: I'll post my code as soon as I get home
|
|
|
|
|
Actually what I want is to perform a reverse loop search from the last row of the datagrid to the first one.
When I try to obtain the las row index, I always get zero....
|
|
|
|
|
Can you copy/paste the code into your message, formatted with PRE tags?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I just figured out that I had to connect again to the database and count the rows of a new created dataset.
I was getting 0 rows because even if the datagrid was full of data, that data came from a previously created dataset that was no longer available. So I really was referencing to a "empty" datagrid.
Problem solved.
Thank you.
|
|
|
|
|
I have an Access database for which I'm trying to write a query based on a request from the users.
I have a table of data related to artwork, with three columns: ArtworkId, DescriptionText, and CalloutNumber. Each piece of artwork can have more than one DescriptionText value.
What would be a good way to write an SQL query to return, for example, all ArtworkId records having both DescriptionText = "Start Switch" and DescriptionText = "Stop Switch" records?
ArtworkID / DescriptionText
123 / Motor
234 / Fuse
234 / Start Switch
456 / Stop Switch
789 / Start Switch
789 / Stop Switch
789 / Light
Result = ArtworkID 789
Any assistance will be greatly appreciated. Thanks!
|
|
|
|
|
I think the follow query would do what you want:
SELECT ArtworkID
FROM Artwork
WHERE DescriptionText In ("Start Switch","Stop Switch")
GROUP BY ArtworkID
HAVING COUNT(*)=2;
|
|
|
|
|
Thanks. I tried something similar this afternoon, but it didn't work. I'll try your idea tomorrow.
|
|
|
|
|