|
So you want to multiply the value in the control by 0.25 and round to two decimal places before you store it in the database?
cmd.Parameters.AddWithValue("@Depreciacion", Math.Round(CDbl(Me.NudDepreciacion.Value) * 0.25, 2))
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank u again but now the number is registered without a coma.
|
|
|
|
|
If it's a number, then you should be storing it as a number. Don't store numbers as strings!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
ok thank u. i wrote the code with the correction that u told me.Now, I wanna know how to store the result of depreciation with a coma that separates decimals because is storing the result without a coma.
|
|
|
|
|
DO NOT STORE NUMBERS AS STRINGS!
Numbers do not have "commas" or other formatting information. They are just numbers.
1,234.56 is the same as 1234.56 , which is the same as 1234.5600 . They are all the same number.
If you're trying to store formatted values in your database, then you're doing it wrong.
Store values in the correct data type, and format the values in the user interface.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Listen to what Richard is saying, if not you are in for a world of pain in the future. Apply the same rules to dates, DO NOT STORE DATES AS STRINGS. Store them as date or datetime data type.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Hello !
I'm using entity framework
Is there any way to count how many database hit were made ?
( The reason why I make this question, is because i'm using a 3d party software that add some commands to Entity Framework. One of these is that several different queries (the software claim) are executed using a single database hit. I want to verify this.)
Thank you !
|
|
|
|
|
If you can't tell the difference, what does it matter?
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
I want to know if this software is telling the truth or no , if yes I want to use it.
|
|
|
|
|
Everyone lies.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
|
It is quite possible to send multiple queries in a single request, look up "Little Johnny Tables", that is called sql injection.
You can also get multiple result sets returned in a single request using a dataset, although this was painfully slow when I last looked (about 6 years ago).
If you are using SQL Server then sql profiler will allow you to inspect each call to the database.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
i'm trying a 3d party tools Query Future | Entity Framework Plus[^]
But i'm not sure if it's true what this tool claim to do ?
The sql profiler it says : exec sp_executesql N'---EF+ Query Future 1 of 5....... .After there are 5 queries (I have 5 query that are executed with Future)
But i don't know if these queries are executed in a single database hit ?
|
|
|
|
|
There are several options:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello !
I'm using Entity Framework 6 with sql server 2008r2 database.
I want to get from database only those records that have vl1>5.( i need to get from database only those objects that have vl1>5 and not to read all the objects and after to apply the condition )
I have 2 queries :
Dim query1 as IeQueryable(of myobj)= (From t in context.myobjs Where vl1<5).Tolist
Dim query2= (From t in context.myobjs.Asqueryable Where vl1<5).Tolist
Are these queries doing the same job that i want ?
|
|
|
|
|
What happens when you try them?
|
|
|
|
|
desanti wrote: and not to read all the objects and after to apply the condition ) Then use an SQL query and execute your statement on the server, instead of using an ORM.
The only difference between the first and second version is the "Asqueryable" part in the second statement; that statement has nothing to do with "where" the query executes. So, to answer, yes, they're doing the same job. Not sure if it's what you want though.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
can someone help me fix my code? i'I'm having problem deserializing the xmlcode save on my database. i can save FMD on database by using Fmd.SerializeXML() but when i'm going to extract record on database i use Fmd.DeserializeXML() but i'm having error. I'm stuck with it.
here is my code.
Public Sub OnVerify(ByVal captureResult As CaptureResult)
' Check capture quality and throw an error if bad.
If Not Me.CheckCaptureResult(captureResult) Then Return
SendMessage(Action.SendMessage, "A finger was captured.")
Dim resultConversion As DataResult(Of Fmd) = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Formats.Fmd.ANSI)
If resultConversion.ResultCode <> Constants.ResultCode.DP_SUCCESS Then
Me.Reset = True
Throw New Exception("" & resultConversion.ResultCode.ToString())
End If
firstFinger = resultConversion.Data
'PULL FINGERPRINT RECORD FROM DATABASE
Dim FMDDataset As New DataSet
Dim DBconn As MySqlConnection = New MySqlConnection(connString)
Dim sql As MySqlCommand = New MySqlCommand("SELECT * " & _
" FROM tbl_fr ", DBconn)
DBconn.Open()
Dim DataAdapter As MySqlDataAdapter = New MySqlDataAdapter()
DataAdapter.SelectCommand = sql
FMDDataset.Clear()
DataAdapter.Fill(FMDDataset, "tbl_fr")
DBconn.Close()
If FMDDataset.Tables("tbl_fr").Rows.Count > 0 Then
Dim counter As Integer = 0
Dim fp1, fp2 As String
fp1 = Fmd.SerializeXml(resultConversion.Data)
Dim byteS As Byte()
'data from database
byteS = FMDDataset.Tables("tbl_fr").Rows(0).Item("frp")
'im having error on this line of code
'DP_INVALID_PARAMETER: Data at the root level is invalid. Line 1, position 1.
MatchFinger = Fid.DeserializeXml(Convert.ToString(byteS))
Dim resultConversionDATA As DataResult(Of Fmd) = FeatureExtraction.CreateFmdFromFid(MatchFinger, Formats.Fmd.ANSI)
Dim idResult As DPUruNet.IdentifyResult = DPUruNet.Comparison.Identify(firstFinger, 0, "resultConversionDATA", 2147, 2)
If (idResult.ResultCode = DPUruNet.Constants.ResultCode.DP_SUCCESS) Then
If (idResult.Indexes.Length >= 1) Then 'Found potential match, dont search second collection (speed optimized)
MsgBox("RECORD MATCH")
Else
MsgBox("RECORD MISMATCH")
End If
End If
counter = counter + 1
Me.BindingContext(FMDDataset, "tbl_fr").Position += 1
Loop While (counter <= FMDDataset.Tables("tbl_fr").Rows.Count)
End If
End Sub
HERE IS MY SERIALIZED DATA SAVED ON MY DATABASE.
'1, 1, '<fid><bytes>Rk1SACAyMAABuAAz/v8AAAFlAYgAxQDFAQAAAFZEgKsAzXlTgMUAzn1TgL8Ae5FSQCUAtiJSgEoA9RdSgHcAsHhSgRQArTJQgQgBCSVPQOgAj4lNgQ0AwINMQEgAkR1MQ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HIBQQ05gEABH145gDcBKgg5QCwA5Rc4gI8BLGQ3QLEBaW03QD8BNQA3gB0Aqoo2QFcAy2c2QQIAPaM2AAA=<format>1769473<version>1.0.0'
|
|
|
|
|
That still does not look like XML.
|
|
|
|
|
i have entered data in database using vbnet from form1
created combobox and text1, text2,,, etc in form2
how to use value of combobox and connect to table as and enter data ...
pl. helpme
modified 16-Aug-19 1:07am.
|
|
|
|
|
|
Is the a method to programmatically open the "Windows Settings" form (in Windows 10) from vb.net, as though you did it from the Start Menu?
|
|
|
|
|
To open the settings home page:
System.Diagnostics.Process.Start("ms-settings:")
If you want to go to a specific page, you just need to append an extra string to the URI:
Launch the Windows Settings app - Windows UWP applications | Microsoft Docs[^]
Eg: To launch the "default apps" page:
System.Diagnostics.Process.Start("ms-settings:defaultapps")
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|