.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> VB.Net >> Post New Question Subscribe to Interview Questions

How to find data with generics list in VB.NET (Write code).

Posted By :shah268     Posted Date :November 26, 2009    Points :10   Category :VB.Net 
In the code example below, the function "FindData" will return list("sublist") of the objects having matchingKey same as viewstate value.
Dim sublist As List(Of MyClass)
sublist = allClient.FindAll(AddressOf FindData) 'sublist will contain objects matching specified matching condition

Function FindData(ByVal b As MyClass) _
As Boolean
If (b.matchingKey = CInt(ViewState("matchingKey "))) Then 'matching condition
Return True
Return False
End If
End Function

You can also find related Interview Question to How to find data with generics list in VB.NET (Write code).  below: 

What is managed code and managed data?

Managed code is code that is written to target the services of the Common Language Runtime (see What is the Common Language Runtime?). In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic.NET, and _JScript.NET code is managed by default. Visual Studio.NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data-data that is allocated and de-allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and _JScript.NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio.NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class. (More...)

List out the areas in which data structures are applied extensively?

1.Compiler Design,
2.Operating System,
3.Database Management System,
4.Statistical analysis package,
5.Numerical Analysis,
7.Artificial Intelligence,
8.Simulation (More...)

Is it possible to set SessionState to readonly mode? Readonly mode means, we can only read data from session but we can not write any data in session variable?

Yes, it is possible.
EnableSessionState property has a value "Readonly" which actually makes the session state read only.

Thanks. (More...)

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

Set the DataMember property to the name of the table to bind to. (If this property is not set, by default the first table in the dataset is used.)
DataBind method, use this method to bind data from a source to a server control. This method is commonly used after retrieving a data set through a database query.

List commands to copy data from one table to another?

-Insert into select
-Select into

are the two commands to copy data from one table to another. (More...)

How do you write a function that can reverse a linked-list in C++?

void reverselist(void)
head->next = 0;
tail->next = head;
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur-> next = head;

for(; curnext!=0; )
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;

curnext->next = cur;

Please visit for any help: http://www.hiredotnetdeveloperindia.com/dot-net-development.php (More...)

Why we write the connectionString code?

This connectionstring code only connect with sql (More...)

How do we customize Data Contract Names for Generics types?

We can customize the generic datacontract names by allowing parameters. Find the Example below

[DataContract(Name = "Shape_{1}_brush_and_{0}_shape")]
public class Shape< Square,RedBrush>
// Code not shown.

Here, the Data Contract Name is "Shape_RedBrush_brush_and_Square_shape"
{0} - First Parameter in the generic type.
{1}- Second Parameter in the generic type.

What is the managed and unmanaged code in .net?

The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime's functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services. (More...)

Can code inside multiple catch block be executed?

No, Code can not execute in mutiple catch block (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend