Saturday, July 23, 2022

datagridview to datatable

create datagridview to datatable

    Most Important

  1. How do I remove the empty row from the bottom of a DataGridView control?
  2. When I fill a DataGridView with data, there is always an empty row at the bottom. How do I disable this?

    Answer: myDataGridView.AllowUserToAddRows = false;

    Research

  3. How to make a DataTable from DataGridView without any Datasource?
  4. I want to get a DataTable from DataGridView of the Grid values. In other words DataTable same as DataGridView Values

  5. How to add a new row to datagridview programmatically
  6. if add row to DataTable DataRow row = datatable1.NewRow(); row["column2"]="column2"; row["column6"]="column6"; datatable1.Rows.Add(row); How about DataGridView??

  7. How to add a new row to datagridview programmatically
  8. How about DataGridView??

  9. How to generate a random string, and specify the length you want, or better generate unique string on specification you want
  10. How to generate a random string, and specify the length you want, or better generate unique string on specification you want

Friday, July 15, 2022

LiteDB application and Windows Form Basics

LiteDB

    datagridview to datatable to PDF file

  1. Convert string to packed ascii byte array
  2. Most important one for my project. it blows up in convert ASCII string to byte array.

    Convert string to packed ascii byte array

  3. Encoding.ASCII vs. new ASCIIEncoding()
  4. Are there any preferred scenarios and/or advantages/disadvantages when to use A or B?

  5. In C#, how can I detect if a character is a non-ASCII character?
  6. I would like to check, in C#, if a char contains a non-ASCII character. What is the best way to check for special characters such as 志 or Ω?

  7. The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
  8. Ever wonder about that mysterious Content-Type tag? You know, the one you’re supposed to put in HTML and you never quite know what it should be?

  9. ASCIIEncoding.ASCII.GetBytes() Returning Unexpected Value
  10. Why is the output not C0?

  11. How do I get Bin Path?
  12. Answer Path.GetDirectoryName(Application.ExecutablePath)

  13. How to make a DataTable from DataGridView without any Datasource?
  14. I want to get a DataTable from DataGridView of the Grid values. In other words DataTable same as DataGridView Values

    DatagridView Binding Basics

  15. Bind Objects to a DataGridView Control
  16. This article describes a simple approach to displaying object property data within a data grid view control. The example includes a test application comprised of a simple data container class and a sample application used to bind and display object data within a data grid view control. The value of the approach is to permit a developer to quickly display object data in tabular format, or to provide a convenient method for editing object data.

  17. Different Methods of Data Binding to a DataGridView
  18. This code explains different ways of generating data sets to be used as data sources for a DataGridView.

  19. Basic File IO and the DataGridView
  20. Create a versatile line reading application using the .NET StreamReader and the DataGridView.

  21. Exporting DataGridview To Excel
  22. How to export DataGridView data to Excel.

  23. DataGridView Class
  24. Displays data in a customizable grid.

    LiteDB

  25. LiteDB - download site
  26. LiteDB is a serverless database delivered in a single small DLL (< 450kb) fully written in .NET C# managed code (compatible with .NET 4.5 and NETStandard 2.0). Install it via NuGet or just copy the DLL to your bin project folder. LiteDB is a simple and fast NoSQL database solution. Ideal for mobile apps (Xamarin ready), desktop/local applications, application file format, web applications, and one database per account/user data store. Portable UWP and Xamarin iOS/Android, ACID transactions, single datafile (like SQLite), recovery data in writing failure (WAL mode), map your POCO class to BsonDocument, fluent API for custom mapping. Cross collections references (DbRef), store files and stream data (like GridFS in MongoDB), LINQ query support, free for everyone, including commercial use. LiteDB supports SQL-like language for data and structure manipulations. You can insert, update, delete or query your database using a very similar SQL relational language.
  27. My work with LiteDB
  28. Recently I was looking for a storage system for my program. This is a desktop application that creates many objects and searches for text in them. So I thought: "Why don't I try something new." Instead of an SQL database, I could use some kind of document database. But I didn't want to have a separate server, I wanted this database to work with a simple file. Search the Internet for this kind of databases for .NET applications quickly led me to LiteDB. And here I want to share my experience with this database.

  29. How to create .NET Standard library in Visual Studio 2015
  30. In this article I'll show how you can create in Visual Studio 2015 library compliant with some version of .NET Standard.

  31. LiteDB - A .NET NoSQL Document Store in a single data file
  32. A simple, fast and free embedded .NET NoSQL Document Store in a single data file. Inspired on MongoDB, supports collections, POCO classes, Bson Documents, indexes, stream data and LINQ expressions.

  33. LiteDb Review
  34. In this post, we will cover some use cases of LiteDB that I personally encountered to give you some perspective as to how and for what it can be used for.

  35. Embedded NoSQL database for .NET
  36. An open source MongoDB-like database with zero configuration - mobile ready

  37. Getting Started
  38. LiteDB is a simple, fast and lightweight embedded .NET document database. LiteDB was inspired by the MongoDB database and its API is very similar to the official MongoDB .NET API.

  39. falahati / LiteDBViewer
  40. LiteDB v5 contains an internal database browser and editor named LiteDB Studio.

    Therefore, this project will not continue into version 5 of LiteDB and if you need a viewer for your database please consider using LiteDB Studio.

  41. LiteDB Studio
  42. Update to LiteDB v5.0.8

  43. fastBinaryJSON
  44. A binary JSON serializer based on fastJSON (support for MonoDroid, netcore)

  45. Displaying JSON from PHP into a DataGridView using Json.NET
  46. Explaination of how to use JSON to get data from a remote server in C#.

    DataGridView Basics

  47. DataGridView Helper Class
  48. DataGridView Helper Class for Winforms

  49. DataGridView Event Sequences
  50. A useful tool to help you understand DataGridView events as you navigate the DataGridView

  51. Excel export from DatagridView
  52. A way to export data to native excel (xls) from a Datagridview with any data source

  53. DataGridView with hierarchical data binding
  54. The TreeGridView by Mark Rideout with data binding and sorting

    Windows Form Basics

  55. Windows Forms Events Lifecycle
  56. Today there are a large number of books covering .NET and Windows Forms. While most of these books discuss the essentials of working with Windows Forms and guide you well on your way to becoming proficient in developing Windows Forms applications, very few books cover a vital and much needed topic. And this topic is: the sequence of events that are triggered for a Form. Knowing the lifecycle of a Form can help you place important bits of code in relevant events.

  57. Top 10 Windows Forms Articles You Must Read
  58. Abstract: If you have missed on some top articles of Windows Forms on dotnetcurry.com, then this is a must read for you. The Top 10 articles have been decided by our editorial panel based on the popularity of the article, user rating and top views of the articles.

  59. Windows Form Programming Using C#
  60. Windows Form Programming for Begginers Using C#

    More Encoding stuff

  61. Strings and Encoding
  62. String is a type from the System namespace that is used for most of text related operations.

  63. We just launched a new site – Online List Tools – utilities for working with lists. Check it out!
  64. online ascii to bytes

  65. Convert from string to us-ascii in c#
  66. Strings in .NET already are Unicode, so there's no need to convert them from Unicode to Unicode. If you want to output a unicode escaped string, then try this:

  67. System.Text.Encoding Class
  68. Represents a character encoding.

  69. Encoding.Default Property
  70. Gets the default encoding for this .NET implementation.

  71. Correctly reading encoded text with the StreamReader in .NET
  72. I’ve got a list of my team members in a text file which I need to parse and process in .NET. The file is pretty simple – it’s called MyTeamNames.txt and it contains the following names:

  73. Does c# use ascii or unicode?
  74. Does c# use ascii or unicode?

  75. Convert String to ByteArray
  76. A String can be converted to Byte Array in few different ways. In .Net, every string has a character set and encoding. Encoding is the process of transforming a set of Unicode characters into a sequence of bytes.

  77. Character Encoding and Usage in .NET
  78. Understanding character encoding with the help of simple examples

  79. UTF-8 Character Encoding in .NET
  80. Every year or so I manage to uncover a gap in my knowledge as it relates to strings, character sets, and encoding. I have just started embracing this as part of the cycle of mastering (or attempting to master) any given topic. Whenever I feel the need I resort to the most fundamental mechanisms of learning. It is a simple act of reading, practice and memorization.

