Saturday

RDLC reports in C#

Introduction

Here is explained in detail to generate RDLC reports in C#, RDLC is very good business intelligence (BI) tool. RDLC is the best component to display reports in tabular form.

Step 1: Add new project, select Windows Desktop, then select Windows Forms Application and type solution name and then finally click on OK button.

Create Solution for RDLC Report

The underlying provider failed on open

Introduction

I am today providing resolution of The underlying provider failed on open problem when we are working on across the network. If you see inner exception message then you will find below error description in detail. This problem occurs mostly when we are working with Entity Framework with MVC, ASP.Net, Windows Forms, WPF etc. This issue can be encountered mentioned scenarios. I am also written in detail associated with issue   Could not open a connection to SQL Server.

Error Description

{"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. 
Verify that the instance name is correct and that SQL Server is configured to allow remote connections. 
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"}

Friday

DataTable in C#

Introduction

DataTable is formed with rows and columns, it stored the data in the same way as stored others objects in C#.

Namespace

If we are dealing with DataTable in C# then we require to define following Namespace in our C# program.

using System;

using System.Data;

Here demonstrating to get columns name from a DataTable.

private void Get_Column_name()
{
            // Declare data table
            DataTable _ dtTC = new DataTable();
             
          // get column name using with foreach loop
           foreach(DataColumn _Cols in _dtTC.Columns)
            {
                string _str_Col_name = _Cols.ColumnName;
            }

}

DataTable In C#

Another method to select data from a specific DataTable in C#.

        private void Select_Data_From_Datatable_In_CSharp()
        {
            // Declare data table
            DataTable _dtSelectTC = new DataTable();

            // add column to data table
            _dtSelectTC.Columns.Add("ID", typeof(Int32));

            // adding rows to data table
            _dtSelectTC.Rows.Add(10);
            _dtSelectTC.Rows.Add(20);
            _dtSelectTC.Rows.Add(30);
            _dtSelectTC.Rows.Add(40);
            _dtSelectTC.Rows.Add(50);

            // filtering data on demand
            DataRow[] _resultTc = _dtSelectTC.Select("ID > 30");

            // Display results
            foreach (DataRow _rowTc in _resultTc)
            {
                Console.Write(_rowTc[0] + "\n");
            }

            // Output
            // 40
            // 50
        }

Conclusion

I have explained in detail about DataTable in C#, it uses system.Data to define DataTable and further uses of its properties, constraints etc. We can use “Clear “ method to clear data from DataTable, “Clone” helps us to cloning of a DataTable with structure and data, “Copy” copies its data with schema.

Suggested Reading:



Thursday

ArrayList in C#

Introduction

Today, I bet to throw light on ArrayList in C#. ArrayList has great feature because it can increase and decrease its size dynamically. ArrayList accepts also null value, moreover it allows to add duplicate values.

Namespace:

using System.Collections;
using System;

Saturday

MVC ASP.Net Interview Questions And Answers

In this article,  explaining best MVC ASP.Net Interview Questions and Answers as following:

1. Which is the best approach to assign a session in MVC?

A) System.Web.HttpContext.Current.Session["LoginID"] =7;
B) Current.Session["LoginID"] =7;
C) Session["LoginID"] =7;
D) None

2. RedirectToActionPermanent() Method for which Status code represents?

A) 304
B) 302
C) 301
D) 300
E) None

3. RedirectToAction() Method for which Status code represents?

A) 304
B) 302
C) 301
D) 300
E) None

Tuesday

How to Delete Contraints in SQL Server

Introduction

Suppose we are working with Entity Framework or some very complex database and moreover we don’t have matured database then very tedious work to carry out changes with our back end database in MS SQL Server, so I am proposing this great utility to handle out this problem.

Saturday

AngularJS JavaScript MVW Framework

Angular History:

AngularJS is quite new language and introduced first time in 2012, Google employee starts to develop it in 2009. Later Google properly take over, funded and full time development on it. Angular JS is easy to learn. It extends HTML with new modern rich features.

Angular JS