Sunday, April 26, 2015

XML to DataGridView

Here I write the samle code to Read XML file and bind with GridView. see below code can be you in ASP.NET C#.

    private void MyXmlFile()
         try
            {
                XmlReader xmlFile ;
                xmlFile = XmlReader.Create("Product.xml", new XmlReaderSettings());
                DataSet ds = new DataSet();
                ds.ReadXml(xmlFile);
                dataGridView1.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show (ex.ToString());
            }
        }

Thursday, April 23, 2015

How to display text in html format in GridView generated from DataTable

In this artical i will expain How to display text in html format in GridView generated from DataTable.

We will use  GridView_RowDataBound to resolve this issue.










Read XML File & Bind Data to Gridview in Asp.net using C#, VB.NET

Introduction:
Here I will explain how to read xml file and bind xml data to gridview in asp.net using c#, vb.net or read and bind data to gridview from xml file in asp.net using c#, vb.net.

In one situation I got requirement like read data from xml file and display it on webpage. My XML File Name as “Sample.xml” and that would contains data like this

Saturday, April 18, 2015

GMAIL Error: The SMTP server requires a secure connection or the client was not authenticated

In this article I will explain how to resolve the error The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required in ASP.Net Application.

Error
The following error occurs when you try to send email using Gmail credentials in your ASP.Net application.
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

Sunday, April 12, 2015

معافی


معافی مگنے والے کو اگر یہ پتا چل جایے کے سہنے والے پر کیا گزری ہے تو وہ کبھی مافی نہ ماگے 

Tuesday, April 07, 2015

Change Asp.Net GridView Row Background Color Based on Condition in C# and VB.Net


Introduction:
Here I will explain how dynamically change asp.net gridview row background color based on condition in asp.net using css classes in c#, vb.net with example.
I will use _RowDataBound event to check the case and change the css for each row. you will see we will create a event for RowDataBound, its easy and great work.

Monday, April 06, 2015

SQL SERVER – Introduction Basic of JOINs (INNER JOIN / OUTER JOIN / FULL OUTER JOIN)

The launch of Gandhinagar SQL Server User Group was a tremendous, astonishing success! It was overwhelming to see a large gathering of enthusiasts looking up to me (I was the Key Speaker) eager to enhance their knowledge and participate in some brainstorming discussions. Some members of User Group had requested me to write a simple article on JOINS elucidating its different types.

INNER JOIN

This join returns rows when there is at least one match in both the tables.