Wednesday, July 13, 2022

Project: Chart Engine

Project: Chart Engine

ellipse

  1. Working With Absolute Positions in .NET Graphics
  2. An absolute set of coordinates to simplify graphics in .NET.

  3. GraphicsDoubleBuffer
  4. This is a simple class designed to remove flickering from painting controls with gdi+

  5. How to Add Graphics to a C# Windows Form Application
  6. See how you can draw shapes, use colors, and render images in a WinForms app.

  7. 2D Poligon Drawer-Animator
  8. Draw poligons, manipulate them, and animate them.

  9. Drawing and Editing Lines with GDI+
  10. Here's the code to implement a basic graphic user interface to paint, and then edit, lines on a PictureBox.

  11. The myUML Project.
  12. This article explains the myUML project that provides a set of tools for the creation and manipulation of UML diagrams.

  13. The CFGLite Project
  14. The CFGLite Project, for managing configuration files in .NET

  15. Aqua Gauge
  16. A Gauge Control Developed using GDI+ with Aqua Skin

  17. Charts for Windows Application using C#
  18. Create charts using inbuilt functions of .NET Framework in window application and C#

  19. A rotating gauge
  20. An article on a custom control in the form of a rotating gauge.

  21. Two-Way Progress Bar
  22. A Progress Bar User Control that uses a couple of intermediate level ComponentModel properties

  23. Border Container
  24. A collapsable container control with complete header, border, and color customization. Also has the ability to utilize an 'Activation' button (like the 'Active Files' button you'll find at the top of every form in the Visual Studio IDE).

  25. Things to do in Graphics Land
  26. Basic and advanced graphics via C#.

  27. Elliptical/Circular Button
  28. Learn how to draw an Elliptical/Circular button with 3D or popup styles.

  29. C# Rubber Rectangle
  30. Implements a Rubber Rectangle in C#.

  31. Combining GDI and GDI+ to Draw Rubber Band Rectangles
  32. Demonstrates drawng rubber band rectangles using GDI in a .NET GDI app

  33. Resize form using GraphicsPath
  34. This code will help us to reshape our Windows form.

Monday, July 11, 2022

C# class vs. object video series

C# class vs. object video series

  1. C# - How to create a class, objects and add members to the class.
  2. C# - How to create a class, objects and add members to the class.

  3. Design Patterns: Single Responsibility Principle Explained Practically in C# (The S in SOLID)
  4. When you are writing code, are you doing it right? That is a question that worries a lot of people, and it should probably at least be something every developer thinks through. Design patterns are best-practice concepts that we can implement into our code to make it better in some way. Think of them as guardrails that keep our code safe. In this video, we are going to look at the first entry in the famous SOLID principle. The S stands for Single Responsibility Principle. We are going to dive into what it means, how it should change our programming practices, and how far we should take it.

  5. SOLID Principles In C#
  6. SOLID design principles in C# are basic design principles. SOLID stands for Single Responsibility Principle (SRP), Open closed Principle (OSP), Liskov substitution Principle (LSP), Interface Segregation Principle (ISP), and Dependency Inversion Principle (DIP).

MyClass keyword understanding

MyClass keyword understanding

    Must Read

  1. What .NET Developers Must Know about C++ Classes
  2. C++ does things differently than C# or Visual Basic, especially when it comes to class construction. Take this tour to learn about the differences.

  3. Chapter 4. Classes and Objects
  4. Chapter 3 discussed the myriad primitive types built into the C# language, such as int, long, and char. The heart and soul of C#, however, is the ability to create new, complex, programmer-defined types that map cleanly to the objects that make up the problem you are trying to solve.

    More Details

  5. MyClass equivalent in C#
  6. In looking at this question, commenter @Jon Egerton mentioned that MyClass was a keyword in VB.Net. Having never used it, I went and found the documentation on it:

    The MyClass keyword behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable.

    I can see how that could kind of be useful, in some specific scenarios. What I can't think of is, how would you obtain the same behaviour in C# - that is, to ensure that a call to a virtual method myMethod is actually invoked against myMethod in the current class, and not a derived myMethod (a.k.a in the IL, invoking call rather than callvirt)?

  7. Me, My, MyBase, and MyClass in Visual Basic
  8. Me, My, MyBase, and MyClass in Visual Basic have similar names, but different purposes. This topic describes each of these entities in order to distinguish them.

  9. Comparison of C Sharp and Visual Basic .NET
  10. C# and Visual Basic .NET are the two primary languages used to program on the .NET Framework.

  11. C# equivalent of the vb isNothing
  12. VB.Net IsNothing Function returns a Boolean value indicating whether an expression has no object assigned to it. There is no direct, 100% equivalent of the Vb.Net function IsNothing, but the test against null accomplishes the same thing.

    IsNothing is intended to work on reference types. It returns True if the expression represents an object variable that currently has no object assigned to it; otherwise, it returns False.

    The null keyword is specific design feature in the C# language. It is a literal that represents a null reference, one that does not refer to any object. null is the default value of reference-type variables

  13. What is the C# equivalent to VB's Handles?
  14. I assume you mean for handling an event here. There are other Handles such as when discussing Windows API … Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub

    What is the C# equivalent to VB's friend?

    Assembly level class member visibility in C# is ‘internal' I believe.

  15. What is the C# equivalent to the VB Left function and right function?
  16. The Right function doesn’t exist in C#. However, you can create one, as well as a Left and a mid and make them work just like they do in VB.

    What you need to use is the SubString command and counters that dictate where to start and stop in a string of text. just remember to trap for errors such as the user sending values that would exceed the length of the string or trying to use negative numbers. Remember, Users are stupid.

  17. What is the C# equivalent to VB's InStr?
  18. You can use

    1. IndexOf(int, string, string) … This returns the offset of the first match after the integer value.
    2. IndexOf(string,string) … This returns the offset of the string.
    3. LastIndexOf(string,string) … This returns the last offset of your search value.
    All these methods have several overloads…. Refer to the manual for more help.

  19. What is the C# equivalent of with in VB.NET?
  20. Q:What is the C# equivalent of with in VB Dot thing

    A: Hmmm…….. I will assume the correct question is:

    What is the C# equivalent of “With” in VB dot thing?

  21. What is the new keyword for in this C# code?
  22. This is an Anonymous Type. Well, not truly anonymous, the compiler will assign an auto generated name for such class. It's said to be anonymous because the developer does not have to bother to give such class a name because the compiler will automatically create a random one.

  23. What is the C# equivalent to VB's exit sub?
  24. in C# return;

  25. What is the C# equivalent to VB's friend?
  26. Assembly level class member visibility in C# is ‘internal' I believe.

  27. Me, MyBase and MyClass…
  28. Me is what really symbolizes VB.NET isn’t it? Where is it really applicable ? Lets see:

    Many good examples...

  29. C# Equivalent of VB.NET MyClass???
  30. In otherwords, how do I force a method in my class to call the method implementations in the SAME class and not use any potentially overriden methods in derived classes?

  31. What's difference between f(const MyClass & in) and f(MyClass in)
  32. The equivalent of Global constants in VB
  33. but can anyone tell me how to simulate the concept of a global constant in a C# Windows app? The app in question contains several forms, each of which need to interrogate the value of a "global" constant. Do I have to create a class with a public constant declaration and instantiate that class from each form?

  34. C# equivalent of VB.NET Redim Preserve
  35. Does C# have an equivalent for VB.NET's Redim Preserve ? ReDim Preserve increases the final dimension of any array while preserving the array's contents (however, the type of the array may not be changed).

  36. Me vs. MyClass
  37. What is the difference between the Me and the MyClass keywords? I understand Me that it represents the specific instance of the class. When you're inside the object instance, it refers to itself using the Me keyword. What is the MyClass keyword used for?

  38. translate static in C# to VB.NET
  39. very good examples

  40. VB.Net program to demonstrate the 'MyClass' keyword
  41. Here, we will demonstrate the MyClass keyword. The MyClass keyword is used to refer to the current class name.

  42. Curious case of typeof in C# and VB.NET
  43. In this article one of the operator keyword which every .NET developer encounters named as typeof. But the purpose it servers in both of the languages is different.

    If you are the curious one to know how C# and vb.net treats typeof, continue reading the article.

  44. With End Block - VB.Net
  45. There is no direct equivalent to this in C#

  46. The My namespace
  47. One of the great new feature in Visual Basic 2005 is the My namespace.

    The My namespace doesn’t bring anything new to the language. It simply offers a clearer path to methods and properties already existing in the .Net Framework. You can see it as a shortcut to quickly access features that are sometime hard to find.

    This is the first article of a series of 2. Next month, I will show you how to extend this namespace with your own methods.

  48. Extending the My namespace
  49. This is the second (and last) article on the My namespace. Last month, I showed you what is the My namespace and how to use it. This month, I will show you how to extend it with your own methods. As you will soon discover, it is as simple as adding 2 lines to a class that you might already have written.

    Why extend this class? You surely built many helper functions over the years. Most of those functions are probably declared as static so that you don’t have to create an instance of the class to use them.

    The good news is that the My namespace can be extended so that your own classes can sit beside My.Application, My.Computer, My.User and so on.

  50. Distinguishing Visual Basic Me, My, MyBase, and MyClass
  51. I have been providing C# code for my articles for a long time now but not this month. The reason is that MyClass has no equivalent in that language. MyClass is purely VB.

    The easy one: My Let’s start with the easy one: My. The My keyword was introduced in the VB language with the .Net Framework 2.0 (TODO) and is simply a shortcut to often used .Net Framework classes. I have already covered this keyword in June 2007.

    The obvious one: Me This is the most often used keyword even if you don’t even always write it yourself because it is implicit from within an instance. In theory, the Me keyword is used to access the current instance.

    The common one: MyBase Sometimes, you don’t want to access to the current instance but you would prefer to refer to the base instance when you have overridden or shadowed a member. We very often see this keyword in constructors. We want to do everything the base constructor is doing and add something specific to the current instance in the derived class.

    Notice that if your classes inherits many levels deep, MyBase will call the members of the immediate base class (the one just above) and won’t go until the root.

    The obscure one: MyClass MyClass behaves mostly like Me. The only exception is that it will force to use the current instance of the class (and not any of its overrides) as if the members were declared as NotOverridable. In other words, MyClass makes sure that the member of the current class is dispatched and not the overridden member.

  52. Use Shared Keyword In VB.NET
  53. Shared keyword A shared method is not accessed via an object instance like a regular method, but rather is accessed directly from the class. The shared keyword in VB.NET is the equivalent of the static keyword in C#. In VB.NET, the shared keyword can only be applied to methods within a class, however, in C#, the static keyword can be applied to both methods within a normal class, and also at the class level to make the entire class static.

    Shared Variables When we share a value across all instances of a class when every object of a given type should share the same variable. This is accomplished through the use of shared variables.

    GDI+ in VB.NET

  54. Transformation In GDI+ In VB.NET
  55. A transformation is a process that changes graphics objects from one state to another. Rotation, scaling, reflection, translation, and shearing are some examples of transformation. Transformation can be applied not only to graphics shapes, curves, and images, but even to image colors.

  56. GDI+ IN VB.NET ARTICLES
  57. GDI+ IN VB.NET ARTICLES

Sunday, July 10, 2022

Resource file in C#

  1. How to create and use resources in .NET
  2. How do I create a resource that I can reference and use in various parts of my program easily?

    My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've been struggling with for a long time.

  3. C#.net - Read the Resource file (.resx)
  4. Resource files are used to hold files associated with the application, such as String,images, sounds and other data objects. Resource files can also be used to localise applications to specific cultures.

  5. [C#] How to add and use images from resources
  6. very short, but very useful and simple...

  7. Resource Manager, C# (ENGLISH)
  8. Resource Manager, C# (ENGLISH)

  9. How to add image to resource in windows form in c#
  10. How to add image to resource in windows form in c#

  11. How To Add And Use Images From Resources In C# - Visual Studio 2010
  12. How To Add And Use Images From Resources In C# - Visual Studio 2010

  13. C# Winforms Resources add, modify and delete
  14. When developing a Windows application, you can import images and icons into the Resource and package them together with the application into an exe file, so that others cannot get the images and icons used in the program, and at the same time reduce the number of files.

    There are usually two ways to import a file into a resource file. One is to import the background image into the control, which can be imported in the properties; the other is like the icon of an exe file, but it cannot be imported directly. You need to import the image into the resource file before referencing it.

  15. Adding Images In C# .Net
  16. You have seen the Open File dialogue box countless times. It's the one that appears whenever you click File > Open on a Windows machine. You then navigate through folders, searching for the file you want to open. For our View Images menu, we'll do something slightly more complex - we'll have our own Open File dialogue box that allows you to select images from your computer. When you select an image, it will then appear in a new control on your form.

Saturday, July 9, 2022

string format

string format

  1. Standard numeric format strings
  2. Standard numeric format strings are used to format common numeric types. A standard numeric format string takes the form [format specifier][precision specifier], where:

  3. Overview: How to format numbers, dates, enums, and other types in .NET
  4. Formatting is the process of converting an instance of a class or structure, or an enumeration value, to a string representation. The purpose is to display the resulting string to users or to deserialize it later to restore the original data type. This article introduces the formatting mechanisms that .NET provides.

  5. String.Format Method
  6. Converts the value of objects to strings based on the formats specified and inserts them into another string.

    If you are new to the String.Format method, see the Get started with the String.Format method section for a quick overview.

  7. What is ToString("N0") format?
  8. This code is from Charles Pettzold's "Programming Windows Sixth Edition" book:

    public object Convert(object value, Type targetType, object parameter, string language) { return ((double)value).ToString("N0"); }
  9. Numeric ("N") Format Specifier In C#
  10. The numeric format specifier "N" converts a number to a string format as, "-d,ddd,ddd.ddd…" where the "-" sign denotes the negative number symbol, "," denotes a separator between these groups, "d" denotes any number (0-9), and "." represents the decimal point in the number. For this we use the properties of the NumberFormatInfo class. First of all the following example shows how we convert the number into the string format: