vb.net - accessing database, messagebox says "System.Data.EnumerableRowCollection1[Magazine_Project.MagazinesDataSet+tblMagaineRow]" -


I'm trying to use text in a certain field in a database file containing information about magazines (this one Text book), column header code, magnum, and cost I am trying to find and display the code "EX33" with the message box. This code is located in the first column under the category. However, when the messagebox pops up, it only says "System.Data.EnumerableRowCollection1 [Magazine_Project.MagazinesDataSet + tblMagaineRow]" . any idea? Sorry, this is my first time working with the database.

  Focus on the option of clear public option on the option Private Private frmmain_load (Object as sender, and EventArgs) MyBase.Load 'Handle' TODO: This line of code Loads data in the 'MagazinesDataSet.tblMagazine' table. You can move, or remove it, as needed. Me.TblMagazineTableAdapter.Fill (Me.MagazinesDataSet.tblMagazine) End Sub personal sub btnCode_Click (as the object, in the form of e EventArgs) btnCode.Click 'displays whose code field handles in EX33 dim strCode = MagazinesDataSet.tblMagazine In the Temp MessageBox.Show ("For the code you are looking for:" & strCode.ToString, "Magazine thingz", MessageBoxButtons.OK, MessageBoxIcon.Information) End sub sub sub btnName_Click (select the "EX33" from Temporary Temporary) Object as Sender, E EventArgs) btnName.Click displays as the handle whose Magname's Area Visual Basic End Sub Personal sub btnAll_Click (this is the form of the object, as in EventArgs) handle btnAll.Click displays all end sub-private sub-btnExit_Click (such as event, such as EventAGS) Click on Handles BTNXit. Close () and subset  

and class

One LINQ The query always returns IEnumerable (TK) of some details. If you want to get an item from that list, you can select first , first and default , single or SingleOrDefault The method can be used as appropriate.

It's still going to give you DataRow , so calling ToString is useless. If you want the value of a particular area in that row, you will need to retrieve it by name, either using the item property or field extension method.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -