|
Well, in essenca I have an array with many millions of rows in it. These rows represent the daily closing (and other) prices for say 10,000 different stocks over say 20 years (20 years * 250 trading days/year). So there could be say 50,000,000 rows in the array.
Then I want to calculate, for instance, what would happen if I bought a stock when it fell below a moving average price and sold it when it went over that price. So I need to create the moving average for each stock and do some calculations.
But then, I need to do those calculations again, with a small change in the moving average (to see if that helps or hurts my profits), and then do this, again with a small change, many, many times.
The ONLY way to succeed is to hold the entire array in memory -- otherwise rereading the data from the disk on each new caculation makes everything way too slow.
|
|
|
|
|
Get a 64 bit machine load in 16gb of memory and go for it! I am surprised, most places don't retain 20yrs of data.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, could someone please help me, i am trying to copy a row from one DataGridView to another on a double click....I want the whole roe to be copied. In DataGridView1 i have an Access Database table bound to it. I got this code but it doesn't seem to work...Please Help,
Thanks!
Dim myTable As DataTable = Me.myDataSet.Tables(0)
myTable.Clear()
For Each row As DataGridViewRow In Me.dgvMain.SelectedRows
myTable.ImportRow(DirectCast(row.DataBoundItem, DataRowView).Row)
Next row
Me.myBindingSource.DataSource = myTable
|
|
|
|
|
I am trying to connect to a system using the admin id and password but i get this error (WMI)
Call was canceled by the message filter. (Exception from HRESULT: 0x80010002 (RPC_E_CALL_CANCELED))
does anyone have a clue what is this and how to get around this
|
|
|
|
|
hi,
hi i have to checkboxes in my form which are associated to two columns of table of bit value type... default they have null value..
for the select query i used isnull(col_val,0) as <alias name=""> for both columns to check the null values & replace with null
but when i save my record through adapter.update() the value not get saved into database...
what's the problem..
need help
|
|
|
|
|
It used to be that bit values could not be null depending on your database or connection this may be the case. Bit = boolean eg 1 or 0
I beleive this has changed in later versions of SQL Server but I may be wrong. If you need a 3 valued field ie Null, 0 , 1 use an interger. and use -1,0,1
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i need to check against null value if not then assign 0 or 1..
i am using sql server 2005
|
|
|
|
|
ok post your select statement becuase IsNull is the correct function to deal with this issue.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ok here is the query....
for all values i clear the bind first then bind them thru appropriate columns... i debug all values agre going to dataget..just after adapter.update(dataset) ..value doesn't updated to database..
"select pra_key,ClientAddCode,Name,Address1,Address2,City,Country,Pin,ResTel,ResFax," & _
"ResEmail,OffTel,OffFax,OffEmail,OffExtn,Mobile,ITPAN,RegDate,isnull(IsError,0) as IsError,isnull(IsBlock,0) as IsBlock,isnull(ParentCode,'') as ParentCode,ResidentialStatus,offadd1,offadd2," & _
"offaddcountry,offaddpincode,dob,occupation," & _
"educationalqlfy, offaddcity,clientcategorycode,SubBranchCode,PoAMandate," & _
"WebXCode,FASubTypeCode,UINo,agmtsrno,state,clnttype,intfirstname,intmiddlename,intlastname," & _
"relationshipwithclient,intclientcode,offaddstate,internettrading,directclient,RMCode,SubGroupCode,poadate," & _
"bankcertificate,employeecode,contactperson,paymentprocessing,creditlimit," & _
"creditlimitamount,paymentmethod, ucccategory,ioischarges,ioholdcharges, " & _
"digitalcontracts, frontofficeupload, internettradingupload, frontofficedealer, deactivate, " & _
"deactivationdate, paymenthold, interesttype, interestjv, paymenttype, runningaccountletter, " & _
"rmsgroup, region, clientcashtosharesratio from clientaddmaster where clientaddcode=@clientaddcode"
|
|
|
|
|
This is what I would do:
1. Open SQL profiler to determine *exactly* what SQL statement is being sent to the database. If needed, you can pause the recording and turn it on just prior to running your update.
2. Open up SQL Management Studio. Copy and paste the update statement from profiler.
3. Execute the statement. Determine what part of the statement is hosed and fix it.
4. Go back to VB and correct the code to match the working statement in step 3.
Profiler will show you exactly what is being sent to and from the databases - versus you think is being sent.
|
|
|
|
|
So presumably you are building a sql string and using that in the adapter.update. Your error is fairly obvious, if you are using SQL management studio you should actually open sql profiler and look at the string that is passed to sql server.
Copy the string from the debug immediate or command window and paste it into SQL query tool and see what you get.
Hint - you must do all the data manipulation BEFORE it gets into the string, IsNull is a SQL function and you are passing it in as a string.
Suggestion - strong one, get to know stored procedures or at least parameterised queries thay will save you a lot of heartache in the future.
Actually I have no idea what would be going through as I NEVER use the adapter select/update methods.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Hint - you must do all the data manipulation BEFORE it gets into the string, IsNull is a SQL function and you are passing it in as a string.
Suggestion - strong one, get to know stored procedures or at least parameterised queries thay will save you a lot of heartache in the future.
Amen!
Stored procedures are the way to go and really are not that hard to put together. Read a couple SP guides/tutorials and you'll be on your way.
|
|
|
|
|
I would like to hide the GUI in access. I have created a database, replaced access splash screen, but I want to prevent the access GUI from showing. How is that done? In other words, I want only the forms that I have created to be visible. The entire MS access GUI should be hidden including the menu bar. How is that done?
Jesus Christ is Lord - Give your heart to Him now.
|
|
|
|
|
What does this have to do with VB.NET? Are you talking about Access forms or Winforms?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I'd like to shoot the GUI in Access, as a matter of fact I'd like to shoot Access.
It is certainly possible to limit the ui to your forms and controls (used to be) but I can't remember how. I think it was a combination of disabling options and making object visible=false.
Can you still compile Access to an MDE.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Open up the database and go to Startup on the Tools menu, then uncheck the "Show Database Window" option. You can also switch off the standard Access toolbars.
Pleae note that this is not especially secure - if the user holds down the shift key when starting up the database it shows the database window etc.
If you want to prevent this, look here for code to do it:
http://www.mvps.org/access/general/gen0040.htm[^]
====================================
Transvestites - Roberts in Disguise!
====================================
|
|
|
|
|
Hi all,
i need to calculate my paper length using a formula ( label_total_length.text = text_length.text *text_width.text), and after that enable to save the changes.
the query : Dim DimensionData As New SqlClient.SqlCommand(" UPDATE Dimension SET total_length = '"&label_total_length & " ')
but when the save button was clicked it show the syntax error : converting the varchar value '2,076 ' to a column of data type int.
at sql server i set the total_length data type as int
how i gonan fix the prob??
|
|
|
|
|
mistyfy wrote: label_total_length.text = text_length.text *text_width.text
You cannot do that. You have to convert the text to some numerical datatype, then do the math
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi Paul Conrad, may i have the detail on this?? some coding guide perhaps. thanks!
|
|
|
|
|
mistyfy wrote: may i have the detail on this?
Read up on type casting.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
mistyfy wrote: total_length = '"&label_total_length & " '
if total_length column is int, you cant use signle quotes. Single quotes are only used for varchar columns.
|
|
|
|
|
i tried to remove the single code but i stil got the error message that figure after the comma can't be save!!
|
|
|
|
|
Are you formating that numeric value? thats why the comma is there in the fist place right? Just reformat the value to remove the comma, or save the value in a variable before you formated that number.
|
|
|
|
|
'2,076' is a varchar data type 2076 is an integer - this is the frst issue
use convert or cast - read BOL for the details.
mistyfy wrote: SqlClient.SqlCommand(" UPDATE Dimension SET total_length = '"&label_total_length & " ')
SqlClient.SqlCommand(" UPDATE Dimension SET total_length = " + label_total_length.tostring())
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I created a few user controls. I created a separate class which contains a few data all these controls need
Public Class CExtraData
Private value1M As String
Private value2M As String
Public Property Value1() As String
Get
Return Me.value1M
End Get
Set(ByVal valueA As String)
Me.value1M = valueA
End Set
End Property
Public Property Value2() As String
Get
Return Me.value2M
End Get
Set(ByVal valueA As String)
Me.value2M = valueA
End Set
End Property
End Class
Every UserControl has an instance of a class as property such as
Private extraDataM As New CExtraData
Public Property ExtraData() As CExtraData
Get
Return Me.extraDataM
End Get
Set(ByVal valueA As CExtraData)
Me.extraDataM = valueA
End Set
End Property
If I use the UserControl in a form I would like to set the properties of the UserControl
... .ExtraData.Value1
... .ExtraData.Value2
by the designer. The property "ExtraData" shows in the property list of the designer but it is deactivated.
I tried following solutions:
+ Added "<serializable()>" in front of the definition of the class "CExtraData"
<serializable()> Public Class CExtraData
...
But it did not help.
+ Added Disigner-Attributes in front of the Property "ExtraData" in the UserControl:
< System.ComponentModel.Localizable(True), _
System.ComponentModel.DesignerSerializationVisibility( _
System.ComponentModel.DesignerSerializationVisibility.Content) > _
Public Property ExtraData() As CExtraData
...
But it did not help.
How can I solve it?
Michael
|
|
|
|
|