|
|
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/v8AAAFlAYgAxQDFAQAAAFZEgKsAzXlTgMUAzn1TgL8Ae5FSQCUAtiJ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tos8gDABBhI8gIMBIA07gPMBaGw7gEoBCAY6QQIBTnA6gIwBVl46gLMBLWo5gHIBQQ05gEABH145gDcBKgg5QCwA5Rc4gI8BLGQ3QLEBaW03QD8BNQA3gB0Aqoo2QFcAy2c2QQIAPaM2AAA=<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
|
|
|
|
|
I am really stuck on this one. I have ObjXmlSimpleTypeDoc object which have two EnumerationValues. Each of EnumerationValue have child nodes.
I want to got values from child nodes of the correct EnumerationValue node.
To find the correct EnumerationValue I use the value in the variable strCourtNCIC. If the value in strCourtNCIC matches a EnumerationValue @code, that is the EnumerationValue I need. For this question strCourtNCIC hold a value MN010015J.
How do I do this in VB.NET?
Here is the objXmlSimpleTypeDoc object where I need to find EnumerationValue with @code = strCourtNCIC (MN010015J)
<SimpleTypeCompanion enumerates="CourtLocationTextType">
<EnumerationValue code="MN010015J">
<Text>Emily County</Text>
<AssociatedValue type="MNCISNodeID">
<Text>111</Text>
</AssociatedValue>
<AssociatedValue type="CountyName">
<Text>Emily</Text>
</AssociatedValue>
<AssociatedValue type="PhoneNumber">
<Text>724-820-7123</Text>
</AssociatedValue>
</EnumerationValue>
<EnumerationValue code="DC19DAKDC">
<Text>Pope County</Text>
<AssociatedValue type="MNCISNodeID">
<Text>112</Text>
</AssociatedValue>
<AssociatedValue type="CountyName">
<Text>Pope</Text>
</AssociatedValue>
</EnumerationValue>
</SimpleTypeCompanion>
Here is the VB.NET code that I need help with to just get the correct EnumerationValue with @code that matches strCourtNCIC (MN010015J).
strCourtNCIC = objXmlMNCISData.DocumentElement.SelectSingleNode("Case/Court/CourtNCIC").InnerText
objXmlSimpleTypeDoc = Msc.Integration.CourtXml.Library.v4.SimpleType.GetCompanionFile("CourtLocationTextType")
objXmlEnumerationValueNode = objXmlSimpleTypeDoc.SelectSingleNode("/SimpleTypeCompanion/EnumerationValue[@code=" + strCourtORI + "]/@code")
modified 12-Aug-19 11:56am.
|
|
|
|
|
Hello there,
I need help with something. I am preparing a project. I couldn't decide how to make a feature I wanted. I will be glad if you help me.
My project will be as follows;
I have 3 datagridview in Form1 and this datagridview is connected to each other with primary key. While loading the form, the data is loaded into the datagridview and I add a button with the code to the last column in the datagridview. When I click the button on any line, Form2 opens and loads the data in this form and connected to the primary key with 2 datagridview. This data is another table in the same database. I'm adding checkboxes to these datagridview. then I mark some records in datagridview, which are main and sub-table data, and when I press the close form button, it returns to Form1 and the selected data is saved to the tables to which the 2nd and 3rd datagridviews are connected by checking the duplicate records. When the installation is complete, the image in all datagridviewers is refreshed.
Note: I can't add a sample project here because I haven't started coding yet.
Thanks for your help.
|
|
|
|
|
Member 4523971 wrote: I will be glad if you help me. With what exactly?
Member 4523971 wrote: because I haven't started coding yet. Then you better get started; there's enough tutorials out there to at least have a form with a datagridview on it.
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.
|
|
|
|
|
Hi Eddy,
My English is not very good. I wrote the message using Google Translate. If there is an error, it is the error of the Translation program. I have codes for my project. but I was a bit confused with the code I wrote in order to do the operation I specified in my message. therefore I asked for help with the method. I keep working on it. Thank you for your interest.
Note: This is a Google translation.
|
|
|
|
|
I agree with Eddy ...
This is nothing which could be done by us - you have to start and code something ... and if there are SPECIFIC QUESTIONS you should come back and ask for that.
|
|
|
|
|
How to make a "Boss Key" in Vb .Net
|
|
|
|
|
By writing some code. Where are you stuck?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
You probably need a supply of metal and a large lathe.
|
|
|
|
|
Public Sub saveBookingData()
Try
boolSave = False
Dim rsSave As New ADODB.Recordset
With rsSave
sSQL = "Select * From Student_tbl Where RegNo = '" & strEmpID & "' "
.Open(sSQL, cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
If .EOF Then
.AddNew()
rsSave.Fields("RegNo").Value = strEmpID
rsSave.Fields("Student_Name").Value = txtName.Text
rsSave.Fields("Father_Name").Value = txtFather.Text
rsSave.Fields("City_Name").Value = comCity.Text
.Update()
MessageBox.Show("Record Successfully Saved ", "Record Saved", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Record Already Exist...", "Not Saved", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End With
Catch ex As Exception
MessageBox.Show(Err.Description)
End Try
End Sub
|
|
|
|
|
Yes, you can convert it. What is your question?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|