UML class diagrams connectors

Many of you consider building class diagrams is a bit complicated and they prefer to start immediately programming. While this is might be true for almost developers, this post will help you to build class diagrams in the future. This post will explain how to  determine and implement the different class diagram relationships. Explain Class …

Continue reading UML class diagrams connectors


Sorting Algorithms

Sorting algorithms are important for data presentation to the user and to simplify other processing algorithms. Almost all programming languages include at least one sorting algorithm. These algorithm are suitable for general use. In a complex situation you have to implement a custom your own sorting algorithm. Sorting Algorithms 1. Selection Sort One of the …

Continue reading Sorting Algorithms

How to load string to XMLDocument()

The following example shows you how to load a string to a XMLDocument() object: 1. Load from a physical file on a drive: XmlDocument _Document = new XmlDocument(); _Document.LoadXml(File Physical Path); 2. Load from a URL: WebClient wc = new WebClient(); string xmlStr = wc.DownloadString(url); XmlDocument _Document = new XmlDocument(); _Document.LoadXml(xmlStr);

Get the list of all tables in a database using C#

You want to get names of all tables of SQL Server database in your C# application. Is It possible? Yes you can do this. SqlConnection con = new SqlConnection(ConnectionString); con.Open(); SqlCommand com = new SqlCommand(); com.Connection = con; com.CommandType = CommandType.Text; com.CommandText = "exec sp_tables"; List<string> listTables = new List<string>; SqlDataReader reader = com.ExecuteReader(); if …

Continue reading Get the list of all tables in a database using C#

List all databases on a SQL server and bind to a dropdown list

SqlConnection con = new SqlConnection("server=server;uid=username;pwd=password");                     con.Open();                      SqlCommand com = new SqlCommand();                      com.Connection = con;                      com.CommandType = CommandType.StoredProcedure;                      com.CommandText = "sp_databases";                      SqlDataReader reader = com.ExecuteReader();                      while (reader.Read())                                 ddlDatabases.Items.Add(reader.GetString(0));                  con.Close(); Note that this is not the only method to to do this.