in Education by
I want to search a column of a datatable after values from a textbox. I want to search after ISBN-Numbers This is my Table "Book": DataColumn bookName = new DataColumn("BookName", typeof(string)); DataColumn bookId = new DataColumn("BookId", typeof(int)); DataColumn isbn = new DataColumn("ISBN", typeof(string)); //should be an EAN-13 Barcodeenter code here DataColumn book_authorId = new DataColumn("Book_AuthorId", typeof(int)); DataColumn bookprice = new DataColumn("Price", typeof(decimal)); DataColumn authorName = new DataColumn("AuthorName", typeof(string)); DataColumn authorId = new DataColumn("AuthorId", typeof(int)); DataColumn geschlecht = new DataColumn("Geschlecht", typeof(string)); Now, how can I only search the isbn, without I get values from the whole table? In a Listbox I want to have the Output. There I want to have all Values from the book where the ISBN Number contains the text from the textbox. My Code I have now to search after the isbn is the following: string isbn = _tbIsbnSuche.Text; string result = String.Empty; string file = _tempPath + @"\book_authorData.xml"; XmlTextReader r = new XmlTextReader(file); if (isbn != String.Empty) { _lbInformation.Text = String.Empty; _lBdatenOutput.BackColor = Color.LightGoldenrodYellow; _lBdatenOutput.Items.Clear(); _lBdatenOutput.Items.Insert(0, "Please Wait!"); _lBdatenOutput.Items.Insert(1, "Gefundene ISBN-Nummern:"); while (r.Read()) { if (r.Value.Trim().IndexOf(isbn) != -1 && r.Value.Trim().Contains("-") && r.Value.Length >= 13) { _lBdatenOutput.Items.Add(r.Value.Trim()); } } tim.Enabled = true; } else { _lbInformation.ForeColor = Color.Red; _lbInformation.Text = _suchfehler; } //Wenn keine Datensätze gefunden wurden if (_lBdatenOutput.Items.Count == 2) { tim.Enabled = true; _lBdatenOutput.BackColor = Color.OldLace; _lBdatenOutput.Items.Add(String.Concat("Es wurden keine Bücher welche in der ISBN-Nummer die Zeichenfolge ", "\"", isbn, "\"", " enthalten gefunden")); } But this searches all of the Dataset and when i have a value in an other field withch is the same as the search string, it appears in the search results too. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can access a DataRow's column via the name, e.g. row["ISBN"]

Related questions

0 votes
    I want to search a column of a datatable after values from a textbox. I want to search after ISBN ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I currently use a DataTable to get results from a database which I can use in my code. However, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I want to disable the sort property in dataTable API. I use bsort:false to disable sorting from all ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    Apologies if this question is answered elsewhere on StackOverflow, I did my best to search for an answer ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I am using datatable with Laravel to order a response that i receive from an API I connect to the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    ok I am trying to use the f:param here to pass the requestid as parameter to the review page. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    I am using this nuget UiPathTeam.WpfFormCreator.Activities, through which we could show a xaml form for user input by an ... } } }} Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    So I've seen a few posts describing this, but can't quite figure it out for my case. I used to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    Which of these values is returned by read() method is end of file (EOF) is encountered? (a) 0 (b) 1 (c) ... I/O & Applets of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these values is returned by read() method is end of file (EOF) is encountered? (a) 0 ( ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    A csv file consists of missing values that are represented by hashtags (“#”) and ampersands (“&”). How can you read this type of a csv file in R?...
asked Oct 16, 2020 in Technology by JackTerrance
0 votes
    I have bit a problem. I need insert to Array only (example) first array, best field by field. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I'm using TensorFlow Alpha 2.0. I have TFRecords files I'm reading from, each one holding a short ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Just started working with Python and I would like to know how to create a set only from user input ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    ____________ function can be used to select the random sample of size n' from a huge dataset. (a) ... Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
...