|
Hi,
Please try the following code and if this helps.
Dim datatable As New DataTable
datatable = mydataset.table(0)
Dim minimum_run as Integer = 0
If Not (datatable.Rows.Count = 0) Then
minimum_run = CType(datatable.Compute("MIN(run)", ""), Integer)
End If
I hope this would be helpful.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
John_Adams wrote: minimum_run = CType(datatable.Compute("MIN(run)", ""), Integer)
That would change the type of the result, but it doesn't change how the values in the data table are compared.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
The first two lines of your code should read:
Dim dataTable As DataTable = mydataset.Tables(0)
What your original code did was create a new instance of a DataTable object, then immediately abandon it and point the datatable variable at an already existing instance of another DataTable object.
|
|
|
|
|
Your data in the table is text, not numbers. The string value "100" is smaller than "99", so the result that you get is correct.
If you want to compare the values numerically, you have to change the data type in the data table.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thanks to all for having look at my post and reply.
Now i have understood the problem(The data type was string and have to convert in integer)
Thanks once again
|
|
|
|
|
hai
I have created a Main Form in vb.net(windows application) in that main form i have 4 Link buttons like Register,QuoteReq form etc.. when i click the register Link that will go to the Register form..the code wt i used there is
Dim obj as New RegForm
obj.show()
wen i run it is going to the regform but that is opening in a seperate window...For every click a seperate window is opening..i want the new form in the same window only....can any one help....
|
|
|
|
|
you want to open the form in mdi form or you want to open just new form
|
|
|
|
|
In the same window a seperate form has to open..
suppose in my Form1 i have Register, QuoteReq,PaymentForm like that links are there. when i click Register link the page has to be redirected to Register form which is a new one.... I want the new form to be open in the same window ...The design for all the forms are same... only controls are different...
|
|
|
|
|
Then you do what you are already doing, though you have to Hide the form that launched this new form. Something like:
Dim newForm As RegisterForm
Me.Hide()
newForm.Show()
|
|
|
|
|
Why not use a tab control?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I'm trying to create a VB User Control that can be used in a WEB page particularly IE7. The control is to be used Client Side and read the Computer & User Name. Can this be done?
I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.
I've created many VB6 ActiveX user controls that can be used to read data in this way when embedded in a WEB page but now need a .NET solution.
I'd appreciate any help with this problem.
Regards
Andy Dale
|
|
|
|
|
Andy Dale wrote: I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.
But did you add the site to the Trusted Sites list in IE?? I would appear that the control is trying to grab information that is normally off-limits to any code running in a browser window.
Beyond that, I have no idea since I've never done what you're trying. About the best I can do is point you at this[^]. You might be able to gleen something useful from something in that list.
You might also find "How Internet Explorer determines permissions for .NET Framework assemblies"[^] useful too.
|
|
|
|
|
Can any one please tell me how to find the keypress of F2.since functional keys dont have ascii values is there any other way..
|
|
|
|
|
You could use KeyDown event.
in vb6 you can use the const vbKeyF2 (or its value 113 (&H71))
|
|
|
|
|
|
I want to insert the Row at the last row of the data grid but in insert it at the top of the datagridview
i am trying to enter the row like that please help me
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add()
i = i + 1
|
|
|
|
|
Hi,
Please try the following code snippet:
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add(lastrowindex+1)
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Member 4733561 wrote: dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
Will this not _always_ give you the GrossTotal for values in Row 0? Should it not be Rows(i)....?
|
|
|
|
|
i have a problem in my scripts of QuickTestProfessional tool.
i have an application with design surface.Controls are dragged and dropped above the panel.In the script i iterate thru each and every control placed on panel.
How can i get the class type of Control? How will i set values to methods of the control?
The script for that is as follows...In 2nd statement i have 4 params to be passed in update property .While execution, control name doesnt change with update property.
set myControl=swfwindow("aaa* BT????????????").Swfobject("Panel1").Object.Controls.item(i)
myControl.updateproperty "Name",null, "dhdugf","hdsf"
set childern1= swfwindow("aaa* BT????????????").Swfobject("PropertyGrid").Object.item
Dim nme1
Dim ichild
For j= 0 to childern1.count-1
ichild=childern1.item(j).value
ichild= "AAAAAAA"
nme1 = childern1.item(j).name
msgbox nme1 & " :" & childern1.item(j).value
Next
Any inputs???.....
|
|
|
|
|
I think you'd be better off asking HP about issues with QTP. I've never used it, and it's quite likely that anyone else who has used it will see your post.
From your code sample, it looks like your asking about using the UpdateMethod property of some object, though I can't figure out what that object it. I do know it's not anything to do with VB6 or VB.NET. You're best source of information is going to be the manufacturer of the library(s) you're using.
|
|
|
|
|
I have been trying to import some data from a datagrid into MSexcel . Everything works fine but for some characters like
€
¥
£
etc . it would import some junks characters instead
can someone let me know if i am missing something
|
|
|
|
|
Determine which part of the process is causing the issue. It might be the excel worksheet's column not formatting the cell properly, or it might be the way you're passing the values from your app.
Try writing to a normal text file first to see the outcome.
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
The values from the app are being passed in the correct manner , It works fine if imported to a txt file. How do i overrule the excel cell formatting
|
|
|
|
|
I want to turn off / on my screen using vb 6.0. Can any body help me out? How to do it?
Kiran Sajanikar
Pune.
|
|
|
|
|
If you consider that Windows has the ability to hibernate your computer and monitor, then you could implement the same API call in your application.
I have no idea what this API function is called or what DLL it comes from, but try searching for it on google.
Daniel Minnaar
Lead Software Developer
|
|
|
|