|
i ve deleted the .ldb file yet the database could not be opened
t.aransiola
|
|
|
|
|
Hi there,
was giving a task today to find out how to make a program where we have 3 text boxes and it sorts the numbers in these boxes into asceding/discending order but im kinda having trouble with it, tryed searching but couldnt find anything. can someone lend a hand or point in the direction to go
also here is a screenshot
http://www.ultima-ws.ath.cx/files/vb.jpg
thanks
Option Strict On
Public Class Form1
Dim rlmemory1 As Single
Dim rlmemory2 As Single
Dim rlmemory3 As Single
Dim rlinput1 As Single
Dim rlinput2 As Single
Dim rlinput3 As Single
Private Sub btnAsc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAsc.Click
rlinput1 = CSng(txtInput1.Text)
rlinput2 = CSng(txtInput2.Text)
rlinput3 = CSng(txtInput3.Text)
rlmemory1 = rlinput1
rlmemory2 = rlinput2
rlmemory3 = rlinput
If IsNumeric(txtInput1.Text) = False Then
MsgBox("Please input numeric value to input1")
ElseIf IsNumeric(txtInput2.Text) = False Then
MsgBox("Please input numeric value to input2")
ElseIf IsNumeric(txtInput3.Text) = False Then
MsgBox("Please input numeric value to input3")
End If
If rlmemory3 > rlmemory1 Then
txtInput1.Text = CStr(rlmemory3)
txtInput3.Text = CStr(rlmemory1)
End If
If rlmemory2 > rlmemory1 Then
txtInput1.Text = CStr(rlmemory2)
txtInput2.Text = CStr(rlmemory1)
End If
If rlmemory3 > rlmemory2 Then
txtInput2.Text = CStr(rlmemory3)
txtInput3.Text = CStr(rlmemory2)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rlmemory1 = 0
rlmemory2 = 0
rlmemory3 = 0
End Sub
End Class
-- modified at 12:29 Tuesday 10th October, 2006
|
|
|
|
|
Try this:
Dim storagelist(2) As String
storagelist(0) = me.textbox1.text
storagelist(1) = me.textbox2.text
storagelist(2) = me.textbox3.text
Array.Sort(storagelist)
This will sort the three textboxes in an array
|
|
|
|
|
|
just noticed it only works with single digits any way to make it more. i.e when i input "1""3""22" it will ascend it to "1""22""3"
|
|
|
|
|
I am about to start a new project that requires using SQL statements. Where as before, I concatanated my SQL statements within VB.net, is there a better way of doing this. I read in some articles that this is not good practice. Should I start using stored procedure methods or use string builder. Any user experiance would be appreciated
What are the pros and cons of doing it my way or should I start doing it different or just continue as before.
|
|
|
|
|
You should use Procedures. Try googling Parameterized Queries.
Mike Lasseter
|
|
|
|
|
Stored procedures are often the best way to go, but you will be limited in how you can create your SQL statements. A stored procedure has to be able to be compiled when saved, which means the compiler needs to know the fields to retrieve/update and the criteria to use when exucuting the procedure. With highly dynamic SQL, this is often not an option.
In short, use a stored procedure if possible. Another option is to create SQL views and call those to retrieve data. If you're going to process the views though (i.e. retrieve a subset of data from a view), wrap that code in a stored procedure if possible.
james
commercial developer, author, speaker, dude.
www.jamesfoxall.com
|
|
|
|
|
I am writing a program that display a report with the help of Crystal report.
My main report is very fine but my 2 sub reports wouldn’t show data. What is wrong?
Also I have two logos on the report. One of them is constant but the other a .jpeg file needs to be changed at run time. How can I do this?
I am using crystal Report XI and my database is in MS Access.
Thanks you for your help.
ihe
|
|
|
|
|
Check the joins of your query providing the data to your sub reports. Chances are you have linked 2 or more tables together, but one of them has no related data. If this is the case, then change the link to Always show data from the main table.
Steve Jowett
|
|
|
|
|
Please your explanation is unclear to me.
The query for the main report is
SELECT ComplusoryFields.CFactor, ComplusoryFields.MudWeight, ComplusoryFields.CirculationRate, ComplusoryFields.CurrencyForMudCost, ComplusoryFields.WellName, ComplusoryFields.ReportType, ComplusoryFields.DataDate, DataIdentity.DataID, ActivitityRemarks.Remark, DrillingMudProperty.Alkanity, DrillingMudProperty.API, DrillingMudProperty.Chlorides, DrillingMudProperty.FlowLineTemperature, DrillingMudProperty.Gel0Mins, DrillingMudProperty.Gel10Mins, DrillingMudProperty.HTHPFilterates, DrillingMudProperty.MBT, DrillingMudProperty.YP, DrillingMudProperty.PV, DrillingMudProperty.MudWeightIn, DrillingMudProperty.MudWeightOut, DrillingMudProperty.Water, DrillingMudProperty.Solids, DrillingMudProperty.Oil, DrillingMudProperty.AveROP, DrillingMudProperty.MaxROP, DrillingMudProperty.VIS, DrillingMudProperty.ShaleDensity, DrillingMudProperty.ShaleFactor, DrillingMudProperty.FlowLineTemperatureScale, DrillingMudProperty.pH, MudWeightChanges.Depth, MudWeightChanges.OldMW, MudWeightChanges.NewMW, PressureLosses.DxC, PressureLosses.EMWLOT, PressureLosses.EstOverBalance, PressureLosses.EstFratureLoss, PressureLosses.EstPorePressureLoss, PressureLosses.MWDPressureLoss, PressureLosses.PipeRunSpeed, PressureLosses.CasingShoePressureLoss, PressureLosses.DxTrend, PressureLosses.EMWLOT2, PressureLosses.EstFratureLoss2, PressureLosses.EstPorePressureLoss2, PressureLosses.HydrostaticsPressure, PressureLosses.HydrostaticsPressure2, ReduceCirculatingRates.Pressure, ReduceCirculatingRates.SPM, ReduceCirculatingRates.Pump, Reports.ADT1, Reports.ADT2, Reports.Operator, Reports.Contractor, Reports.TVDDepth, Reports.MDDepth, Reports.Rig, Reports.Operation, Reports.ImagePath, Reports.SpudDate, ComplusoryFields.MudCost_Notes, ComplusoryFields.MudCost_Coins
FROM Reports RIGHT JOIN ((PressureLosses RIGHT JOIN (MudWeightChanges RIGHT JOIN (DrillingMudProperty RIGHT JOIN (ActivitityRemarks RIGHT JOIN (ComplusoryFields RIGHT JOIN DataIdentity ON ComplusoryFields.DataID = DataIdentity.DataID) ON ActivitityRemarks.DataId = ComplusoryFields.DataID) ON DrillingMudProperty.DataID = DataIdentity.DataID) ON MudWeightChanges.DataID = DataIdentity.DataID) ON PressureLosses.DataID = DataIdentity.DataID) LEFT JOIN ReduceCirculatingRates ON DataIdentity.DataID = ReduceCirculatingRates.dataId) ON Reports.DataID = DataIdentity.DataID;
The query for the subrepotA is
SELECT DataIdentity.DataID, DrillingPumps.PumpNumber, DrillingPumps.RodDiameter, DrillingPumps.StrokeLength, DrillingPumps.Efficency, DrillingPumps.PumpOutPut, DrillingPumps.PumpSize, DrillingPumps.LinearDiameter, DrillingPumps.PumpType, DrillingPumps.PumpStatus, ComplusoryFields_1.DataDate, ComplusoryFields_1.ReportType, ComplusoryFields_1.CurrencyForMudCost, ComplusoryFields_1.CirculationRate, ComplusoryFields_1.MudWeight, ComplusoryFields_1.CFactor
FROM DataIdentity LEFT JOIN (DrillingPumps RIGHT JOIN ComplusoryFields AS ComplusoryFields_1 ON DrillingPumps.DataID = ComplusoryFields_1.DataID) ON DataIdentity.DataID = ComplusoryFields_1.DataID;
And The query for the subrepotB is
SELECT BottomHoleAssembly.HoleOrCasingType, BottomHoleAssembly.HoleInnerDiameter, BottomHoleAssembly.PipeOrCollarType, BottomHoleAssembly.PipeInnerDiameter, BottomHoleAssembly.PipeOuterDiameter, BottomHoleAssembly.PipeAndCasingLength, ComplusoryFields.CFactor, ComplusoryFields.MudWeight, ComplusoryFields.CirculationRate, ComplusoryFields.CurrencyForMudCost, ComplusoryFields.WellName, ComplusoryFields.ReportType, DataIdentity.DataID
FROM (BottomHoleAssembly RIGHT JOIN ComplusoryFields ON BottomHoleAssembly.DataID = ComplusoryFields.DataID) RIGHT JOIN DataIdentity ON ComplusoryFields.DataID = DataIdentity.DataID;
All tables are joined by a DataID .The DataIdentity table suppies the DataID to use
ihe
|
|
|
|
|
I have been looking into creating a calculator that requires the user to type in what they want solved. Not order, no clicking buttons, and no parentheses. They type everything in, click a button, and poof. They get their answer. Obviously, this needs to follow the order of operations (PEMDOS). For the time being, i am not doing square roots or powers. I would like the user to be able to type in the stuff they want solved in infix notation, while it should be solved using RPN. I have problems coming up with code to convert it- probably because i dont entirely understand the conversion. Here is a link to what i found, which pretty much spells it out.
http://en.wikipedia.org/wiki/Shunting_yard_algorithm[^]
If anyone could help me with the code to convert infix notation to RPN, i would be very thankful. As of right now, this is what i have.
<br />
equation = txtequation.text<br />
length = len(equation)<br />
for i = 1 to length<br />
temp = mid(equation,i,1)<br />
tempstack.add temp<br />
output = output & temp<br />
next i<br />
but of course, that doesnt move stuff around.
|
|
|
|
|
I created a new class and inherited the windows combobox. I also created a TextChanged event for the combobox. Then compiled it into a dll. When I use the combobox in a windows project the TextChanged event does not fire. What do I need to do to get it to work?
|
|
|
|
|
Can you post your TextChanged event code? It might have to do with the way you are handling it (overloads, shadows, etc.)
james
commercial developer, author, speaker, dude.
www.jamesfoxall.com
|
|
|
|
|
Public Class Class1
Inherits System.Windows.Forms.ComboBox
Public WithEvents ComboBoxMain As New System.Windows.Forms.ComboBox
Public Sub ComboBoxMain_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
End Class
When the class is used in a windows project the gotfocus event never fires. What do I need to do to get this to work? Thanks.
|
|
|
|
|
Here's what appears to have happened:
You inherited a combo box - this is good. However, now your entire control is the combo box; you don't need to create another. You have also declared a combo box variable, but there is no need to do this and it will never fire because you haven't added the combo box to the Controls collection and therefor it isn't visible in the UI.
Try this:
1. Take out the Public Sub and Public WithEvents statements (and the End Sub, of course).
2. In the object drop down in the upper-left corner of the code window, select (Class 1 Events).
3. In the event drop down list in the upper-right corner, select GotFocus.
You will now have a GotFocus event that will fire appropriately.
|
|
|
|
|
That worked perfectly.
Thanks a lot!
|
|
|
|
|
You're welcome.
|
|
|
|
|
One other question about this. My combobox class has a gotfocus event. I drop that combobox class onto a form and create a gotfocus event in that form. Which gotfocus event runs first, the one back in the defining combobox class or the one in the form?
|
|
|
|
|
The one you defined in your class will fire before the event on the form.
|
|
|
|
|
Hi vb experts, I am jayachandra,
can anybody help me ? How to send the data from excel/access to oracle database through VB6 programatically? can anybody give thd code? please....
I will be thankful to you,
Jayachandra
|
|
|
|
|
how can i set class name of a desktop application in vb.net
i've tried to use CreateParams.Classname but error suggests
class name is not registered.
for that i've used
following apiz...
//start
Public Declare Function RegisterClass Lib "user32" Alias "RegisterClassA" (<marshalas(unmanagedtype.struct)> ByRef Class As WNDCLASS) As Integer
<structlayout(layoutkind.sequential)> Public Structure WNDCLASS
....
end structure
//end
mycls.lpszClassName = "myclass"
MsgBox(RegisterClass(mycls))
Dim Params As CreateParams = New CreateParams
Params.Caption = DOCSVAULT_IDENTITY_SMB
Params.ClassName = clsDVSMB.lpszClassName
Me.CreateHandle(Params)
still its givin error.. how to register class and set my applications class?
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
the below is an example of what you want.
<ProgId("DLLNAME.CLASSNAME"), Guid("C4CAB66D-291F-4bd7-9D5C-2E417AB75F49"), ComVisible(True), ClassInterface(ClassInterfaceType.AutoDispatch)> _
Public Class CLASSNAME
end public
|
|
|
|
|
Sir,
Can i programically find whether the sql server is installed or not in vb.net 1.1
Thanks
|
|
|
|
|
Sir,
Please explain the difference between byval and byref.
Thanks
|
|
|
|
|