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

معافی


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