11 1892 Rabbit 12,516
Recognized Expert Moderator MVP
You can't assign a list object to a dataview object.
so in this case how can I do this kind of research in my Datagrid?
Could you explain how to obtain the same result in this example here? -
Private Sub txtsearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsearch.TextChanged
-
-
Try
-
-
Dim txtstring As String = Me.txtsearch.Text
-
-
Dim dv As DataView = Me.DataGridView1.DataSource
-
-
dv.RowFilter = "StudentsName LIKE '%" + txtstring + "%'"
-
-
Me.DataGridView1.DataSource = dv
-
-
Catch ex As Exception
-
Throw ex
-
End Try
-
-
End Sub
-
Okay, thank you. But not exactly fills in the DataGrid I want. I want to make queries according what I type in the textbox.
Just like that I'm returning a List Of, I can not do this kind of query.
I want to take this research using BLL I created ... understand?
If I do it this way there is going to work. But would the design pattern that I am organizing.
Rabbit 12,516
Recognized Expert Moderator MVP
I have no idea what you said in post #7.
That's just to bind a dataview to the dataviewgrid. You will still need to do your filtering after it.
Sorry, my English is weak, because I'm from Brazil.
About the project, how do I list the data using my BLL class that returns a List of Students?
Using this model below .. -
Public Sub AllStudents()
-
-
_dset = Nothing
-
Try
-
_obj = New DALStudents()
-
_dset = _obj.AllStudents()
-
-
Dim objs As BLLStudents = Nothing
-
_liststudents = New List(Of BLLStudents)
-
-
For index As Integer = 0 To _dset.Tables(0).Rows.Count - 1
-
objs = New BLLStudents
-
objs.StudentsID = _dset.Tables(0).Rows(index)(0).ToString()
-
objs.CursoID = _dset.Tables(0).Rows(index)(1).ToString()
-
objs.EstudanteNome = _dset.Tables(0).Rows(index)(2).ToString()
-
objs.EstudanteEndereco = _dset.Tables(0).Rows(index)(3).ToString()
-
objs.Telefone = _dset.Tables(0).Rows(index)(4).ToString()
-
_liststudents.Add(objs)
-
objs = Nothing
-
Next
-
-
Catch ex As Exception
-
Throw ex
-
Finally
-
_obj = Nothing
-
End Try
-
-
End Sub
-
Rabbit 12,516
Recognized Expert Moderator MVP
Well, from your first post, it sounds like you're already listing the data. And it sounded like you were having problems filtering the data, not listing it. If you're actually having problems listing it, that's a completely different problem.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: ruca |
last post by:
Hi gurus,
How can I filter data in my DataSet and then put the result in a DataGrid?
NOTE: I'm reading a txt file into a dataset with 3 columns:
Id, Name, Age
I have this:
code------------------------------------------------------------------------
|
by: RockNRoll |
last post by:
I'm new to ASP.NET and need to filter a datagrid based on a textbox value.
I have a working datagrid and would like the WHERE part of my SQL statement
to call the value of a textbox and refresh the datagrid when a button is
clicked.
SELECT RateMatrix.Name, RateMatrix., RateMatrix.EC,
RateMatrix., RateMatrix. FROM RateMatrix WHERE
(. <= TEXTBOX_VALUE_GOES_HERE)
|
by: Juanjo |
last post by:
I have a datagrid with two temnplate columns. When a row is in edit mode the
each template columns show a dropdownlist (its datasource is a dataview).
I need to filter data of second dropdownlist when the user select an item of
first dropdownlist.
I have the event OnSelectedIndexChanged of first dropdownlist. I try to use
de rowfilter property of dataview with no exit.
Is posible to do this? How?
|
by: sg |
last post by:
Hi
I'm starting programming in visual studio and c# and i have a problem
with filtering datagrid. I build form with datagrid and i see data from
database. I find in microsoft web page information how to create
filtering data grid but this doesn't work. What I must change? My form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
|
by: Richard Fagen |
last post by:
Hi,
What are the best practices to filter a datagrid based on user input?
For example:
I want to display a grid with rows of sales information and allowed the
users to specify options (ex: customer and date ranges), then when they
click the 'apply filter' button, I want the rows filtered.
I've read about methods using a dataview with the rowfilter and sort
| |
by: thebison |
last post by:
Hi all,
I hope someone can help with this relatively simple problem.
I am building a timesheet application using ASP.NET C# with Visual
Studio 2003.As it is only a protoype application, my database has been
made in MSDE.
I have a 'View Resources' page, the purpose of which is to show all
employees, taken from that table in the database. This works fine, up
to a point. I have a DataGrid, which is done with a DataSet and a
|
by: datttanand |
last post by:
how to filter data in dataset?
suppose i want filter the data in dataset with perticuler city..
|
by: Mapi |
last post by:
I need help.
I am new to MS Access and have been assign this project.
I want to be able to filter data from a form that will be displayed on a subform.
I don't know if this is possible but ideally i would like to double click on a field from Form A which will open a subform and display filtered data based on the data's site code that was double clicked.
My database is for a budget tracker
|
by: ahd2008 |
last post by:
Hi everyone,
I have a form for departments and personnel. There are there fields for the sake of search:
DepartmentSearch as combo box
Division\UnitSearch as combo box
Number as combo box
the user should selcet values form those and press the button( I 'm usnig Macro) to filter data. So far, everything works fine but when re-select other values to look for other data it doesnt work!! it keeps giving me the same result
|
by: karan desai |
last post by:
I wanted to filter the data, make changes and the save back to the database.
The SQL data adapter and SQL dataset are clashing with TableDataAdapter i.e., db1TableAdpater and DatabseDataSet i.e GreetingDataset.
I wanted to make them working for the above purpose.
I am also open for other methods of executing the code.
Please help!
Here's the code.
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |