How can I manually add rows to datagridview.

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

Hello.
What is the elegant way to add rows to datagridview that is bounded to
bindingSource object.
(Only manually. I need sample code, please).

Thanks :)
 
Mr. X. said:
Hello.
What is the elegant way to add rows to datagridview that is bounded to
bindingSource object.
(Only manually. I need sample code, please).

Thanks :)

You would add new items to the object, if the object was a collection of
objects as an example were being bounded and rebind the object.
 
I think when I use bounded component - it is too complicated to handle it
manually,
so maybe I should give up, and use unbounded datagridView.

Thanks :)
 
Mr. X. said:
Also, I have heard of linq - don't know much about it.
Is linq a good solution ?

Yes Linq is a good solution. However, using Linq is about using objects and
OOP, which will force a change in your thinking on how develop .NET
solutions. I'll give you my spill on it, because the key to learning .NET is
do you understand OOP and how to use OOP.


What is Object-oriented-programming?

(OOP) is a programming paradigm that uses "objects" and their interactions
to design applications and computer programs.

The key concepts of OOP are the following:

Class

Object

Instance

Method

Message passing

Inheritance

Abstraction

Encapsulation

Polymorphism

Decoupling



http://en.wikipedia.org/wiki/Object-oriented_programming

No matter what development platform Java, .Net or others OOP is OOP.

http://math.hws.edu/eck/cs124/downloads/OOP2_from_Univ_KwaZulu-Natal.pdf

http://www.blackwasp.co.uk/ObjectOrientedConcepts.aspx


What are design patterns?

Design patterns are recurring solutions to software design problems you find
again and again in real-world application development. Patterns are about
design and interaction of objects, as well as providing a communication
platform concerning elegant, reusable solutions to commonly encountered
programming challenges.

http://www.developer.com/design/article.php/1502691

http://www.dofactory.com/Patterns/Patterns.aspx

http://computerprogramming.suite101.com/article.cfm/patterns_and_antipatterns

http://msdn.microsoft.com/en-us/library/ms954638.aspx

http://www.designpatternsfor.net/Presentations.aspx?tid=3&cid=4

What is Object Relational Mapping?

(ORM) is a programming technique for converting data between incompatible
type systems in relational databases and object-oriented programming
languages. This creates, in effect, a "virtual object database," which can
be used from within the programming language. There are both free and
commercial packages available that perform object-relational mapping,
although some programmers opt to create their own ORM tools.

http://en.wikipedia.org/wiki/O-RM

http://www.objectmatter.com/vbsf/docs/maptool/ormapping.html

What is Language Integrated Query?

LINQ is a Microsoft .NET Framework component that adds native data querying
capabilities to .NET languages.

Microsoft LINQ defines a set of query operators that can be used to query,
project and filter data in arrays, enumerable classes, XML, relational
database, and third party data sources. While it allows any data source to
be queried, it requires that the data be encapsulated as objects. So, if the
data source does not natively store data as objects, the data must be mapped
to the object domain. Queries written using the query operators are executed
either by the LINQ query processing engine or, via an extension mechanism,
handed over to LINQ providers which either implement a separate query
processing engine or translate to a different format to be executed on a
separate data store (such as on a database server as SQL queries). The
results of a query are returned as a collection of in-memory objects that
can be enumerated using a standard iterator function such as C#'s foreach.

Many of the concepts that LINQ has introduced were originally tested in
Microsoft's C? research project. LINQ was released as a part of .NET
Framework 3.5 on November 19, 2007.

http://en.wikipedia.org/wiki/Language_Integrated_Query

What is Linq-to-SQL?

LINQ to SQL, a component of Visual Studio Code Name "Orcas", provides a
run-time infrastructure for managing relational data as objects without
losing the ability to query. It does this by translating language-integrated
queries into SQL for execution by the database, and then translating the
tabular results back into objects you define. Your application is then free
to manipulate the objects while LINQ to SQL stays in the background tracking
your changes automatically.

http://msdn.microsoft.com/en-us/library/bb425822.aspx

What is ADO.NET Entities framework?

ADO.NET Entity Framework is an object-relational mapping (ORM) framework for
the .NET Framework. This framework is Microsoft's first ORM offering for the
..NET Framework. While Microsoft provided objects to manage the
Object-relational impedance mismatch (such as a DataSet).

ADO.NET Entity Framework is included with .NET Framework 3.5 Service Pack 1
and Visual Studio 2008 Service Pack 1, released on 11 Aug 2008. It also
includes the capability of executing LINQ against ADO.NET Entity Framework
entities

http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework

Here are two links that will help you too in your understanding of how it
all ties together. You should get both of the materials in the links.

http://www.pankaj-k.net/spubs/bookreviews/Head_First_Design_Patterns/index.html
http://www.dofactory.com/Framework/Framework.aspx
 
Back
Top