<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Various Technical Articles to learn Microsoft Technologies</title>
	<atom:link href="https://jharaphula.com/category/programming-solutions/microsoft-technologies/feed/" rel="self" type="application/rss+xml" />
	<link>https://jharaphula.com/category/programming-solutions/microsoft-technologies/</link>
	<description>Blog for SEO Guest Posting, Digital Marketing or Home Remedies</description>
	<lastBuildDate>Tue, 14 Apr 2026 08:25:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Leveraging Microsoft Azure Cloud Services in Virginia for Business Growth</title>
		<link>https://jharaphula.com/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth/</link>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 18 Jan 2025 14:10:01 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Microsoft 365 Business]]></category>
		<category><![CDATA[Microsoft Azure Cloud Services]]></category>
		<category><![CDATA[Sell on Azure]]></category>
		<guid isPermaLink="false">https://jharaphula.com/?p=85139</guid>

					<description><![CDATA[<img width="300" height="163" src="https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth-300x163.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Leveraging Microsoft Azure Cloud Services in Virginia for Business Growth" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" srcset="https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth-300x163.jpg 300w, https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth.jpg 734w" sizes="(max-width: 300px) 100vw, 300px" /><p>As businesses continue to embrace digital transformation, leveraging cloud solutions has become essential for maintaining competitive advantage. One of the most powerful cloud platforms available...</p>
<p>The post <a href="https://jharaphula.com/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth/">Leveraging Microsoft Azure Cloud Services in Virginia for Business Growth</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="163" src="https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth-300x163.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Leveraging Microsoft Azure Cloud Services in Virginia for Business Growth" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" srcset="https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth-300x163.jpg 300w, https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth.jpg 734w" sizes="(max-width: 300px) 100vw, 300px" /><p>As businesses continue to embrace digital transformation, leveraging cloud solutions has become essential for maintaining competitive advantage. One of the most powerful cloud platforms available today is <strong><a href="https://www.intwo.cloud/usa/virginia/microsoft-azure-managed-services-partner/" target="_blank" rel="nofollow noopener">Microsoft Azure Cloud Service in Virginia</a></strong>. Microsoft Azure provides a comprehensive suite of cloud-based tools and services, offering businesses the flexibility, scalability, and security they need to succeed. For businesses located in Virginia or across the broader U.S., Azure enables seamless deployment of applications and services in the cloud, facilitating innovation and efficiency. When paired with the expertise of a <strong>managed cloud service provider in New Jersey</strong>, companies can unlock the full potential of Microsoft Azure, ensuring optimal cloud performance and seamless integration with their existing IT infrastructure.</p>
<h2>What is Microsoft Azure Cloud Service in Virginia?</h2>
<p>Microsoft Azure is a cloud computing platform that offers a wide array of services such as virtual machines, databases, networking, analytics, and AI tools. The platform’s diverse capabilities cater to businesses in various industries, helping them scale their IT infrastructure with ease while reducing capital expenses. For companies in <strong>Virginia</strong>, Azure provides a local cloud option with fast data processing speeds, ensuring a robust and reliable performance tailored to regional needs.</p>
<p>Azure’s <strong>data centers in Virginia</strong> ensure that businesses have low-latency access to cloud services and resources. This is especially important for companies requiring real-time data processing, like those in finance, healthcare, and e-commerce. With the added benefit of high availability and redundancy, Microsoft Azure in Virginia helps businesses maintain continuous operations, even in the event of a disaster or system failure.</p>
<h2>Benefits of Microsoft Azure Cloud Services in Virginia</h2>
<p><strong>Cost Efficiency</strong>: Microsoft Azure is known for its cost-effective pricing structure. With Azure, businesses only pay for what they use, ensuring they only incur charges for active resources. This pay-as-you-go model allows organizations to scale their cloud services according to their needs, without overcommitting to long-term investments in physical infrastructure.</p>
<p><strong>Scalability and Flexibility</strong>: As businesses in Virginia expand, their need for IT resources grows. Azure allows for seamless scalability, enabling organizations to increase their computing power, storage, or network capabilities as needed. The flexibility of Azure’s architecture ensures that businesses can quickly adapt to changing market demands or business requirements.</p>
<p><strong>Enhanced Security and Compliance</strong>: Security is a top concern for any business. Azure is built with top-tier security features such as multi-factor authentication, role-based access control, and data encryption both at rest and in transit. For businesses operating in Virginia, Azure also ensures compliance with regulations like HIPAA, GDPR, and other industry-specific standards, making it an ideal choice for highly regulated sectors such as healthcare and finance.</p>
<p><strong>High Availability</strong>: With data centers located in Virginia, Microsoft Azure provides businesses with a reliable and resilient infrastructure. The platform’s service-level agreements (SLAs) ensure high uptime and minimal disruptions, offering peace of mind for businesses that rely on their IT systems for daily operations.</p>
<p><strong>Seamless Integration</strong>: For businesses already using Microsoft tools such as Office 365, Microsoft Dynamics, and Power BI, Azure offers seamless integration with these products, providing a unified platform that enhances overall productivity and simplifies IT management.</p>
<h2>Role of a Managed Cloud Service Provider in New Jersey</h2>
<p>While Microsoft Azure Cloud Service in Virginia offers immense capabilities, managing a cloud environment requires expertise and experience. This is where a <a href="https://www.intwo.cloud/usa/new-jersey/microsoft-azure-managed-services-partner/" target="_blank" rel="nofollow noopener"><strong>managed cloud service provider in New Jersey</strong></a> becomes invaluable. Managed cloud service providers (MCSPs) specialize in the deployment, management, and optimization of cloud infrastructure, helping businesses maximize the value of their Azure services while minimizing the complexity of day-to-day operations.</p>
<h4><strong>1. Expert Cloud Management Solution</strong></h4>
<p>A managed cloud service provider in New Jersey brings expert knowledge of Microsoft Azure and can assist businesses in configuring and managing their cloud resources efficiently. Whether it’s deploying virtual machines, setting up databases, or managing network resources, the provider ensures that the cloud environment is optimized for the business’s needs.</p>
<h4><strong>2. 24/7 Support and Monitoring</strong></h4>
<p>With the support of a managed cloud service provider, businesses can benefit from continuous monitoring and support. Providers use advanced tools to track the performance of cloud resources, identify potential issues, and ensure that services run smoothly. This proactive monitoring minimizes downtime and ensures that businesses in Virginia experience high uptime and performance.</p>
<h4><strong>3. Cost Optimization</strong></h4>
<p>Managing cloud costs is a challenge for many businesses. A managed cloud service provider can help optimize cloud spending by monitoring usage patterns and making recommendations for resource adjustments. By analyzing the business’s needs, the provider can suggest the most cost-effective cloud solutions, ensuring that resources are allocated efficiently without unnecessary expenditure.</p>
<h4><strong>4. Security and Compliance</strong></h4>
<p>Ensuring that your cloud environment remains secure and compliant with industry regulations is critical for any organization. A managed cloud service provider in New Jersey can implement robust security practices, including encryption, intrusion detection systems, and disaster recovery solutions. Additionally, they help businesses meet compliance standards, reducing the risk of security breaches and penalties.</p>
<h4><strong>5. Disaster Recovery and Backup</strong></h4>
<p>A managed cloud service provider can implement backup and disaster recovery strategies, ensuring that critical business data is protected. If any disaster or outage were to occur, the provider can quickly restore services, ensuring business continuity and minimal disruption.</p>
<h2>What is Microsoft Azure?</h2>
<p>Microsoft Azure, launched in 2010, is a cloud computing platform that enables organizations to build, deploy, and manage applications through Microsoft-managed data centers. It supports a variety of programming languages, frameworks, and tools, making it a versatile choice for businesses of all sizes. Azure offers Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) solutions, allowing users to choose the level of control and management they require.</p>
<p>Security is another critical consideration for organizations considering cloud adoption. Microsoft Azure places significant emphasis on security, offering a range of compliance certifications and built-in security features. Organizations can benefit from Azure’s robust security architecture, which includes advanced threat protection and identity management services.</p>
<p>Furthermore, Azure&#8217;s global data centers enable businesses to deploy applications closer to their users, reducing latency and improving performance. Companies can choose from numerous regions around the world, allowing for compliance with local regulations and improved service delivery.</p>
<h2>Key Features of Microsoft Azure</h2>
<p>Cloud computing has revolutionized the way businesses and individuals store, manage, and process data. Among the leading cloud service providers, Microsoft Azure stands out as a comprehensive platform offering a wide range of solutions for computing, storage, networking, and artificial intelligence. Azure provides scalable, secure, and flexible cloud services that cater to enterprises, developers, and IT professionals. This article explores the key features, benefits, and use cases of Microsoft Azure, along with its competitive advantages in the cloud computing industry.</p>
<h3>1. Compute Services</h3>
<p>One of the standout features of Azure compute services is their ability to optimize resources for specific workloads. Businesses can choose from different VM sizes and types, tailored to workloads that require varying levels of CPU, memory, and storage. For example, compute-optimized VMs are useful for high-performance computing tasks, whereas memory-optimized VMs are ideal for database workloads that demand rigorous memory performance.</p>
<p>Azure recognizes that organizations often operate across a diverse technology stack. As such, Azure facilitates both Windows and Linux workloads, offering flexibility for businesses to run their applications as they see fit. This support goes beyond mere deployment; Azure&#8217;s services integrate seamlessly with existing development tools, frameworks, and libraries, regardless of the underlying operating system.</p>
<p>Azure provides multiple compute options to handle different workloads:</p>
<p><strong>Virtual Machines (VMs):</strong> Enables users to deploy Windows or Linux-based virtual servers in the cloud.<br class="yoast-text-mark" /><strong>Azure App Services:</strong> A fully managed platform for building web and mobile applications.<br class="yoast-text-mark" /><strong>Azure Kubernetes Service (AKS):</strong> Simplifies the deployment and management of containerized applications.<br class="yoast-text-mark" /><strong>Functions:</strong> A serverless computing service that runs event-triggered code without managing infrastructure.</p>
<h3>2. Storage Solutions</h3>
<p>In addition to scalability, Azure emphasizes security, which is paramount in today’s environment where data breaches and cyber threats are on the rise. Azure&#8217;s storage solutions are built with security in mind, integrating multiple layers of protection. Data is encrypted both during transit and at rest, ensuring that sensitive information remains secure. Furthermore, Azure provides sophisticated access controls, enabling organizations to manage who can access their data and what permissions they have. This granular control helps ensure compliance with various regulatory requirements and promotes best practices in data governance.</p>
<p>Azure offers several storage options, including Blob Storage, File Storage, Disk Storage, and Queue Storage. Blob Storage is ideal for unstructured data such as videos, backups, and large media files. It provides a high-performance, scalable solution that can handle massive amounts of unstructured data efficiently. On the other hand, Azure File Storage provides fully managed file shares in the cloud, allowing for easy integration with various applications and on-premises tools.</p>
<p>Azure offers scalable and secure storage options:</p>
<p><strong>Blob Storage:</strong> Ideal for storing unstructured data like images, videos, and documents.<br />
<strong>Azure Files:</strong> Provides fully managed file shares accessible via standard protocols.<br />
<strong>Disk Storage:</strong> High-performance block storage for virtual machines.<br />
<strong>Azure Data Lake Storage:</strong> Designed for big data analytics with massive datasets.</p>
<h3>3. Networking Capabilities</h3>
<p>For organizations prioritizing security, Azure’s network security features provide a comprehensive suite of tools. Azure Firewall and Network Security Groups (NSGs) are designed to manage and control incoming and outgoing network traffic based on specified rules. These tools not only protect applications from threats but also enhance compliance with regulatory requirements, instilling confidence among stakeholders regarding data integrity and protection.</p>
<p>Moreover, Azure&#8217;s VPN Gateway allows businesses to establish secure point-to-site and site-to-site connections, enabling remote workers and branch offices to access necessary resources without compromising security. This is particularly important in today’s world, where remote work has become more prevalent than ever. Azure’s ExpressRoute further enhances connectivity by offering dedicated private connections between on-premises infrastructure and Azure, reducing latency and increasing throughput for sensitive workloads.</p>
<p>Azure’s networking services ensure secure and reliable connectivity:</p>
<p><strong>Virtual Network</strong>: Enables private and isolated cloud networks.<br />
<strong>Azure Load Balancer:</strong> Distributes traffic to ensure high availability.<br />
<strong>Azure ExpressRoute:</strong> Establishes private connections between Azure and on-premises data centers.<br class="yoast-text-mark" /><strong>DNS:</strong> Provides domain name system hosting with high availability.</p>
<h3>4. AI and Machine Learning</h3>
<p>Azure Machine Learning stands out as a robust and comprehensive service that allows enterprises to build, train, and deploy machine learning models at scale. With a user-friendly interface, it caters to data science professionals and novices alike, enabling organizations to harness predictive analytics without requiring extensive expertise in the field. By utilizing these machine learning capabilities, businesses can anticipate market trends, understand customer behavior, and make informed strategic decisions.</p>
<p>Azure&#8217;s blend of AI and machine learning technologies seamlessly integrates with traditional business intelligence solutions. Tools like Power BI work in synergy with Azure’s machine learning capabilities, enabling users to visualize complex datasets dynamically. With Power BI, businesses can create interactive reports that not only present data but also highlight critical insights generated through machine learning models. This integration enhances the decision-making process by providing stakeholders with clear, visual representations of what the data reveals.</p>
<p>Azure integrates AI and machine learning tools to enhance business intelligence:</p>
<p><strong>Azure Machine Learning:</strong> A cloud-based platform for building, training, and deploying ML models.<br />
<strong>Cognitive Services:</strong> Pre-built AI models for vision, speech, and language processing.<br />
<strong>Azure Databricks:</strong> A collaborative Apache Spark-based analytics platform.</p>
<h3>5. Security and Compliance</h3>
<p>One of the core components of Azure’s security strategy is its commitment to compliance with industry standards and regulations. Azure is compliant with a wide range of international and regional standards, such as ISO 27001, GDPR, HIPAA, and PCI DSS. These certifications reflect Azure&#8217;s dedication to adopting industry best practices, helping organizations meet their compliance requirements more efficiently.</p>
<p>Microsoft Azure continuously invests in security advancements. With integrated threat detection tools using artificial intelligence and machine learning, Azure can identify potential security threats in real-time. Azure Security Center plays a pivotal role in this regard by providing a centralized view of security across hybrid cloud workloads. This tool helps organizations to monitor, manage, and improve their security postures while keeping compliance requirements in check.</p>
<p>Microsoft Azure adheres to strict security standards, including:</p>
<p><strong>Azure Active Directory (AD):</strong> Identity and access management for secure authentication.<br />
<strong>Azure Security Center:</strong> Provides unified security management and threat protection.<br />
<strong>Compliance Certifications:</strong> Meets global standards like GDPR, HIPAA, and ISO 27001.</p>
<h2>Use Cases of Microsoft Azure</h2>
<p>Microsoft Azure is a leading cloud computing platform that offers a wide range of services to businesses and individuals. Its flexibility, scalability, and security make it a preferred choice for various industries. Below are some of the most prominent use cases of Microsoft Azure, covering enterprise application development, data analytics, disaster recovery, IoT solutions, and gaming and media streaming.</p>
<h4><strong>Enterprise Application Designing</strong></h4>
<p>Azure provides a robust environment for developing, deploying, and managing enterprise applications. Businesses leverage Azure App Service to build web and mobile applications without worrying about infrastructure management. With support for multiple programming languages, including .NET, Java, Node.js, and Python, developers can create scalable applications tailored to business needs.</p>
<p>Azure Kubernetes Service (AKS) simplifies containerized application deployment, enabling enterprises to run microservices architectures efficiently. Additionally, Azure DevOps offers integrated tools for continuous integration and continuous delivery (CI/CD), streamlining the software development lifecycle. Enterprises benefit from Azure’s global data centers, ensuring low-latency access to applications worldwide.</p>
<h4><strong>Data Analytics and Big Data Processing</strong></h4>
<p>Organizations generate vast amounts of data daily, and Azure provides powerful tools to process and analyze this data effectively. Azure Synapse Analytics combines big data and data warehousing, allowing businesses to run complex queries on large datasets in real time.</p>
<p>Azure Data Lake Storage offers a scalable solution for storing structured and unstructured data, while Azure Databricks provides an Apache Spark-based analytics platform for machine learning and AI-driven insights. Businesses use these services to enhance decision-making, predict trends, and optimize operations.</p>
<h4><strong>Disaster Recovery and Backup</strong></h4>
<p>Downtime can be costly for businesses, making disaster recovery and backup solutions essential. Azure Site Recovery (ASR) enables organizations to replicate workloads to the cloud, ensuring business continuity in case of outages or disasters. Azure Backup provides secure, automated backups for on-premises and cloud-based data.</p>
<p>With geo-redundant storage options, Azure ensures data is replicated across multiple regions, minimizing the risk of data loss. Enterprises can perform failover testing without disrupting operations, making Azure a reliable choice for disaster recovery strategies.</p>
<h4><strong>Internet of Things (IoT) Solutions</strong></h4>
<p>Azure IoT Hub connects, monitors, and manages IoT devices at scale. Industries such as manufacturing, healthcare, and logistics use Azure IoT to collect and analyze sensor data in real time. Azure IoT Edge extends cloud intelligence to edge devices, enabling faster decision-making in remote locations.</p>
<p>Azure Digital Twins allows businesses to create digital models of physical environments, improving predictive maintenance and operational efficiency. By integrating AI and machine learning, Azure IoT solutions help organizations optimize processes and reduce costs.</p>
<h4><strong>Gaming and Media Streaming</strong></h4>
<p>The gaming industry benefits from Azure’s high-performance cloud infrastructure. Azure PlayFab provides backend services for multiplayer games, including player authentication, leaderboards, and in-game purchases. Game developers use Azure to scale resources dynamically, ensuring smooth gameplay experiences during peak demand.</p>
<p>For media streaming, Azure Media Services offers tools for encoding, streaming, and content protection. Companies like Netflix and Disney+ leverage Azure’s global content delivery network (CDN) to deliver high-quality video streams with minimal buffering. Azure’s AI-powered video indexing enhances content discoverability and accessibility.</p>
<h2>Conclusion</h2>
<p>By leveraging <strong>Microsoft Azure Cloud Service in Virginia</strong>, businesses can harness the power of the cloud to scale operations, enhance security, and drive innovation. Azure’s cost-efficiency, scalability, and seamless integration with Microsoft products make it an ideal choice for businesses in Virginia looking to modernize their IT infrastructure. However, to fully optimize Azure and ensure that your cloud environment meets your specific needs, partnering with a <strong>managed cloud service provider in New Jersey</strong> is essential. With their expertise, support, and proactive management, businesses can unlock the full potential of Microsoft Azure, drive growth, and stay competitive in an increasingly digital world.</p>
<p>The post <a href="https://jharaphula.com/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth/">Leveraging Microsoft Azure Cloud Services in Virginia for Business Growth</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2025/01/leveraging-microsoft-azure-cloud-services-in-virginia-for-business-growth.jpg" medium="image" />
	</item>
		<item>
		<title>Custom Mobile Application Development benefits</title>
		<link>https://jharaphula.com/custom-mobile-application-development-benefits/</link>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Tue, 07 Feb 2023 08:46:43 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Android and iOS App]]></category>
		<category><![CDATA[Business Advantages]]></category>
		<category><![CDATA[Custom Mobile Application]]></category>
		<category><![CDATA[Develop Mobile Apps]]></category>
		<category><![CDATA[Enhances Effectiveness]]></category>
		<guid isPermaLink="false">https://jharaphula.com/?p=63196</guid>

					<description><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits-300x191.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Custom Mobile Application Development benefits" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" fetchpriority="high" srcset="https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits-300x191.jpg 300w, https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits.jpg 610w" sizes="(max-width: 300px) 100vw, 300px" /><p>Custom Mobile Application Development is becoming more and more popular; according to surveys, they save workers 7.5 hours per week on average, and 82% of...</p>
<p>The post <a href="https://jharaphula.com/custom-mobile-application-development-benefits/">Custom Mobile Application Development benefits</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits-300x191.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Custom Mobile Application Development benefits" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits-300x191.jpg 300w, https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Custom Mobile Application Development is becoming more and more popular; according to surveys, they save workers 7.5 hours per week on average, and 82% of business owners think they&#8217;ve enhanced earnings. Custom mobile apps may be modified in part or entirely to suit your business&#8217;s requirements. Instead of offering a service that meets the needs of a vast population with a variety of requirements, these apps appeal to a specific target audience.</p>
<h2>Many Business Advantages of Custom Mobile Application Development</h2>
<p>Today&#8217;s firms of all sizes, whether small, medium-sized, or large businesses, can maintain their competitiveness and boost productivity thanks to customized business apps. Some of the most well-liked benefits of mobile application development for organizations include the following.</p>
<h2>Enhances Effectiveness</h2>
<p>Business applications work as a single, all-encompassing piece of software that can perform a variety of duties, obviating the need for several apps because they were developed with the needs of your firm in mind. Because they are made to fit your working style, these applications help increase employee productivity, which is great for businesses. provide high ROI scalability</p>
<p>Applications that are used frequently control a small number of resources and operations. These apps might not be able to handle the demand if your business were to expand.</p>
<h2>Security of Data for Applications</h2>
<p>Common business apps probably lack specialized security safeguards, endangering your company&#8217;s data security. Your data security system will improve if you have a custom app made just for your business since the needs of your business will be taken into consideration during the app development process.</p>
<h2>Integrates With Existing Software</h2>
<p>Your current software and typical business apps might work together without any complications. Because they are created concerning the business software you already use, custom apps are ensured to integrate correctly and operate without any issues.</p>
<h2>Easily maintained</h2>
<p>You run the danger of putting yourself in the hands of a dishonest <a href="https://choosytrends.com/" target="_blank" rel="nofollow noopener">mobile app developer</a> if you use traditional apps for your regular business activities. You will need to locate a new app and stop using your existing one if the creator decides to stop supporting the app for whatever reason. You may take full control of your company app and stop depending on third parties by creating one.</p>
<h2>Improves Consumer Communications</h2>
<p>You can provide your present clients with real-time, customized updates on your goods and services with the use of <a href="https://tecrank.com/" target="_blank" rel="nofollow noopener">customized business applications</a>.</p>
<h2>Allows data to be retrieved from new clients</h2>
<p>You can gather crucial client data by including simple questionnaires and surveys in the custom mobile application. It functions as a covert method of data collection in addition to saving clients and staff time by removing the requirement for them to physically submit the papers.</p>
<h2>Instantly permits projects access</h2>
<p>Having quick access to all of your work documents is helpful when traveling. With a custom-created app for your business, you can effortlessly connect your phone and desktop and access all of your work-related data, projects, calendars, etc. Additionally, getting contracts and brochures that you can give to your clients is simple when you use specialized business apps.</p>
<h2>Project management is simple</h2>
<p>Project deadlines and progress can be tracked in real-time using customized apps that can be loaded. Updates can be sent following the conclusion of each project phase, maintaining the payment cycle.</p>
<h2>Make digital records in support of accountability</h2>
<p>You can quickly take notes on the phone for dictation if the ideas and thoughts are pertinent to your consumer. After then, these recordings can be immediately stored in secure locations and will only be visible to authorized individuals. By doing this, you may increase responsibility and offer better customer service.</p>
<h2>During Custom Mobile Application Development, Consider the Following:</h2>
<p>Bespoke app solutions must be thoroughly studied before being implemented due to the market environment, rapidly changing mobile platforms and the requirement for quick turnaround. Consider a few factors before building a unique mobile app for your business.</p>
<p><strong>Faster Time to Market</strong> &#8211; For custom business apps to go to market quickly, they need to be inexpensive and produced quickly.</p>
<p><strong>Greater Efficiency</strong> &#8211; The custom apps need to be modified and mended for greater efficiency to ensure that the final solution is successful and improves.</p>
<p><strong>Many Network Compatibility</strong> &#8211; To ensure that the created app works properly on various networks in various regions, it must be tested for multiple operators.</p>
<p><strong>Data security</strong> &#8211; Since the majority of apps are made to be used by many people, they need to offer strong authentication and secure data access.</p>
<p><strong>Battery Life </strong>&#8211; Because people dislike apps that drain their batteries quickly, it is important to consider how the app affects battery life.</p>
<p><strong>Impressive UI/UX</strong> &#8211; The custom app should have a lovely user interface and provide users with an excellent user experience.</p>
<p><strong>Effective Data Synchronization</strong> &#8211; The application must be able to reliably and at the right frequency synchronize data with the server.</p>
<p>A streamlined communication channel, such as texting, WAP, or another protocol, must be available in the app.</p>
<h2>Trends for Custom Mobile Application Development</h2>
<p>Build Your App (BYOA) is a development of the bring your device (BYOD) idea as a result of the increasing consumerization of information technology. Although BYOA enables employees to use better work apps, it can also be seen as a huge security issue. Employees will use mobile or cloud apps if they have little control over how their data is stored, accessed, or used.</p>
<p>The post <a href="https://jharaphula.com/custom-mobile-application-development-benefits/">Custom Mobile Application Development benefits</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2023/02/custom-mobile-application-development-benefits.jpg" medium="image" />
	</item>
		<item>
		<title>Microsoft E-Commerce Platform features for Businesses</title>
		<link>https://jharaphula.com/microsoft-e-commerce-platform/</link>
		
		<dc:creator><![CDATA[Megha Shetty]]></dc:creator>
		<pubDate>Wed, 09 Mar 2022 15:23:27 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[Install Microsoft Office]]></category>
		<category><![CDATA[Microsoft E-Commerce Platform]]></category>
		<category><![CDATA[Microsoft Teams can help]]></category>
		<category><![CDATA[Microsoft’s Hololens]]></category>
		<guid isPermaLink="false">https://jharaphula.com/?p=45957</guid>

					<description><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2022/03/ecommerce-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Microsoft E-Commerce Platform features for Businesses" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2022/03/ecommerce-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2022/03/ecommerce.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>When looking for a business solution to help you launch a new business online or run an existing one efficiently, you should think of an...</p>
<p>The post <a href="https://jharaphula.com/microsoft-e-commerce-platform/">Microsoft E-Commerce Platform features for Businesses</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2022/03/ecommerce-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Microsoft E-Commerce Platform features for Businesses" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2022/03/ecommerce-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2022/03/ecommerce.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>When looking for a business solution to help you launch a new business online or run an existing one efficiently, you should think of an e-commerce platform. A Microsoft e-commerce platform is a business solution suite built on <a href="https://jharaphula.com/agile-development-methodology-scrum-manager/">ASP.NET architecture</a> with a myriad of features to help entrepreneurs create online pages, add and edit products, sell to customers, and process payments, among other operations.</p>
<p>Reliable Microsoft e-commerce platforms may also separate the business front end and back end to promote more focus on customers and products. If you have heard of headless e-commerce, this is it. With this introduction, you now know some of the features to check for your business. But let’s discuss these more in detail.</p>
<h3>Tools to Promote Online Business</h3>
<p>The Microsoft e-commerce platform you choose should be equipped with tools to help you operate online. They include the following.</p>
<p><strong>Web page creation tools</strong> – Whether you need to create a unique webshop or use existing markets, the platform you choose should facilitate this efficiently. On the same note, it should make it possible to produce descriptions, images, and change them without challenges.</p>
<p><strong>Marketing tools</strong> – When you want to drive revenue to your business, you need to market the business efficiently. A good .NET platform should come with SEO and other marketing tools to <a href="https://jharaphula.com/help-your-small-business-with-digital-marketing-strategies/" rel="noopener noreferrer" target="_blank">promote the business efficiently</a>.</p>
<p><strong>Payment processing engine</strong> – Whether you are integrated with places or using any other webshop, it is the responsibility of the Microsoft e-commerce platform to help process payments securely and accurately. So, ensure that it has this feature.</p>
<p>These features perfectly suit <a href="https://virtocommerce.com/microsoft-ecommerce-platform" rel="noopener noreferrer nofollow" target="_blank">Virto Commerce</a>, which is an ASP.NET commerce platform that you may want to consider right now for your business.</p>
<h3>Cloud-Based</h3>
<p>Today, most <a href="https://jharaphula.com/category/business-radar/" rel="noopener noreferrer" target="_blank">businesses solutions</a> are operated online. They are called cloud-based, which is where remote servers store the data and can present it via the internet anywhere in the world. An appropriate Microsoft e-commerce platform should function online and provide cloud-based solutions. With these, entrepreneurs can operate from anywhere using their internet-connected laptops, tablets, or mobile phones.</p>
<h3>Integration</h3>
<p>It is better when the Microsoft e-commerce platform you choose can work with other online solutions. This happens through integration, which gives you more features and tools to utilize. These could be markets, marketing platforms, or other partners.</p>
<p>If you happen to follow up on the integration, ensure that they add value to your online business. This means you should be able to access and utilize them as soon as you subscribe to the platform.</p>
<h3>Data Processing Capability</h3>
<p>We live in a world full of data. Any online business processes a lot of data every minute from customer buying habits to stocks and finances. A good Microsoft e-commerce platform should have the mechanism to collect, store, analyze, and report on data efficiently.</p>
<p>Luckily, all ASP.NET Microsoft e-commerce platforms are designed to handle a large amount of data, so they are efficient for any business. And since they are cloud-based, you can access the data securely from any location.</p>
<h3>Conclusion</h3>
<p>Even as we conclude, it is worth mentioning that the cost of subscribing to the platform is very important. All ASP.NET platforms are affordable because the <a href="https://jharaphula.com/category/programming-solutions/" rel="noopener noreferrer" target="_blank">programming</a> architecture is also affordable. So, your main focus should be on the features we have discussed.</p>
<p>The post <a href="https://jharaphula.com/microsoft-e-commerce-platform/">Microsoft E-Commerce Platform features for Businesses</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2022/03/ecommerce.jpg" medium="image" />
	</item>
		<item>
		<title>How to Rearrange Rows in a Gridview using Drag and Drop?</title>
		<link>https://jharaphula.com/gridview-using-drag-drop/</link>
					<comments>https://jharaphula.com/gridview-using-drag-drop/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 18 Mar 2017 17:05:27 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Div drag and drop]]></category>
		<category><![CDATA[drag and drop Jquery Example]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[Gridview using Drag and Drop]]></category>
		<category><![CDATA[HTML5 Drag and Drop]]></category>
		<category><![CDATA[Rearrange Rows in a Gridview]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=7075</guid>

					<description><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Rearrange Rows in a Gridview using Drag and Drop?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Gridview is an awesome Control to display data in Tabular shape. Let&#8217;s assume while displaying records in a Gridview Customer wants to re-order the records....</p>
<p>The post <a href="https://jharaphula.com/gridview-using-drag-drop/">How to Rearrange Rows in a Gridview using Drag and Drop?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Rearrange Rows in a Gridview using Drag and Drop?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Gridview is an awesome Control to display data in Tabular shape. Let&#8217;s assume while displaying records in a Gridview Customer wants to re-order the records. In such scenario row Drag and Drop feature works great. In back-end to maintain Order of records here I am with a column in Excel. Using order by with a <a href="https://jharaphula.com/sql-queries-with-example/" target="_blank" rel="noopener noreferrer">SQL query</a> I am displaying the records in Sequence.</p>
<h2>Understanding Drag and Drop Functionality</h2>
<p>Drag and drop is an intuitive user interface feature that allows users to move or reorder elements by clicking, holding, and dragging them to a new location. This functionality enhances user experience by simplifying interactions, reducing the need for manual input, and improving efficiency.</p>
<p>In this example I am with a Gridview control “gvLocations”. Which displaying data from an excel file using OLEDB connection. Code for Gridview is as below.</p>
<h3>Gridview</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView ID=&quot;gvLocations&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField HeaderText=&quot;Id&quot; ItemStyle-Width=&quot;30&quot;&gt;
&lt;ItemTemplate&gt;
&lt;%# Eval(&quot;ID&quot;)%&gt;
&lt;input type=&quot;hidden&quot; name=&quot;LocationId&quot; value='&lt;%# Eval(&quot;ID&quot;) %&gt;' /&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:BoundField DataField=&quot;Location&quot; HeaderText=&quot;Location&quot; ItemStyle-Width=&quot;150&quot; /&gt;

&lt;asp:BoundField DataField=&quot;Order&quot; HeaderText=&quot;Order&quot; ItemStyle-Width=&quot;100&quot; /&gt;
&lt;/Columns&gt;
&lt;/asp:GridView&gt;
&lt;br /&gt;
&lt;asp:Button Text=&quot;Update Preference&quot; runat=&quot;server&quot; OnClick=&quot;UpdatePreference&quot; /&gt;</pre>
<p>To implement Drag and Drop over a Gridview. In the below section I am using jQuery. To add this in your app, embed the jQuery library files in your app and Copy the below JQ Function to the header part of your aspx page.</p>
<h3>Drag and Drop using Jquery</h3>
<pre class="brush: jscript; title: ; notranslate">&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/themes/smoothness/jquery-ui.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function () {
$(&quot;[id*=gvLocations]&quot;).sortable({
items: 'tr:not(tr:first-child)',
cursor: 'pointer',
axis: 'y',
dropOnEmpty: false,
start: function (e, ui) {
ui.item.addClass(&quot;selected&quot;);
},
stop: function (e, ui) {
ui.item.removeClass(&quot;selected&quot;);
},
receive: function (e, ui) {
$(this).find(&quot;tbody&quot;).append(ui.item);
}
});
});
&lt;/script&gt;</pre>
<p>In Code behind I am 3 subroutines BindGrid, UpdatePreference and UpdatePreference with different signature. Whie page load if page is not postback I am calling the BindGrid() subroutine. Which help to display records in the Grid. Drag and Drop happening using the above Jquery Code. Now after re-ordering while I am updating the Excel. For this I have a button “Update Preference” in my aspx page. Onclick of this button I am calling UpdatePreference() subroutine. From 2 UpdatePreference() subroutine first one is responsible to extract id and order. Then from this I am calling the another UpdatePreference(locationId, order). Which updating records in Excel File using the Loop defined at UpdatePreference.</p>
<h3>Code-behind</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.IO
Imports System.Data.OleDb
Imports System.Data
Imports System.Configuration

Partial Class _Default
Inherits System.Web.UI.Page

Dim FilePath As String = &quot;C:\Users\biswabhusan_panda\Documents\Visual Studio 2013\WebSites\KShop\Files\temp.xlsx&quot;
Dim Extension As String = &quot;.xlsx&quot;

Dim ConStr As String = ConfigurationManager.ConnectionStrings(&quot;ConnString&quot;).ConnectionString()

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Me.BindGrid(FilePath, Extension)
End If
End Sub

Private Sub BindGrid(ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;]&quot;

oda.SelectCommand = cmdExcel
oda.Fill(dtbl)
connExcel.Close()

'Bind Data to GridView 
gvLocations.DataSource = dtbl
gvLocations.DataBind()

End Sub

Protected Sub UpdatePreference(sender As Object, e As EventArgs)
Dim locationIds As String() = (From p In Request.Form(&quot;LocationId&quot;).Split(&quot;,&quot;) Select p).ToArray()
Dim order As Integer = 1

For Each locationId As Integer In locationIds
Me.UpdatePreference(locationId, order)
order += 1
Next

Response.Redirect(Request.Url.AbsoluteUri)
End Sub

Private Sub UpdatePreference(locationId As Integer, order As Integer)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet
connExcel.Open()

cmdExcel.CommandText = &quot;UPDATE [&quot; &amp; SheetName &amp; &quot;] SET Order='&quot; &amp; order &amp; &quot;' WHERE ID=&quot; &amp; locationId &amp; &quot;&quot;
cmdExcel.ExecuteNonQuery()
connExcel.Close()

End Sub
End Class</pre>
<h3>Web.Config</h3>
<pre class="brush: xml; title: ; notranslate">&lt;connectionStrings&gt;
&lt;!--&lt;add name =&quot;Excel03ConString&quot; connectionString=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}; Extended Properties='Excel 8.0'&quot; /&gt;--&gt;
&lt;add name =&quot;ConnString&quot; connectionString=&quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 8.0'&quot;/&gt;
&lt;/connectionStrings&gt;</pre>
<h2>Common Challenges and Solutions</h2>
<p>1. Performance Issues with Large Datasets For grids with many items, consider: </p>
<p>&#8211; Virtual scrolling to render only visible items.<br />
&#8211; Debouncing drag events to reduce unnecessary re-renders.</p>
<p>2. Cross-Browser Compatibility Test the implementation across browsers and use polyfills if needed for older versions.</p>
<h2>Use Cases</h2>
<p>1. Content Management Systems: Reordering images or articles in a gallery.<br />
2. Task Management Apps: Prioritizing tasks by dragging them up or down.<br />
3. E-Commerce Platforms: Rearranging product listings.</p>
<h2>Conclusion</h2>
<p>Implementing drag and drop in a GridView enhances usability by allowing users to intuitively rearrange data. By following the steps outlined above, developers can create a seamless and interactive experience. Proper handling of events, styling, and persistence ensures the feature works reliably across different platforms and devices. With these techniques, you can build dynamic applications that improve user engagement and efficiency.</p>
<p>The post <a href="https://jharaphula.com/gridview-using-drag-drop/">How to Rearrange Rows in a Gridview using Drag and Drop?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/gridview-using-drag-drop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2017/03/drag-and-drop-gridview.png" medium="image" />
	</item>
		<item>
		<title>How to implement Forms Authentication in ASP.NET?</title>
		<link>https://jharaphula.com/forms-authentication-example/</link>
					<comments>https://jharaphula.com/forms-authentication-example/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 11 Feb 2017 05:06:14 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Authentication in ASP.NET]]></category>
		<category><![CDATA[Authentication Token]]></category>
		<category><![CDATA[implement Forms Authentication]]></category>
		<category><![CDATA[Types of Authentications]]></category>
		<category><![CDATA[Web.Config]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=7139</guid>

					<description><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-300x200.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Form Authentication in ASP.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-300x200.jpg 300w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-182x120.jpg 182w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Whether in a banking application or a job portal every where we required to authenticate user before allowing access. Or else Spam user can destroy...</p>
<p>The post <a href="https://jharaphula.com/forms-authentication-example/">How to implement Forms Authentication in ASP.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-300x200.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Form Authentication in ASP.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-300x200.jpg 300w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-182x120.jpg 182w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Whether in a banking application or a <a href="https://jharaphula.com/best-job-search-portals/" rel="noopener noreferrer" target="_blank">job</a> portal every where we required to authenticate user before allowing access. Or else Spam user can destroy our properties. In the login mechanism of ASP.NET using Form Authentication we can validate an user. During Forms Authentication ASP.NET authenticates user and maintains authentication token in a cookie for next consecutive actions. During page request the cookie travels with URL. In a ASP.NET page cycle Form Authentication participate through the FormsAuthenticationModule class.</p>
<p>To implement Form Authentication first you required to update you web.config file with the following line of Codes. In forms tag set loginUrl property value to Login page file path. Then to block anonymous users from unknown login set Authorization to deny All. Syntax for deny all is &lt;deny users=&#8221;?&#8221; /&gt;.</p>
<h3>Web.Config</h3>
<pre class="brush: xml; title: ; notranslate">&lt;system.web&gt;
&lt;authentication mode=&quot;Forms&quot;&gt;
&lt;forms loginUrl=&quot;login.aspx&quot; name=&quot;.lgnConfig&quot;&gt;
&lt;/forms&gt;
&lt;/authentication&gt;
&lt;authorization&gt;
&lt;deny users=&quot;?&quot; /&gt;
&lt;/authorization&gt;
&lt;/system.web&gt;</pre>
<p>In Login.aspx after validating user credentials, redirecting the logged user to default page using “RedirectFromLoginPage” method.</p>
<h3>Login.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; %&gt;
&lt;%@ Import Namespace=&quot;System.Web.Security&quot; %&gt;

&lt;script runat=&quot;server&quot;&gt;
Sub Login_Click(ByVal sender As Object, ByVal e As EventArgs)
If ((txtEmailID.Text = &quot;biswabhusan_panda@infosys.com&quot;) And _
(UserPass.Text = &quot;raghavi&quot;)) Then
FormsAuthentication.RedirectFromLoginPage _
(txtEmailID.Text, chkRemember.Checked)
Else
lblMsg.Text = &quot;Invalid credentials. Please try again.&quot;
End If
End Sub
&lt;/script&gt;

&lt;html&gt;
&lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;
&lt;title&gt;Exmple of Forms Authentication&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmLogin&quot; runat=&quot;server&quot;&gt;
&lt;h3&gt;User Login Page&lt;/h3&gt;
    
&lt;div&gt;E-mail ID&lt;/div&gt;
&lt;div&gt;&lt;asp:TextBox ID=&quot;txtEmailID&quot; runat=&quot;server&quot; /&gt;&lt;asp:RequiredFieldValidator ID=&quot;rfEmailID&quot; ControlToValidate=&quot; txtEmailID&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Empty values are not allow.&quot; runat=&quot;server&quot; /&gt;&lt;div&gt;

&lt;div&gt;Password&lt;/div&gt;
&lt;div&gt;&lt;asp:TextBox ID=&quot;txtPassword&quot; TextMode=&quot;Password&quot; runat=&quot;server&quot; /&gt;&lt;asp:RequiredFieldValidator ID=&quot;rfPassword&quot; ControlToValidate=&quot;txtPassword&quot; ErrorMessage=&quot; Empty values are not allow.&quot; runat=&quot;server&quot; /&gt;
&lt;/div&gt;

&lt;div&gt;&lt;asp:CheckBox ID=&quot;chkRemember&quot; runat=&quot;server&quot; /&gt;&amp;nbsp;Remember for Next Login&lt;/div&gt;
&lt;div&gt;&lt;asp:Button ID=&quot;btnLogin&quot; OnClick=&quot;Login_Click&quot; Text=&quot;Log in&quot; runat=&quot;server&quot; /&gt;&lt;/div&gt;
&lt;div&gt;&lt;asp:Label ID=&quot;lblMsg&quot; ForeColor=&quot;red&quot; runat=&quot;server&quot; /&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Once user is at default page, In default page provided Signout button. Which destroys authenticated cookie using FormsAuthentication.SignOut method.</p>
<h3>Default.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; %&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Successful Forms Authentication&lt;/title&gt;
&lt;/head&gt;

&lt;script runat=&quot;server&quot;&gt;
Sub Page_Load(ByVal Src As Object, ByVal e As EventArgs)
lblWelcomeMsg.Text = &quot;Welcome, &quot; &amp; Context.User.Identity.Name
End Sub

Sub Signout_Click(ByVal sender As Object, ByVal e As EventArgs)
FormsAuthentication.SignOut()
Response.Redirect(&quot;Login.aspx&quot;)
End Sub
&lt;/script&gt;

&lt;body&gt;
&lt;h3&gt;Example of Forms Authentication&lt;/h3&gt;
&lt;asp:Label ID=&quot;lblWelcomeMsg&quot; runat=&quot;server&quot; /&gt;
&lt;form id=&quot;frmDefault&quot; runat=&quot;server&quot;&gt;
&lt;asp:Button ID=&quot;btnSignOut&quot; OnClick=&quot;Signout_Click&quot; Text=&quot;Sign Out&quot; runat=&quot;server&quot; /&gt;&lt;p&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/forms-authentication-example/">How to implement Forms Authentication in ASP.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/forms-authentication-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2017/02/Form-Authentication.jpg" medium="image" />
	</item>
		<item>
		<title>How to Bind Data to DataPager inside ListView Control in ASP.NET?</title>
		<link>https://jharaphula.com/bind-data-datapager-listview/</link>
					<comments>https://jharaphula.com/bind-data-datapager-listview/#comments</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 25 Dec 2016 16:56:34 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Bind Data to DataPager]]></category>
		<category><![CDATA[DataPager]]></category>
		<category><![CDATA[DataPager inside ListView Control]]></category>
		<category><![CDATA[How to Bind Data?]]></category>
		<category><![CDATA[ListView Control in ASP.NET]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=7000</guid>

					<description><![CDATA[<img width="300" height="169" src="https://jharaphula.com/wp-content/uploads/2016/12/ListView-300x169.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Bind Data to DataPager inside ListView Control in ASP.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/ListView-300x169.png 300w, https://jharaphula.com/wp-content/uploads/2016/12/ListView.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In ASP.NET there are several controls to present data in a web page. Some of the popular data controls are GridView, ListView, DetailsView, FormView, Repeater...</p>
<p>The post <a href="https://jharaphula.com/bind-data-datapager-listview/">How to Bind Data to DataPager inside ListView Control in ASP.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="169" src="https://jharaphula.com/wp-content/uploads/2016/12/ListView-300x169.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Bind Data to DataPager inside ListView Control in ASP.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/ListView-300x169.png 300w, https://jharaphula.com/wp-content/uploads/2016/12/ListView.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In ASP.NET there are several controls to present data in a web page. Some of the popular data controls are GridView, ListView, DetailsView, FormView, Repeater or SQLDataSource. If you will notice in the recent versions of Visual Studio you will watch DataPager as a Data Control. Like a Gridview using DataPager Control we can present data in tabular shape. Look at the example below where I am binding data to a DataPager control inside a ListView Control.</p>
<p>To enable users to page through data in a ListView control or a control which implements IPageableItemContainer <a href="https://jharaphula.com/oops-concepts-with-examples/" rel="noopener noreferrer" target="_blank">interface</a>, we can use DataPager control in ASP.NET. While declaring a DataPager Control declare it inside LayoutTemplate. If your DataPager Control is not inside the ListView control then you need to set PagedControlID property value to ListView control ID.</p>
<h3>ListView from Default.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:ListView ID=&quot;lvEmployees&quot; runat=&quot;server&quot; GroupPlaceholderID=&quot;grpPlaceHoder&quot;
ItemPlaceholderID=&quot;itemPlaceHolder&quot; OnPagePropertiesChanging=&quot;OnPropertiesChanging&quot;&gt;
&lt;LayoutTemplate&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Emp ID&lt;/th&gt;
&lt;th&gt;Emp Name&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;asp:PlaceHolder runat=&quot;server&quot; ID=&quot;grpPlaceHoder&quot;&gt;&lt;/asp:PlaceHolder&gt;
&lt;tr&gt;
&lt;td colspan=&quot;3&quot;&gt;
&lt;asp:DataPager ID=&quot;dpager&quot; runat=&quot;server&quot; PagedControlID=&quot;lvEmployees&quot; PageSize=&quot;10&quot;&gt;
&lt;Fields&gt;
&lt;asp:NextPreviousPagerField ButtonType=&quot;Link&quot; ShowFirstPageButton=&quot;false&quot; ShowPreviousPageButton=&quot;true&quot;
ShowNextPageButton=&quot;false&quot; /&gt;
&lt;asp:NumericPagerField ButtonType=&quot;Link&quot; /&gt;
&lt;asp:NextPreviousPagerField ButtonType=&quot;Link&quot; ShowNextPageButton=&quot;true&quot; ShowLastPageButton=&quot;false&quot; ShowPreviousPageButton=&quot;false&quot; /&gt;
&lt;/Fields&gt;
&lt;/asp:DataPager&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/LayoutTemplate&gt;
&lt;GroupTemplate&gt;
&lt;tr&gt;
&lt;asp:PlaceHolder runat=&quot;server&quot; ID=&quot;itemPlaceHolder&quot;&gt;&lt;/asp:PlaceHolder&gt;
&lt;/tr&gt;
&lt;/GroupTemplate&gt;
&lt;ItemTemplate&gt;
&lt;td&gt;&lt;%# Eval(&quot;ID&quot;)%&gt;&lt;/td&gt;
&lt;td&gt;&lt;%# Eval(&quot;Name&quot;)%&gt;&lt;/td&gt;
&lt;td&gt;&lt;%# Eval(&quot;Status&quot;) %&gt;&lt;/td&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:ListView&gt;</pre>
<h3>Code-behind Default.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.IO
Imports System.Data.OleDb
Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Dim FilePath As String = &quot;C:\Users\biswabhusan_panda\Documents\Visual Studio 2013\WebSites\ExcelApp\Files\temp.xlsx&quot;
Dim Extension As String = &quot;.xlsx&quot;

Dim ConStr As String = ConfigurationManager.ConnectionStrings(&quot;ConnString&quot;).ConnectionString()

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Me.BindListView(FilePath, Extension)
End If
End Sub

Protected Sub OnPropertiesChanging(sender As Object, e As PagePropertiesChangingEventArgs)
TryCast(lvEmployees.FindControl(&quot;dpager&quot;), DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, False)
Me.BindListView(FilePath, Extension)
End Sub

Private Sub BindListView(ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;]&quot;

oda.SelectCommand = cmdExcel
oda.Fill(dtbl)
connExcel.Close()

'Bind Data to GridView 
lvEmployees.DataSource = dtbl
lvEmployees.DataBind()

End Sub
End Class</pre>
<p>The post <a href="https://jharaphula.com/bind-data-datapager-listview/">How to Bind Data to DataPager inside ListView Control in ASP.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/bind-data-datapager-listview/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/12/ListView.png" medium="image" />
	</item>
		<item>
		<title>How to update records in a Gridview using Auto Generate Edit Button?</title>
		<link>https://jharaphula.com/gridview-auto-generate-edit-button/</link>
					<comments>https://jharaphula.com/gridview-auto-generate-edit-button/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Mon, 12 Dec 2016 17:34:30 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Gridview]]></category>
		<category><![CDATA[ASP.NET Gridview Example]]></category>
		<category><![CDATA[Auto Generate Edit Button]]></category>
		<category><![CDATA[How to update records]]></category>
		<category><![CDATA[TemplateField]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=6955</guid>

					<description><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button-300x187.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to update records in a Gridview using Auto Generate Edit Button?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button-300x187.png 300w, https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In ASP.NET Gridview is a best approach to present Tabular data. Looking into the advanced functionalities of a Gridview control using this you can fetch...</p>
<p>The post <a href="https://jharaphula.com/gridview-auto-generate-edit-button/">How to update records in a Gridview using Auto Generate Edit Button?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button-300x187.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to update records in a Gridview using Auto Generate Edit Button?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button-300x187.png 300w, https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In ASP.NET Gridview is a best approach to present Tabular data. Looking into the advanced functionalities of a Gridview control using this you can fetch data from any data media like <a href="https://jharaphula.com/sql-queries-with-example/" target="_blank" rel="noopener noreferrer">SQL</a>, MySQL or even an Excel File. In the below demo I have an Excel File with 5 columns of data. Using Gridview we are presenting those excel records in tabular shape on a web page.</p>
<p>To try the below demo, Create an ASP.NET Web Application. Then to prepare data open an Excel File. Add any 5 columns of data with single word header. Name the File as temp.xlsx. Then in your application under root folder create a folder named as &#8220;FILES&#8221;. Move the temp.xlsx File inside. To debug the below app in your new app, Add the Default.aspx file with it&#8217;s code-behind file in VB.NET. To get started Copy the below Gridview Control in your Default.aspx page.</p>
<h2>Gridview using Auto Generate Edit Button</h2>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView ID=&quot;grdRecords&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot; AutoGenerateEditButton=&quot;true&quot; AllowPaging=&quot;true&quot; PageSize=&quot;20&quot; Font-Names=&quot;Arial&quot; Font-Size=&quot;11pt&quot; AlternatingRowStyle-BackColor=&quot;#C2D69B&quot; HeaderStyle-BackColor=&quot;green&quot; HeaderStyle-ForeColor=&quot;#FFFFFF&quot; OnPageIndexChanging=&quot;OnPaging&quot; Width=&quot;100%&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField HeaderText=&quot;Emp Name&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpName&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Name&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=&quot;Emp ID&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpID&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;ID&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=&quot;Status&quot;&gt;
&lt;EditItemTemplate&gt;
&lt;asp:DropDownList ID=&quot;ddlRowStatus&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;&gt;
&lt;asp:ListItem&gt;thisis&lt;/asp:ListItem&gt;
&lt;/asp:DropDownList&gt;
&lt;/EditItemTemplate&gt;
&lt;ItemTemplate&gt;
&lt;%# Eval(&quot;Status&quot;) %&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt; 
&lt;asp:TemplateField HeaderText=&quot;Starts&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblStarts&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Starts&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=&quot;Ends&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEnds&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Ends&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;                   
&lt;/Columns&gt;
&lt;/asp:GridView&gt;</pre>
<p>You must noticed here how I am binding data to the above Gridview. Status Field is the Field which I want to edit using Auto Generate Edit Button. That&#8217;s why inside template field for this column I am with 2 sub-entries ItemTemplate and EditItemTemplate. EditItemTemplate holding that control which will display in the place of Status column at the time of Edit.</p>
<p>The below Code is from the Code-behind File. Logic is very simple. Using BindGrid() sub-routine we are displaying records in the Grid. 3 more gridview events I used grdRecords_RowCancelingEdit, grdRecords_RowDataBound, grdRecords_RowUpdating. Using RowCancelingEdit() event I am handling the Cancel button functionalities. While using RowDataBound() we are binding data for Status dropdownlist in Grid. Finally after user Edit the record we are updating the Excel File under RowUpdating() event. FilePath and Extention these two are used as parameters in many Functions. That&#8217;s why it is declared as global variable.</p>
<h2>Code-behind Codes for Gridview using Edit button</h2>
<pre class="brush: vb; title: ; notranslate">Imports System.IO
Imports System.Data.OleDb
Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Dim FilePath As String = &quot;C:\Users\biswabhusan_panda\Documents\Visual Studio 2013\WebSites\ExcelApp\Files\temp.xlsx&quot;
Dim Extension As String = &quot;.xlsx&quot;
Dim ddlRowStatus As DropDownList

Dim ConStr As String = ConfigurationManager.ConnectionStrings(&quot;ConnString&quot;).ConnectionString()

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState(&quot;Filter&quot;) = &quot;ALL&quot;
BindGrid(FilePath, Extension)
End If
End Sub

Protected Sub OnPaging(sender As Object, e As GridViewPageEventArgs)
grdRecords.PageIndex = e.NewPageIndex
Me.BindGrid(FilePath, Extension)
End Sub

Private Sub BindGrid(ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

If ViewState(&quot;idFilter&quot;) &lt;&gt; &quot;&quot; Then
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;] WHERE ID LIKE '%&quot; &amp; ViewState(&quot;idFilter&quot;).ToString() &amp; &quot;%'&quot;
ElseIf ViewState(&quot;nameFilter&quot;) &lt;&gt; &quot;&quot; Then
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;] WHERE NAME LIKE '%&quot; &amp; ViewState(&quot;nameFilter&quot;).ToString() &amp; &quot;%'&quot;
Else
If ViewState(&quot;Filter&quot;).ToString() = &quot;ALL&quot; Then
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;]&quot;
Else
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp; SheetName &amp; &quot;] WHERE Status='&quot; &amp; ViewState(&quot;Filter&quot;).ToString() &amp; &quot;'&quot;
End If
End If

oda.SelectCommand = cmdExcel
oda.Fill(dtbl)
connExcel.Close()

'Bind Data to GridView 
grdRecords.DataSource = dtbl
grdRecords.DataBind()

End Sub

Protected Sub grdRecords_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles grdRecords.RowCancelingEdit
grdRecords.EditIndex = -1
Me.BindGrid(FilePath, Extension)
End Sub

Protected Sub grdRecords_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles grdRecords.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.RowState And DataControlRowState.Edit) &gt; 0 Then
ddlRowStatus = DirectCast(e.Row.FindControl(&quot;ddlRowStatus&quot;), DropDownList)

If (ddlRowStatus.ID = &quot;ddlRowStatus&quot;) Then

Dim list As New ArrayList

ConStr = String.Format(ConStr, FilePath)

Dim ConnExcel As New OleDbConnection(ConStr)
Dim CmdA As New OleDbCommand()
Dim CmdB As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

CmdA.Connection = ConnExcel
CmdB.Connection = ConnExcel

'Get the name of First Sheet 
ConnExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = ConnExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

ConnExcel.Close()

'Read Data from First Sheet 
ConnExcel.Open()

CmdA.CommandText = &quot;SELECT DISTINCT Status From [&quot; &amp; SheetName &amp; &quot;]&quot;

Dim reader As OleDbDataReader = CmdA.ExecuteReader()

If reader.HasRows Then
Do While reader.Read()
list.Add(reader(0).ToString())
Loop
End If

reader.Close()

ddlRowStatus.DataSource = list
ddlRowStatus.DataBind()
End If
End If
End If
End Sub

Protected Sub grdRecords_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles grdRecords.RowEditing
grdRecords.EditIndex = e.NewEditIndex
Me.BindGrid(FilePath, Extension)
End Sub

Protected Sub grdRecords_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles grdRecords.RowUpdating

ddlRowStatus = DirectCast(grdRecords.Rows(e.RowIndex).FindControl(&quot;ddlRowStatus&quot;), DropDownList)
Dim lblEmpID As Label = DirectCast(grdRecords.Rows(e.RowIndex).FindControl(&quot;lblEmpID&quot;), Label)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

cmdExcel.CommandText = &quot;UPDATE [&quot; &amp; SheetName &amp; &quot;] SET Status='&quot; &amp; ddlRowStatus.SelectedValue &amp; &quot;' WHERE ID=&quot; &amp; lblEmpID.Text.ToString() &amp; &quot;&quot;
cmdExcel.ExecuteNonQuery()
connExcel.Close()

grdRecords.EditIndex = -1
Me.BindGrid(FilePath, Extension)

End Sub

End Class</pre>
<p>The post <a href="https://jharaphula.com/gridview-auto-generate-edit-button/">How to update records in a Gridview using Auto Generate Edit Button?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/gridview-auto-generate-edit-button/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/12/gridview-auto-edit-button.png" medium="image" />
	</item>
		<item>
		<title>How to display Excel File records in an ASP.NET Gridview?</title>
		<link>https://jharaphula.com/excel-records-asp-net-gridview/</link>
					<comments>https://jharaphula.com/excel-records-asp-net-gridview/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Wed, 07 Dec 2016 08:55:56 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Gridview]]></category>
		<category><![CDATA[ASP.NET Gridview Example]]></category>
		<category><![CDATA[Display Excel File records]]></category>
		<category><![CDATA[MS-Excel like Table]]></category>
		<category><![CDATA[Page.IsPostBack]]></category>
		<category><![CDATA[Records in an ASP.NET Gridview]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=6953</guid>

					<description><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display Excel File records in an ASP.NET Gridview?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Due to the popularity of MS Excel, Still today more than 75% of Organizations prefers to maintain their data in MS-Excel. Whether it&#8217;s the matter...</p>
<p>The post <a href="https://jharaphula.com/excel-records-asp-net-gridview/">How to display Excel File records in an ASP.NET Gridview?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display Excel File records in an ASP.NET Gridview?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Due to the popularity of MS Excel, Still today more than 75% of Organizations prefers to maintain their data in MS-Excel. Whether it&#8217;s the matter of project management or a budget plan, MS-Excel is an awesome tool. I noticed in my organization more then 80% percent records are in Excel. One day my boss come to me with a plan that he need to update &#8220;Utilization_Reports.xlsx&#8221; using User Interface. For him I had taken the ownership to develop this tool. During this development phases I found how to fetch data from an Excel File like a database table using <a href="https://jharaphula.com/sql-queries-with-example/" target="_blank" rel="noopener noreferrer">SQL Queries</a>. This stay interesting for me. Sharing the same for your reference.</p>
<h3>Gridview</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView ID=&quot;grdRecords&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot; AllowPaging=&quot;true&quot; PageSize=&quot;10&quot; Font-Names=&quot;Arial&quot; Font-Size=&quot;11pt&quot; AlternatingRowStyle-BackColor=&quot;#C2D69B&quot; HeaderStyle-BackColor=&quot;green&quot; HeaderStyle-ForeColor=&quot;#FFFFFF&quot; OnPageIndexChanging=&quot;OnPaging&quot; AutoGenerateEditButton=&quot;true&quot; Width=&quot;100%&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField  HeaderText=&quot;Employee Name&quot; SortExpression=&quot;Name&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpName&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Name&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=&quot;Employee ID&quot; SortExpression=&quot;ID&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpID&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;ID&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField&gt;
&lt;HeaderTemplate&gt;
Status:
&lt;asp:DropDownList ID=&quot;ddlStatus&quot; runat=&quot;server&quot; OnSelectedIndexChanged=&quot;CountryChanged&quot; AutoPostBack=&quot;true&quot; AppendDataBoundItems=&quot;true&quot;&gt;
&lt;asp:ListItem Text = &quot;ALL&quot; Value = &quot;ALL&quot;&gt;&lt;/asp:ListItem&gt;
&lt;/asp:DropDownList&gt;
&lt;/HeaderTemplate&gt;
&lt;EditItemTemplate&gt;
&lt;asp:DropDownList ID=&quot;ddlRowStatus&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;&gt;
&lt;asp:ListItem&gt;thisis&lt;/asp:ListItem&gt;
&lt;/asp:DropDownList&gt;
&lt;/EditItemTemplate&gt;
&lt;ItemTemplate&gt;
&lt;%# Eval(&quot;Status&quot;) %&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;                    
&lt;/Columns&gt;
&lt;/asp:GridView&gt;</pre>
<p>As we mentioned above here I want to fetch an excel file like a database table. So first let us declare the connection string for MS-Excel. That&#8217;s what I did in below web.config file.</p>
<h3>Web.Config</h3>
<pre class="brush: xml; title: ; notranslate">&lt;appSettings&gt;
&lt;add key=&quot;FolderPath&quot; value=&quot;Files/&quot;/&gt;
&lt;/appSettings&gt;
&lt;connectionStrings&gt;
&lt;!--&lt;add name =&quot;Excel03ConString&quot; connectionString=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}; Extended Properties='Excel 8.0'&quot; /&gt;--&gt;
&lt;add name =&quot;ConnString&quot; connectionString=&quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 8.0'&quot;/&gt;
&lt;/connectionStrings&gt;</pre>
<p>To bind data to the Gridview in Codebehind I am with the below Subroutine. In BindGrid I am passing FilePath and File Extention as the parameters. These are simple string varibales. Declare as global variables. To fetch data from Excel like a database First I am traking the 0th Sheet of Excel. Then running a SQL Query over the table of my Excel File. Finally using a ASP.NET DataAdapter I am filling data to the gridview.</p>
<h3>BindGrid</h3>
<pre class="brush: vb; title: ; notranslate">Private Sub BindGrid(ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

If ViewState(&quot;Filter&quot;).ToString() = &quot;ALL&quot; Then
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp;amp; SheetName &amp;amp; &quot;]&quot;
Else
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp;amp; SheetName &amp;amp; &quot;] WHERE Status='&quot; &amp;amp; ViewState(&quot;Filter&quot;).ToString() &amp;amp; &quot;'&quot;
End If

oda.SelectCommand = cmdExcel
oda.Fill(dtbl)
connExcel.Close()

'Bind Data to GridView 
grdRecords.DataSource = dtbl
grdRecords.DataBind()

End Sub</pre>
<p>The above subroutine is responsible to Fill the Gridview. But to display data in Gridview we need to Call this during page load. That’s what I am doing in below. Inside the not page.ispostback event I am calling the Function with required parameters.</p>
<h3>In Page Load</h3>
<pre class="brush: vb; title: ; notranslate">Dim FilePath as String = &quot;C:/demo.xlsx&quot;
Dim Extension as String = &quot;.xlsx&quot;

If Not Page.IsPostBack Then
ViewState(&quot;Filter&quot;) = &quot;ALL&quot;
BindGrid(FilePath, Extension)
End If</pre>
<p>The post <a href="https://jharaphula.com/excel-records-asp-net-gridview/">How to display Excel File records in an ASP.NET Gridview?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/excel-records-asp-net-gridview/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/12/gridview-excel-records.jpg" medium="image" />
	</item>
		<item>
		<title>How to add Search Filter in the Column Header of Gridview?</title>
		<link>https://jharaphula.com/search-filter-column-header-gridview/</link>
					<comments>https://jharaphula.com/search-filter-column-header-gridview/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Wed, 07 Dec 2016 08:55:26 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Gridview Example]]></category>
		<category><![CDATA[Column Header of Gridview]]></category>
		<category><![CDATA[How to add Search Filter]]></category>
		<category><![CDATA[Search Filter in the Column Header]]></category>
		<category><![CDATA[VB.NET]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=6892</guid>

					<description><![CDATA[<img width="300" height="216" src="https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header-300x216.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to add Search Filter in the Column Header of Gridview?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header-300x216.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>We use filter to Search information&#8217;s easier. Recall a web-page where you have lot of records in a Grid. What your Customer wants is &#8220;They...</p>
<p>The post <a href="https://jharaphula.com/search-filter-column-header-gridview/">How to add Search Filter in the Column Header of Gridview?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="216" src="https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header-300x216.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to add Search Filter in the Column Header of Gridview?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header-300x216.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>We use filter to Search information&#8217;s easier. Recall a <a href="https://jharaphula.com/bay-area-web-design/" rel="noopener noreferrer" target="_blank">web-page</a> where you have lot of records in a Grid. What your Customer wants is &#8220;They want to provide Search filter in the header row for some columns of the grid&#8221;. You can say like MS-Excel column filter. Here my app is with ASP.NET. To display data I am using a Gridview. Here in Gridview I am with 3 columns Name, ID and Status. Refer to my Customer they wants me to implement a dropdownlist with all the possible status in Status column header. Functionally, On change of dropdownlist event he wants to filter only those records which are having the selected Status.</p>
<p>Look at the below demo app. Here in place of database I am fetching data from a MS-Excel file. Data structure I maintained in Excel file is with 3 columns Name, ID and Status. Similar to a database table here Emp ID acts like the Primary Key. This is unique for each.</p>
<h3>Gridview</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView ID=&quot;grdRecords&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot; AllowPaging=&quot;true&quot; PageSize=&quot;10&quot; Font-Names=&quot;Arial&quot; Font-Size=&quot;11pt&quot; AlternatingRowStyle-BackColor=&quot;#C2D69B&quot; HeaderStyle-BackColor=&quot;green&quot; HeaderStyle-ForeColor=&quot;#FFFFFF&quot; OnPageIndexChanging=&quot;OnPaging&quot; AutoGenerateEditButton=&quot;true&quot; Width=&quot;100%&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField  HeaderText=&quot;Employee Name&quot; SortExpression=&quot;Name&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpName&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Name&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=&quot;Employee ID&quot; SortExpression=&quot;ID&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblEmpID&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;ID&quot;)%&gt;'&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField&gt;
&lt;HeaderTemplate&gt;
Status:
&lt;asp:DropDownList ID=&quot;ddlStatus&quot; runat=&quot;server&quot; OnSelectedIndexChanged=&quot;CountryChanged&quot; AutoPostBack=&quot;true&quot; AppendDataBoundItems=&quot;true&quot;&gt;
&lt;asp:ListItem Text = &quot;ALL&quot; Value = &quot;ALL&quot;&gt;&lt;/asp:ListItem&gt;
&lt;/asp:DropDownList&gt;
&lt;/HeaderTemplate&gt;
&lt;EditItemTemplate&gt;
&lt;asp:DropDownList ID=&quot;ddlRowStatus&quot; runat=&quot;server&quot; AutoPostBack=&quot;true&quot;&gt;
&lt;asp:ListItem&gt;thisis&lt;/asp:ListItem&gt;
&lt;/asp:DropDownList&gt;
&lt;/EditItemTemplate&gt;
&lt;ItemTemplate&gt;
&lt;%# Eval(&quot;Status&quot;) %&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;                    
&lt;/Columns&gt;
&lt;/asp:GridView&gt;</pre>
<p>Like the general, to bind data to the grid I am calling BindGrid() subroutine under page_load. Additionally I am with 1 more sub-routine BindCountryList() which responsible to display all possible Status from Excel File. To reset custom search in 0th index of dropdownlist I added “ALL”. By changing dropdownlist selected value to “ALL”, it is updating a ViewState variable. Which conditionally filtering using a SQL Query in BindGrid() subroutine.</p>
<h3>VB.NET Code Behind</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.IO
Imports System.Data.OleDb
Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Dim FilePath As String = &quot;C:\Users\biswabhusan_panda\Documents\Visual Studio 2013\WebSites\ExcelApp\Files\temp.xlsx&quot;
Dim Extension As String = &quot;.xlsx&quot;

Dim ConStr As String = ConfigurationManager.ConnectionStrings(&quot;ConnString&quot;).ConnectionString()

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState(&quot;Filter&quot;) = &quot;ALL&quot;
BindGrid(FilePath, Extension)
End If
End Sub

Protected Sub OnPaging(sender As Object, e As GridViewPageEventArgs)
grdRecords.PageIndex = e.NewPageIndex
Me.BindGrid(FilePath, Extension)
End Sub

Protected Sub CountryChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim ddlStatus As DropDownList = DirectCast(sender, DropDownList)
ViewState(&quot;Filter&quot;) = ddlStatus.SelectedValue
Me.BindGrid(FilePath, Extension)
End Sub

Private Sub BindGrid(ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim connExcel As New OleDbConnection(ConStr)
Dim cmdExcel As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

cmdExcel.Connection = connExcel

'Get the name of First Sheet 
connExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

connExcel.Close()

'Read Data from First Sheet 
connExcel.Open()

If ViewState(&quot;Filter&quot;).ToString() = &quot;ALL&quot; Then
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp;amp; SheetName &amp;amp; &quot;]&quot;
Else
cmdExcel.CommandText = &quot;SELECT * From [&quot; &amp;amp; SheetName &amp;amp; &quot;] WHERE Status='&quot; &amp;amp; ViewState(&quot;Filter&quot;).ToString() &amp;amp; &quot;'&quot;
End If

oda.SelectCommand = cmdExcel
oda.Fill(dtbl)
connExcel.Close()

'Bind Data to GridView 
grdRecords.DataSource = dtbl
grdRecords.DataBind()

Dim ddlStatus As DropDownList = DirectCast(grdRecords.HeaderRow _
.FindControl(&quot;ddlStatus&quot;), DropDownList)
Me.BindCountryList(ddlStatus, FilePath, Extension)

End Sub

Private Sub BindCountryList(ByVal ddlStatus As DropDownList, ByVal FilePath As String, ByVal Extension As String)

ConStr = String.Format(ConStr, FilePath)

Dim ConnExcel As New OleDbConnection(ConStr)
Dim CmdA As New OleDbCommand()
Dim oda As New OleDbDataAdapter()
Dim dtbl As New DataTable()

CmdA.Connection = ConnExcel

'Get the name of First Sheet 
ConnExcel.Open()

Dim dtExcelSchema As DataTable
dtExcelSchema = ConnExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
Dim SheetName As String = dtExcelSchema.Rows(0)(&quot;TABLE_NAME&quot;).ToString()

CmdA.CommandText = &quot;SELECT DISTINCT Status From [&quot; &amp;amp; SheetName &amp;amp; &quot;]&quot;

ddlStatus.DataSource = CmdA.ExecuteReader()
ddlStatus.DataTextField = &quot;Status&quot;
ddlStatus.DataValueField = &quot;Status&quot;
ddlStatus.DataBind()
ConnExcel.Close()

ddlStatus.Items.FindByValue(ViewState(&quot;Filter&quot;).ToString()) _
.Selected = True
End Sub
End Class</pre>
<p>The post <a href="https://jharaphula.com/search-filter-column-header-gridview/">How to add Search Filter in the Column Header of Gridview?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/search-filter-column-header-gridview/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/12/search-filter-column-header.jpg" medium="image" />
	</item>
		<item>
		<title>ADO.NET ExecuteNonQuery, ExecuteReader, ExecuteScalar Examples</title>
		<link>https://jharaphula.com/ado-net-architecture-examples-beginners/</link>
					<comments>https://jharaphula.com/ado-net-architecture-examples-beginners/#comments</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 07 Aug 2016 06:46:27 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ActiveX Data Objects]]></category>
		<category><![CDATA[ADO.NET Architecture]]></category>
		<category><![CDATA[ASP.NET Interview Questions]]></category>
		<category><![CDATA[ExecuteNonQuery]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=4586</guid>

					<description><![CDATA[<img width="300" height="225" src="https://jharaphula.com/wp-content/uploads/2016/08/ado-300x225.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="ADO.NET Architecture with Examples for beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/08/ado-300x225.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/08/ado.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>ADO stands for ActiveX Data Objects. Command object is the biggest object in ADO.NET. It is the only object which can perform actions with database....</p>
<p>The post <a href="https://jharaphula.com/ado-net-architecture-examples-beginners/">ADO.NET ExecuteNonQuery, ExecuteReader, ExecuteScalar Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="225" src="https://jharaphula.com/wp-content/uploads/2016/08/ado-300x225.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="ADO.NET Architecture with Examples for beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/08/ado-300x225.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/08/ado.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>ADO stands for ActiveX Data Objects. Command object is the biggest object in ADO.NET. It is the only object which can perform actions with database. You can create instances of Command object using Command class or Connection.Create. For absolute beginners in this session let us explore more about ADO.NET architecture with examples.</p>
<h2>Connection using ADO.NET</h2>
<pre class="brush: vb; title: ; notranslate">SqlConnection sqlConn = new SqlConnection(&quot;............&quot;);
SqlCommand sqlCmd = sqlConn.CreateCommand();</pre>
<p>All databases supports 2 types of queries.</p>
<p><strong>Action Queries</strong> &#8211; Action queries are those which change the state of database and which don’t return any results except the number of records affected. Example of few action based queries are Insert, Delete &amp; Update statements.</p>
<p><strong>Non-action Queries</strong> &#8211; Non-action queries are those which don’t affect the database but return the result. Example of non-action based queries are Select statements.</p>
<h2>ADO.NET Methods to Executing queries</h2>
<p>ADO.NET Command object provides the following methods to execute queries.</p>
<ul>
<li>ExecuteNonQuery()</li>
<li>ExecuteReader()</li>
<li>ExecuteScalar()</li>
<li>ExecuteXMLReader()</li>
</ul>
<h2>1. ExecuteNonQuery</h2>
<p>This method is used to execute those queries which perform some action &amp; changes against the state of the database. We use this method to execute action based queries such as Insert, Delete or Update records.</p>
<p>Ex:</p>
<pre class="brush: sql; title: ; notranslate">Delete * from EmpDetails;</pre>
<p>Or</p>
<pre class="brush: sql; title: ; notranslate">INSERT INTO EmpDetails VALUES(‘Biswabhusan’, ‘Software Developer’, ‘InfoSys’);</pre>
<h2>2. ExecuteReader</h2>
<p>Using this method we can execute any kind of Select Statements. ExecuteReader returns single or multiple value depending upon the Query.</p>
<p>Ex:</p>
<pre class="brush: sql; title: ; notranslate">SELECT EmpName FROM EmpDetails; //This query returns multiple values.
SELECT count(*) FROM EmpDetails; //This query returns a single value.

SELECT emp.EmpID, emp.EmpName, dep.DepNo, dep.DepName from EmpDetails emp, DepDetails dep where emp.DepNo = dep.DepNo //This conditional query returns values from multiple tables.</pre>
<h2>3. ExecuteScalar</h2>
<p>This method is used for Select statements which return only single values.</p>
<p>Ex:</p>
<pre class="brush: sql; title: ; notranslate">SELECT count(*) FROM EmpDetails;</pre>
<h2>4. ExecuteXMLReader</h2>
<p>This method is applicable only for SqlClient namespace. It is used for queries which return XML data. But OLEDB managed provider does not support this method.</p>
<p>Ex:</p>
<pre class="brush: sql; title: ; notranslate">SELECT * FROM JobDetails FOR XML AUTO</pre>
<p>Note: ExecuteNonQuery(), which is included from ADO.NET Version 1.0/1.1 is used for synchronous execution of queries, whereas BeginExecuteQuery() and EndExecuteQuery() methods which were introduced in ADO.NET Version 2.0 are used for asynchronous execution of queries.</p>
<h2>Batch SQL</h2>
<p>We can write more than one SQL statement in a single string and execute them as a group(internally execution takes place one after the other) at the same time. This is called batch SQL. The statements are separated by a semicolon and written in the same string.</p>
<p>Ex:</p>
<pre class="brush: sql; title: ; notranslate">“SELECT empName FROM EmpDetails; SELECT * FROM JobDetails; SELECT * FROM DepDetails”</pre>
<p>Batch SQL is very effective &amp; saves time because it is not necessary to wait for the execution of first statement, in order to run the next statement. But there is also a great drawback in this approach, which relates to the SQL injection attacks.</p>
<p><strong>SQL Injection attacks</strong> &#8211; If even a Single statement which is harmful to the <a href="https://jharaphula.com/database-basics-terminologies-definition/" target="_blank" rel="noopener noreferrer">database</a> is provided in the batch, it results in stalling of the whole database.</p>
<h2>DataReader</h2>
<p>In ADO.NET there are only two objects which can store data. One is DataSet while the other is DataReader.</p>
<p><strong>Features of DataReader</strong> &#8211; DataReader is a forward only accessible object. Using DataReader we can only read the data. It is a read-only object of ADO.NET. It provides sequential access for rows &amp; can be extended for sequential column access also.</p>
<p><strong>How DataReader Works?</strong></p>
<p>The select statement from the command object is processed and a ResultSet with the required data is created in the form of rows and columns at the database server. The address of this ResultSet is provided to the DataReader.</p>
<pre class="brush: vb; title: ; notranslate">cmd=new SqlCommand(“SELECT * FROM EmpDetails”, conn);
dr=cmd.ExecuteReader(); //provides the address of the ResultSet to the DataReader(dr)</pre>
<p>When the read() method of the DataReader is used it returns true if records are present and false if records are not present. At the same time if records are present, a similar structure like the ResultSet is created at the client side and the first record is fetched into it. The DataReader reads the record from this structure. dr[n] is an indexer to access its created structure.</p>
<p>Ex: dr[0] provides the first column of the retrieved row.<br />
dr[1] provides the second column of the retrieved row.</p>
<p>A pointer exists on ResultSet to identify the record being read. When the read() method is again called from the DataReader, the pointer moves to the next record if present. The structure at the DataReader now gets overwritten by this record.</p>
<p><strong>Drawbacks of DataReader</strong> &#8211; It is a forward-only and read-only object. DataReader is a connection-oriented object, which means that the access to data is possible only as long as the connection exists. DataReader works only on databases, but not on other data sources like XML files.</p>
<p><em>Note</em>: It is always necessary to close the DataReader object after the required data is read. Inspite of all drawbacks, DataReader usage is in its performance. To access data, DataReader is the fastest object in entire .NET Framework.</p>
<h3>More DataReader Methods and Properties</h3>
<p><strong>dr.GetString(0)</strong>: This statement is used to retrieve the data in the required format. Here the requirement is to retrieve the first column value of the DataReader in the form of a string. Normally for this purpose, the below method is adopted.</p>
<p>textBox1.Text=dr[0].ToString();</p>
<p>Here the data is first retrieved and then converted into string format. But if dr.GetString(0) is used, the data is directly retrieved in the form of string, which aids in better performance.</p>
<p><strong>dr.GetInt32(1)</strong> &#8211; This works similar to the above method, but fetches data in the form of an integer. Similarly there are methods like GetDouble, GetByte, GetDateTime etc. for different datatypes.</p>
<p><strong>HasRows Property</strong> &#8211; It checks whether records are present or not and returns true or false accordingly. This property provides better performance than Read() because Read method checks the presence of the records and also reads the records. Since HasRows property does not read the records it performs faster.</p>
<p><strong>IsClosed</strong> &#8211; It returns true if the DataReader is closed, otherwise returns false. If cmd.ExecuteReader (CommandBehaviour.CloseConnection) is used then connection gets closed when DataReader is closed. In such cases, the state of the connection can be checked by using IsClosed property.</p>
<p><strong>IsDBNull</strong> &#8211; This property is used to check if a DataRow is null. Returns true if it is null, otherwise returns false.</p>
<p>Ex: if(dr.IsDBNull[0]) checks whether the first row is null.</p>
<h2>Stored Procedures</h2>
<p>Different methods of writing programs in back-end are Blocks (T-SQL for SQL Server, PL/SQL for Oracle) &#8211; Blocks compile every time when called. They are not Stored Procedures &#8211; Procedures get compiled and stored as part of database objects. So they perform faster in execution. They need to be explicitly called using an execute statement or functions &#8211; They also get compiled and stored like procedures. They can be called with a select statement.</p>
<p><strong>Triggers</strong> – They are executed automatically(implicitly called).</p>
<h3>Why use Stored Procedures?</h3>
<p>Stored Procedures are used because of the following features they offer</p>
<ul>
<li>Modular programming</li>
<li>Distribution of work</li>
<li>Database security</li>
<li>Faster execution</li>
<li>Network traffic reduction</li>
<li>Flexibility</li>
</ul>
<p>A typical procedure looks like the following one.</p>
<pre class="brush: sql; title: ; notranslate">CREATE PROCEDURE dbo.AddJob
(
@jobdesc varchar(50),
@minlvl int,
@maxlvl int
)
AS
INSERT INTO JobDetails VALUES(@jobdesc, @minlvl, @maxlvl)
RETURN</pre>
<p>Every parameter in a procedure should be preceded by a special character @ to differentiate from the column names of the table. By default all the declared parameters are input parameters. If the procedure has to return values, then the output parameters must be explicitly specified by using OUTPUT keyword for SQL Server and OUT for Oracle.</p>
<h3>Calling procedures from Client-side</h3>
<p>This is the code for adding records into the jobs table. The three column values are entered into the text boxes (no need to add values to the first column because it is an identity column) and at the click of a button the whole record should be entered into the table. This is done by using the stored procedure shown earlier. To call that procedure, the button click code should be written as follows.</p>
<pre class="brush: vb; title: ; notranslate">cmd = new SqlCommand(&quot;AddJob&quot;, cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(&quot;@jobdesc&quot;, txtJobDesc.Text);
cmd.Parameters.AddWithValue(&quot;@minlvl&quot;, txtMinLvl.Text);
cmd.Parameters.AddWithValue(&quot;@maxlvl&quot;, txtMaxLvl.Text);
cmd.ExecuteNonQuery();
MessageBox.Show(&quot;Record Added&quot;);</pre>
<p>Here the textbox values are assigned to the parameters of the procedure by using Parameters.AddWithValue() method using command object. When the command is executed, it executes the procedure at the database server and records are added into the table.</p>
<p><em>Note</em>: If OleDb is used then the parameters should be in same order as the columns in the table, but for SQL Server this is not required.</p>
<p>The command types that are supported by ADO.NET are:</p>
<p><strong>Text</strong>: This is default. It can be any query including the table name.<br />
<strong>StoredProcedure</strong>: To call a procedure at the back-end.<br />
<strong>TableDirect</strong>: This is mainly for OleDb, where the table name has to be specified in place of command text.</p>
<p>Procedures can be written to return query results also(i.e. select statement results). To execute the procedures that return query results, ExecuteReader should be used from the command object instead of ExecuteNonQuery as shown below.</p>
<pre class="brush: vb; title: ; notranslate">cmd = new SqlCommand(&quot;jobsinfo&quot;, cn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr = cmd.ExecuteReader();</pre>
<p>But it is not preferred to write such procedures because all databases do not support them. But for returning values from the procedures, nearly all back-ends support directional parameters-IN, OUT, INOUT.</p>
<p><strong>IN Parameter</strong>: It is read-only in procedure i.e.the procedure can only read the value from it and but cannot return value to it. The direction of this parameter is from the calling program (client) to called program(server).</p>
<p><strong>OUT Parameter</strong>: It is write-only which means that the procedure can only return values to it, but cannot read any values from it. Direction is from server to client.</p>
<p><strong>INOUT Parameter</strong>: It can be used for both Read and Write. It is bi-directional i.e. from server to client as well as from client to server.</p>
<p>The post <a href="https://jharaphula.com/ado-net-architecture-examples-beginners/">ADO.NET ExecuteNonQuery, ExecuteReader, ExecuteScalar Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/ado-net-architecture-examples-beginners/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/08/ado.jpg" medium="image" />
	</item>
		<item>
		<title>ASP.NET Login page example with Remember me Option</title>
		<link>https://jharaphula.com/asp-net-login-page-remember-me/</link>
					<comments>https://jharaphula.com/asp-net-login-page-remember-me/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 18:00:58 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Login Page]]></category>
		<category><![CDATA[Cleaver UI developer]]></category>
		<category><![CDATA[Login page Example]]></category>
		<category><![CDATA[Remember me Option]]></category>
		<category><![CDATA[Windows Authentication]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1685</guid>

					<description><![CDATA[<img width="300" height="176" src="https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option-300x176.png" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET Login page example with Remember me Option" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option-300x176.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During we develop a product its always wise to save user time. Think about a login page. Here for Consecutive logins it is much better...</p>
<p>The post <a href="https://jharaphula.com/asp-net-login-page-remember-me/">ASP.NET Login page example with Remember me Option</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="176" src="https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option-300x176.png" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET Login page example with Remember me Option" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option-300x176.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During we develop a product its always wise to save user time. Think about a login page. Here for Consecutive logins it is much better if we will store user Login Credentials. Using which System will remember the user id and password for next login. In this demo app I am creating a ASP.NET login page with &#8220;Remember me&#8221; Option.</p>
<p>The logic behind is so simple &#8220;During a user login to the System I am storing his/her user id and password to a Cookie. Then under page load event checking is Cookie exists. If so taking user id and password from the Cookie&#8221;.</p>
<h3>Login.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Login.aspx.vb&quot; Inherits=&quot;Login&quot; %&gt;
&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;Demo Login App&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
#frmLogin { max-width: 300px; margin: 0 auto; padding-top: 120px; }
.formControl { font-family: Verdana; font-size: 12px; }
.loginDiv { width:300px; margin-top: 20px; padding: 20px 20px 20px 20px; background-color: #f7f7f7; -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); } 
.rounded { border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmLogin&quot; runat=&quot;server&quot;&gt;
&lt;div class=&quot;loginDiv rounded&quot;&gt;
&lt;div class=&quot;formControl&quot;&gt;
Email ID&amp;nbsp;&lt;span style=&quot;color: Red;&quot;&gt;*&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
&lt;asp:TextBox ID=&quot;txtEmailID&quot; runat=&quot;server&quot; Width=&quot;100%&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:RequiredFieldValidator ID=&quot;rfvEmailID&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtEmailID&quot;
Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email should not be blank.&lt;br /&gt;&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;
&lt;asp:RegularExpressionValidator ID=&quot;revEmailID&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtEmailID&quot;
Display=&quot;Dynamic&quot; ErrorMessage=&quot;Enter a valid Email ID.&lt;br /&gt;&quot; ValidationExpression=&quot;\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&quot;&gt;&lt;/asp:RegularExpressionValidator&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
Password&amp;nbsp;&lt;span style=&quot;color: Red;&quot;&gt;*&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
&lt;asp:TextBox ID=&quot;txtPassword&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot; Width=&quot;100%&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:RequiredFieldValidator ID=&quot;rfvPassword&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtPassword&quot;
Display=&quot;Dynamic&quot; ErrorMessage=&quot;Password should not be blank.&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;
&lt;/div&gt;
&lt;asp:Button ID=&quot;btnVisitorLogin&quot; runat=&quot;server&quot; Text=&quot;Login&quot; /&gt;
&lt;asp:Label ID=&quot;lblMsg&quot; runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;
&lt;asp:CheckBox ID=&quot;chkNextLogin&quot; runat=&quot;server&quot; /&gt;&amp;nbsp;Remember me&lt;a href=&quot;#&quot; class=&quot;pull-right margin-gap&quot;&gt;Need
help?&lt;/a&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>For security reason in Code behind I added my <a href="https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/" target="_blank" rel="noopener noreferrer">EncryDecry.vb Class</a> from app_code/vb. To execute vb code inside vb folder of app_code I Configured my web.config.</p>
<h3>Login.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.Web.Security
Imports System.Data
Imports System.Data.SqlClient

Partial Class Login
Inherits System.Web.UI.Page

Dim LoginSqlConn As New SqlConnection(ConfigurationManager.AppSettings.Get(&quot;DBKey&quot;).ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
txtEmailID.Focus()

'Check if the browser support cookies
If Request.Browser.Cookies Then
'Check if the cookies with name PBLOGIN exist on user's machine
If Request.Cookies(&quot;PBLOGIN&quot;) IsNot Nothing Then
'Pass the user name and password to the VerifyLogin method
Me.VerifyLogin(Request.Cookies(&quot;PBLOGIN&quot;)(&quot;UNAME&quot;).ToString(), Request.Cookies(&quot;PBLOGIN&quot;)(&quot;UPASS&quot;).ToString())
End If
End If
End If
End Sub

Protected Sub btnVisitorLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnVisitorLogin.Click
'Decrypt the Password &amp; UserID from Database
Dim EncrDecr As New EncryDecry

'Validation Checking Aginest Submission
If rfvPassword.IsValid And rfvEmailID.IsValid Then
'Clear Invalid login Message Label
lblMsg.Text = &quot;&quot;

'Temporary SecuredUniqueKey
Dim UniKey As String = &quot;FCPH6-BPK27-2V4MR&quot;

'Login Checking command in shape of a Stored Procedure that returns Record Count
Dim LoginCommand As New SqlCommand(&quot;USP_LoginCheck&quot;, LoginSqlConn)
LoginCommand.CommandType = CommandType.StoredProcedure

'Pass Parameter to Stored Procedure
LoginCommand.Parameters.Add(&quot;@UserID&quot;, SqlDbType.NVarChar, 256).Value = EncrDecr.TripleDESEncode(Trim(txtEmailID.Text), &quot;RC2&quot;)
LoginCommand.Parameters.Add(&quot;@Passcode&quot;, SqlDbType.NVarChar, 256).Value = EncrDecr.TripleDESEncode(Trim(txtPassword.Text), &quot;RC2&quot;)
LoginCommand.Parameters.Add(&quot;@SecuredUniqueKey&quot;, SqlDbType.NVarChar, 256).Value = UniKey
LoginCommand.Parameters.Add(&quot;@Status&quot;, SqlDbType.NVarChar, 20).Value = &quot;Active&quot;

Dim RecordCNT As Integer = 0

Try
Dim LoginDataReader As SqlDataReader
LoginSqlConn.Open()
LoginDataReader = LoginCommand.ExecuteReader
If LoginDataReader.Read Then
RecordCNT = Convert.ToInt32(LoginDataReader(0).ToString())
End If
Catch ex As Exception
Response.Write(ex.ToString())
Finally
LoginSqlConn.Close()
End Try

'Login Checking using the return int value of USP_LoginCheck stored procedure
If (RecordCNT = 1) Then
Me.VerifyLogin(EncrDecr.TripleDESEncode(Trim(txtEmailID.Text), &quot;RC2&quot;), EncrDecr.TripleDESEncode(Trim(txtPassword.Text), &quot;RC2&quot;))
ElseIf (RecordCNT &gt; 1) Then
lblMsg.Text = &quot;Invalid Login Credentials&quot;
'Implement 5 Login Attempts of Account Lock
ElseIf (RecordCNT &lt; 1) Then
lblMsg.Text = &quot;Invalid Login Credentials&quot;
'Implement 5 Login Attempts of Account Lock
End If
End If
End Sub

Private Sub VerifyLogin(ByVal UserID As String, ByVal Password As String)
Dim LoginDetailsCommand As New SqlCommand(&quot;USP_LoginDetails&quot;, LoginSqlConn)
LoginDetailsCommand.CommandType = CommandType.StoredProcedure

'Pass Parameter to Stored Procedure
LoginDetailsCommand.Parameters.Add(&quot;@UserID&quot;, SqlDbType.NVarChar, 256).Value = UserID
LoginDetailsCommand.Parameters.Add(&quot;@Passcode&quot;, SqlDbType.NVarChar, 256).Value = Password

Try
Dim LoginDetailsDR As SqlDataReader
LoginSqlConn.Open()
LoginDetailsDR = LoginDetailsCommand.ExecuteReader

If LoginDetailsDR.Read Then
Session(&quot;UserID&quot;) = LoginDetailsDR(&quot;PkUid&quot;)
Session(&quot;UserEmail&quot;) = UserID

Session(&quot;FirstName&quot;) = LoginDetailsDR(&quot;FirstName&quot;)
Session(&quot;LastName&quot;) = LoginDetailsDR(&quot;LastName&quot;)

Session(&quot;RootPath&quot;) = Server.MapPath(&quot;../&quot;)

'Using form authentication redirect the page to the Default.aspx
FormsAuthentication.RedirectFromLoginPage(Trim(txtEmailID.Text), True)

'check if remember me checkbox is checked on login
If (chkNextLogin.Checked) Then
'Check if the browser support cookies
If (Request.Browser.Cookies) Then
'Check if the cookie with name PBLOGIN exist on user's machine
If (Request.Cookies(&quot;PBLOGIN&quot;) Is Nothing) Then
'Create a cookie with expiry of 30 days
Response.Cookies(&quot;PBLOGIN&quot;).Expires = DateTime.Now.AddDays(30)
'Write username to the cookie
Response.Cookies(&quot;PBLOGIN&quot;).Item(&quot;UNAME&quot;) = UserID
'Write password to the cookie
Response.Cookies(&quot;PBLOGIN&quot;).Item(&quot;UPASS&quot;) = Password
Else
'If the cookie already exist then wirte the user name and password on the cookie
Response.Cookies(&quot;PBLOGIN&quot;).Item(&quot;UNAME&quot;) = UserID
Response.Cookies(&quot;PBLOGIN&quot;).Item(&quot;UPASS&quot;) = Password
End If
End If
End If
Else
lblMsg.Text = &quot;Invalid Login Credentials&quot;
End If
Catch ex As Exception
Response.Write(ex.ToString())
Finally
LoginSqlConn.Close()
End Try
End Sub
End Class</pre>
<h3>web.config</h3>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;
&lt;appSettings&gt;
&lt;add key=&quot;DBKey&quot; value=&quot;Data Source=VIJAYSHANTI; uid=sa; pwd=tiger; database=CodeRND;&quot;/&gt;
&lt;/appSettings&gt;
&lt;connectionStrings/&gt;
&lt;system.web&gt;
&lt;compilation debug=&quot;true&quot; strict=&quot;false&quot; explicit=&quot;true&quot;&gt;
&lt;codeSubDirectories&gt;
&lt;add directoryName=&quot;VB&quot;/&gt;
&lt;/codeSubDirectories&gt;
&lt;/compilation&gt;
&lt;authentication mode=&quot;Windows&quot;/&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</pre>
<p>EncryDecry is the class which helps to convert user id and password to RC2 format. In-case an other user find out the cookie in client machine he or she can&#8217;t able to hack the original user.</p>
<h3>EncryDecry.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.Security.Cryptography
Imports Microsoft.VisualBasic

Public Class EncryDecry

Public Function TripleDESEncode(ByVal value As String, ByVal key As String) As String
Dim des As New System.Security.Cryptography.TripleDESCryptoServiceProvider
des.IV = New Byte(7) {}
Dim pdb As New System.Security.Cryptography.PasswordDeriveBytes(key, New Byte(-1) {})
des.Key = pdb.CryptDeriveKey(&quot;RC2&quot;, &quot;MD5&quot;, 128, New Byte(7) {})
Dim ms As New IO.MemoryStream((value.Length * 2) - 1)
Dim encStream As New System.Security.Cryptography.CryptoStream(ms, des.CreateEncryptor(), System.Security.Cryptography.CryptoStreamMode.Write)
Dim plainBytes As Byte() = Text.Encoding.UTF8.GetBytes(value)
encStream.Write(plainBytes, 0, plainBytes.Length)
encStream.FlushFinalBlock()
Dim encryptedBytes(CInt(ms.Length - 1)) As Byte
ms.Position = 0
ms.Read(encryptedBytes, 0, CInt(ms.Length))
encStream.Close()
Return Convert.ToBase64String(encryptedBytes)
End Function

Public Function TripleDESDecode(ByVal value As String, ByVal key As String) As String
Dim des As New System.Security.Cryptography.TripleDESCryptoServiceProvider
des.IV = New Byte(7) {}
Dim pdb As New System.Security.Cryptography.PasswordDeriveBytes(key, New Byte(-1) {})
des.Key = pdb.CryptDeriveKey(&quot;RC2&quot;, &quot;MD5&quot;, 128, New Byte(7) {})
Dim encryptedBytes As Byte() = Convert.FromBase64String(value)
Dim ms As New IO.MemoryStream(value.Length)
Dim decStream As New System.Security.Cryptography.CryptoStream(ms, des.CreateDecryptor(), System.Security.Cryptography.CryptoStreamMode.Write)
decStream.Write(encryptedBytes, 0, encryptedBytes.Length)
decStream.FlushFinalBlock()
Dim plainBytes(CInt(ms.Length - 1)) As Byte
ms.Position = 0
ms.Read(plainBytes, 0, CInt(ms.Length))
decStream.Close()
Return Text.Encoding.UTF8.GetString(plainBytes)
End Function

End Class</pre>
<p>The post <a href="https://jharaphula.com/asp-net-login-page-remember-me/">ASP.NET Login page example with Remember me Option</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/asp-net-login-page-remember-me/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/login-page-with-remember-me-option.png" medium="image" />
	</item>
		<item>
		<title>ASP.NET Login form Example validating user from SQL Server Database</title>
		<link>https://jharaphula.com/asp-net-login-form-example-database/</link>
					<comments>https://jharaphula.com/asp-net-login-form-example-database/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 17:54:40 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Login form]]></category>
		<category><![CDATA[ASP.NET Login Page]]></category>
		<category><![CDATA[Database Basics]]></category>
		<category><![CDATA[SQL Server Database]]></category>
		<category><![CDATA[validating user from]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1675</guid>

					<description><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET Login form Example validating user from SQL Server Database" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Designing a Login form is not so easy as we are thinking. Modern login pages comes with various rich feature such as Validating User, Form...</p>
<p>The post <a href="https://jharaphula.com/asp-net-login-form-example-database/">ASP.NET Login form Example validating user from SQL Server Database</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET Login form Example validating user from SQL Server Database" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Designing a Login form is not so easy as we are thinking. Modern login pages comes with various rich feature such as Validating User, Form Validation, Capcha or Remember Password. In this Login form Example demo app we are going to show you how to authenticate an user using records from SQL Server user table. To start with first you required to Create a user table in <a href="https://jharaphula.com/database-basics-terminologies-definition/" target="_blank" rel="noopener noreferrer">SQL Server</a>.</p>
<h2>Create a SQL Table for Users</h2>
<p>To Create an user table which will store Login details such as UserID or Password your required to run the following Transact-SQL Query.</p>
<pre class="brush: sql; title: ; notranslate">CREATE TABLE user_table (
id INT PRIMARY KEY, 
userid VARCHAR(255) NOT NULL, 
password VARCHAR(56)
);</pre>
<p>Then insert some sample records.</p>
<p>In front-end Copy n Paste my default.aspx page Codes. Here I have 2 textbox Controls such as user id and password. To stop spam here I am using required field validation for both the fields. Additionally to valid an email id I am using ASP.NET RegularExpressionValidator validation control. Then in my form I have a submit button. Which submits the form to server using post method.</p>
<h2>ASP.NET Login form Example</h2>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Default.aspx.vb&quot; Inherits=&quot;_Default&quot; %&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;ASP.NET Login form Example&lt;/title&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;master.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmLogin&quot; runat=&quot;server&quot;&gt;
&lt;div class=&quot;loginDiv rounded&quot;&gt;
&lt;div class=&quot;formControl&quot;&gt;
Email ID&amp;nbsp;&lt;span style=&quot;color: Red;&quot;&gt;*&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
&lt;asp:TextBox ID=&quot;txtEmailID&quot; runat=&quot;server&quot; Width=&quot;100%&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:RequiredFieldValidator ID=&quot;rfvEmailID&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtEmailID&quot;
Display=&quot;Dynamic&quot; ErrorMessage=&quot;Email should not be blank.&lt;br /&gt;&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;
&lt;asp:RegularExpressionValidator ID=&quot;revEmailID&quot; runat=&quot;server&quot;
ControlToValidate=&quot;txtEmailID&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Enter a valid Email ID.&lt;br /&gt;&quot;
ValidationExpression=&quot;\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&quot;&gt;&lt;/asp:RegularExpressionValidator&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
Password&amp;nbsp;&lt;span style=&quot;color: Red;&quot;&gt;*&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;formControl&quot;&gt;
&lt;asp:TextBox ID=&quot;txtPassword&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot; Width=&quot;100%&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:RequiredFieldValidator ID=&quot;rfvPassword&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtPassword&quot;
Display=&quot;Dynamic&quot; ErrorMessage=&quot;Password should not be blank.&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;
&lt;/div&gt;
&lt;asp:Button ID=&quot;btnVisitorLogin&quot; runat=&quot;server&quot; Text=&quot;Login&quot; /&gt;
&lt;asp:Label ID=&quot;lblMessage&quot; runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;
&lt;input type=&quot;checkbox&quot; value=&quot;remember-me&quot; /&gt;&amp;nbsp;Remember me&lt;a href=&quot;#&quot; class=&quot;pull-right margin-gap&quot;&gt;Need help?&lt;/a&gt;
&lt;/div&gt;
&lt;/form&gt; 
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>To valid user from SQL Server in Code behind file I am executing my business logics inside &#8220;btnVisitorLogin_Click&#8221; event. To connect and execute SQL query which will fetch data I imported the system files &#8220;System.Data&#8221; and &#8220;System.Data.SqlClient&#8221; in page header.</p>
<p>To establish a Connection I am creating a new instance for SQL Server Connection object. Which accepts connection string from my web.config file. Look at the below code to know how to declare connection string in web.config file.</p>
<pre class="brush: xml; title: ; notranslate">&lt;connectionStrings&gt;
&lt;add name=&quot;connStr&quot; connectionString=&quot;Data Source=WINSERV;Initial Catalog=phase2;User ID=sa;Password=win#serv&quot; providerName=&quot;System.Data.SqlClient&quot;/&gt;
&lt;/connectionStrings&gt;</pre>
<p>Here Data Source is my Database Server name. Initial Catalog is the Database name and User id, password is for the database user.</p>
<p>To compare user Credentials with database records here I am executing a command object and fetching user table records to a SQL DataReader. As you know datareader works like a pointer. Using a DataReader compare to a DataSet we can minimize the login time. To validate a user I am running a while loop until the end record of SQL DataReader &#8220;dr_pass&#8221;. For each record inside the while loop I am comparing the value with user password. In case it returns true I am allowing the user to redirect into the application dashboard page.</p>
<h3>Default.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.Data
Imports System.Data.SqlClient

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub btnVisitorLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnVisitorLogin.Click

Dim oMyConnection As New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;connStr&quot;).ToString)
Dim oMyCommand As New SqlCommand(&quot;SELECT password, userid FROM user_table WHERE userid= '&quot; &amp; txtEmailID.Text &amp; &quot;' &quot;, oMyConnection)
Dim dr_pass As SqlDataReader

oMyConnection.Open()
dr_pass = oMyCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

If Not dr_pass.HasRows Then
lblMessage.Text = &quot;Invalid Email or Password.&quot;
End If

While dr_pass.Read
If Trim(txtPassword.Text) = dr_pass(&quot;password&quot;) Then
Session.Add(&quot;sess_uid&quot;, dr_pass(&quot;userid&quot;))
Response.Redirect(&quot;../Dashboard.aspx&quot;)
End If
End While
End Sub
End Class</pre>
<h2>Login Form CSS Style (master.css)</h2>
<pre class="brush: css; title: ; notranslate">#frmLogin { max-width: 300px; margin: 0 auto; padding-top: 120px; }
.formControl { font-family: Verdana; font-size: 12px; }
.loginDiv { width:300px; margin-top: 20px; padding: 20px 20px 20px 20px; background-color: #f7f7f7; -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); } 
.rounded { border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; }</pre>
<p>The above demo will run without CSS. But beauty attracts eyes. This is the cause I am with the above CSS classes. Apply this CSS to have a basic look. You modify it as per the mock-up.</p>
<p>The post <a href="https://jharaphula.com/asp-net-login-form-example-database/">ASP.NET Login form Example validating user from SQL Server Database</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/asp-net-login-form-example-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/login-using-sql-server.jpg" medium="image" />
	</item>
		<item>
		<title>How to use JavaScript function with ASP.NET CustomValidator?</title>
		<link>https://jharaphula.com/javascript-function-asp-net-customvalidator/</link>
					<comments>https://jharaphula.com/javascript-function-asp-net-customvalidator/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 16:35:15 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET CustomValidator]]></category>
		<category><![CDATA[Compare Field Validator]]></category>
		<category><![CDATA[Form Validation]]></category>
		<category><![CDATA[JavaScript Function]]></category>
		<category><![CDATA[Jquery Email Validation]]></category>
		<category><![CDATA[Required Field Validation]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1616</guid>

					<description><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation-300x184.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to use JavaScript function with ASP.NET CustomValidator?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation-300x184.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>By default under Validations ASP.NET provides 5 Controls. They are Required field validator, Range Validator, Regular Expression Validator, Compare Field Validator &#38; ASP.NET CustomValidator. Using...</p>
<p>The post <a href="https://jharaphula.com/javascript-function-asp-net-customvalidator/">How to use JavaScript function with ASP.NET CustomValidator?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation-300x184.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to use JavaScript function with ASP.NET CustomValidator?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation-300x184.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>By default under Validations ASP.NET provides 5 Controls. They are <strong>Required field validator</strong>, <strong>Range Validator</strong>, <strong>Regular Expression Validator</strong>, <strong>Compare Field Validator</strong> &amp; <strong>ASP.NET CustomValidator</strong>. Using Required field validator we do check whether the field is mandatory to user or not. Range Validator valid a specific range of values. For an example if I am going to valid an IP address in this case I can set the range to 255. Regular Expression validator validates user data using per-defined regular Expressions. Compare field do comparison.</p>
<p>Now tell if some other kind of validation you want in your app then how to do this. In real-time it is ugly to break sequence. I mean if you are using ASP.NET Validation then for all fields it need to same.</p>
<h2>ASP.NET CustomValidator Example</h2>
<p>Let&#8217;s take an example below. Here I am validation password length. What I need is user must need to enter 6 character length password. I did this using asp:CustomValidator &amp; pure JavaScript. I mean CustomVaidator working with Client Script. To do this demo here inside HTML body I have added a ASP.NET Custom Validation control. Using ErrorMessage I am display the message which user will receive if he/she trying enter invalid data. As it is an error message using ForeColor=&#8221;Red&#8221; I am applying style to my Control. In my CustomValidator using ClientValidationFunction I am suplying my javascript function name without parenthesis.</p>
<p>Inside the <a href="https://jharaphula.com/jquery-string-functions/" target="_blank" rel="noopener noreferrer">JavaScript function</a> passwordLength I am getting 2 values. These are function parameters sender and arguments. In argument under run-time I am fetching the txtPassword value and checking its length. Now you must have a query how my password field control is connected to the Custom Validator Control. Look Closely you will watch ControlToValidate=&#8221;txtPassword&#8221; in Vaidator Control. With this I am giving instruction to Custom Validator Control that Validate the input box which id is txtPassword.</p>
<h2>ASP.NET CustomValidator using JavaScript Function</h2>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; %&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;
&lt;title&gt;JavaScript function with ASP.NET CustomValidator&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/* passwordLength JS Function which I am referring in asp:CustomValidator */
function passwordLength(sender, args) {
debugger;
if (args.Value.length &lt; 6)
/* If password length is less than 6 charecters returning False */
return args.IsValid = false;
else
return args.IsValid = true;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmDemoApp&quot; runat=&quot;server&quot;&gt;
&lt;div&gt;
Password: &lt;asp:TextBox runat=&quot;server&quot; ID=&quot;txtPassword&quot;&gt;&lt;/asp:TextBox&gt;
&lt;asp:CustomValidator ID=&quot;CustomValidator1&quot; ClientValidationFunction=&quot;passwordLength&quot; ForeColor=&quot;Red&quot; ErrorMessage=&quot;Enter a Password with minimum length of 6 characters.&quot;
ControlToValidate=&quot;txtPassword&quot; runat=&quot;server&quot;&gt;
&lt;/asp:CustomValidator&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/javascript-function-asp-net-customvalidator/">How to use JavaScript function with ASP.NET CustomValidator?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/javascript-function-asp-net-customvalidator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/asp-net-custom-validation.png" medium="image" />
	</item>
		<item>
		<title>How to display various Files icon images in Datagrid rows?</title>
		<link>https://jharaphula.com/icon-images-in-gridview-gatagrid-rows/</link>
					<comments>https://jharaphula.com/icon-images-in-gridview-gatagrid-rows/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 15:02:32 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Datagrid rows]]></category>
		<category><![CDATA[Fun in Programming]]></category>
		<category><![CDATA[icon images]]></category>
		<category><![CDATA[Icon images in Gridview]]></category>
		<category><![CDATA[Images in Gridview or Datagrid rows]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1565</guid>

					<description><![CDATA[<img width="300" height="151" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding-300x151.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display icon images in Gridview or Datagrid rows?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding-300x151.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Do you ever worked for any file management system? Where you have word files, excel file or it can be an image file like jpeg...</p>
<p>The post <a href="https://jharaphula.com/icon-images-in-gridview-gatagrid-rows/">How to display various Files icon images in Datagrid rows?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="151" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding-300x151.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display icon images in Gridview or Datagrid rows?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding-300x151.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Do you ever worked for any file management system? Where you have word files, excel file or it can be an image file like jpeg or png? In .NET Gridview is a popular Control to present tabular data. In this demo app I implemented various icons in each row of the Gridview dynamically by checking the file type.</p>
<p>Logic is so simple, Using FindControl in side the Gridview RowDataBound event I am locating the imgPreview tag from aspx. Then storing its value to a variable. I have icon images are in IMAGES/type_icons folder. By checking file extension I updating the image URL.</p>
<h2>Display icon images in Datagrid</h2>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView AllowSorting=&quot;true&quot; DataKeyNames=&quot;CodeID&quot; ID=&quot;grdFileList&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot; CellPadding=&quot;0&quot; CellSpacing=&quot;0&quot; ForeColor=&quot;#333333&quot; GridLines=&quot;None&quot; Width=&quot;100%&quot; AllowPaging=&quot;true&quot; PageSize=&quot;20&quot;&gt;

&lt;FooterStyle BackColor=&quot;#1C5E55&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; /&gt;

&lt;Columns&gt;

&lt;asp:TemplateField&gt;

&lt;HeaderTemplate&gt;
&lt;input type=&quot;checkbox&quot; onmouseover=if(t1)t1.Show(event,l1) onmouseout=if(t1)t1.Hide(event) style=&quot;width:20px;&quot; name=&quot;chkAll&quot; id=&quot;chkAll&quot; onclick=&quot;javascript:checkAll(this);&quot; /&gt;
&lt;/HeaderTemplate&gt;
&lt;ItemTemplate&gt;
&lt;input type=&quot;checkbox&quot; style=&quot;width:20px;&quot; value='&lt;%# Container.DataItem(&quot;CodeID&quot;) %&gt;' id=&quot;chkSelect&quot; name=&quot;chkSelect&quot; /&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle Width=&quot;35px&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;File Name&quot; SortExpression=&quot;CodeFileName&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot; href='AddCode.aspx?SourceCode=1&amp;CodeID=&lt;%#Container.DataItem(&quot;CodeID&quot;)%&gt;&amp;AttachFile=1' class=&quot;GridLink&quot;&gt;&lt;%# Container.DataItem(&quot;CodeFileName&quot;) %&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;Description&quot; SortExpression=&quot;CodeDescription&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:default;&quot;&gt;&lt;%# Container.DataItem(&quot;CodeDescription&quot;) %&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;SearchKey&quot; SortExpression=&quot;SearchKey&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot;&gt;&lt;%#Container.DataItem(&quot;SearchKey&quot;)%&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;File Name&quot; SortExpression=&quot;AttachFileName&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot;&gt;&lt;%#Container.DataItem(&quot;AttachFileName&quot;)%&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;File Size&quot; SortExpression=&quot;AttachFileSize&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot;&gt;&lt;%#Container.DataItem(&quot;AttachFileSize&quot;)%&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;File Type&quot; SortExpression=&quot;AttachFileType&quot; Visible=&quot;False&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID=&quot;lblAttachmentType&quot; Text='&lt;%#Container.DataItem(&quot;AttachFileName&quot;)%&gt;' runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;File Type&quot; SortExpression=&quot;AttachFileType&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:Image ID=&quot;imgPreview&quot; runat=&quot;server&quot; /&gt;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;Is Shared&quot; SortExpression=&quot;IsShareable&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot;&gt;&lt;%#Container.DataItem(&quot;IsShareable&quot;)%&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField HeaderText=&quot;Status&quot; SortExpression=&quot;IsShareable&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a style=&quot;cursor:hand;&quot;&gt;&lt;%# Container.DataItem(&quot;Status&quot;) %&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;/ItemTemplate&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot; /&gt;
&lt;/asp:TemplateField&gt;
&lt;/Columns&gt;
&lt;RowStyle BackColor=&quot;#E3EAEB&quot; /&gt;
&lt;EditRowStyle BackColor=&quot;#7C6F57&quot; /&gt;
&lt;SelectedRowStyle BackColor=&quot;#C5BBAF&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;#333333&quot; /&gt;
&lt;PagerStyle BackColor=&quot;#D7F6FA&quot; ForeColor=&quot;Black&quot; HorizontalAlign=&quot;Center&quot; /&gt;
&lt;HeaderStyle Height=&quot;22px&quot; BackColor=&quot;#005B90&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; HorizontalAlign=&quot;Left&quot; /&gt;
&lt;AlternatingRowStyle BackColor=&quot;White&quot; /&gt;
&lt;/asp:GridView&gt;

&lt;asp:SqlDataSource ID=&quot;SqlDataSource1&quot; runat=&quot;server&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:connectionString %&gt;&quot;&gt;
&lt;/asp:SqlDataSource&gt;</pre>
<h2>Datagrid rows with various icon images using Code-behind</h2>
<pre class="brush: vb; title: ; notranslate">Protected Sub grdFileList_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdFileList.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lblAttachmentTypeID As Label = CType(e.Row.FindControl(&quot;lblAttachmentType&quot;), Label)

Dim objImg As Image = CType(e.Row.FindControl(&quot;imgPreview&quot;), Image)

Dim AT As String = lblAttachmentTypeID.Text

Dim splitDot As Array = AT.Split(&quot;.&quot;)

Dim Ext As String = splitDot(1)
Ext = Trim(Ext)

'Response.Write(ds.Tables(0).Rows(0).Item(20))

If (Ext = &quot;doc&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/doc.gif&quot;
ElseIf (Ext = &quot;docx&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/doc.gif&quot;
ElseIf (Ext = &quot;xls&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/xls.gif&quot;
ElseIf (Ext = &quot;zip&quot;) Then 'ALLOW USER TO UPLOAD ZIP FILES
objImg.ImageUrl = &quot;../IMAGES/type_icons/zip.gif&quot;
ElseIf (Ext = &quot;sql&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/sql.gif&quot;
ElseIf (Ext = &quot;ppt&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/ppt.gif&quot;
'ElseIf (Ext = &quot;odt&quot;) Then
'objImg.ImageUrl = &quot;../IMAGES/type_icons/create.gif&quot;
ElseIf (Ext = &quot;txt&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/txt.gif&quot;
ElseIf (Ext = &quot;gif&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/gif.gif&quot;
ElseIf (Ext = &quot;bmp&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/bmp.gif&quot;
ElseIf (Ext = &quot;exe&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/exe.gif&quot;
ElseIf (Ext = &quot;dll&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/ddl.gif&quot;
ElseIf (Ext = &quot;cs&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/cs.gif&quot;
ElseIf (Ext = &quot;fla&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/fla.gif&quot;
ElseIf (Ext = &quot;htm&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/htm.gif&quot;
ElseIf (Ext = &quot;html&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/htm.gif&quot;
ElseIf (Ext = &quot;jpeg&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/jpg.gif&quot;
ElseIf (Ext = &quot;jpg&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/jpg.gif&quot;
ElseIf (Ext = &quot;image/pjpe&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/jpg.gif&quot;
ElseIf (Ext = &quot;png&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/png.gif&quot;
ElseIf (Ext = &quot;js&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/js.gif&quot;
ElseIf (Ext = &quot;pdf&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/pdf.gif&quot;
ElseIf (Ext = &quot;mdb&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/mdb.gif&quot;
ElseIf (Ext = &quot;swf&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/swf.gif&quot;
ElseIf (Ext = &quot;vsd&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/vsd.gif&quot;
ElseIf (Ext = &quot;xml&quot;) Then
objImg.ImageUrl = &quot;../IMAGES/type_icons/xml.gif&quot;
Else
'THIS IS THE GENERAL FILE ICON WHICH NEED TO SHOW ON OVER THE ICON EXTENTION NOT FOUND FROM DB
objImg.ImageUrl = &quot;../IMAGES/type_icons/txt.gif&quot;
End If
End If
'imgSrc.ImageUrl = &quot;IMAGES/AloneLogo.png&quot;
End Sub</pre>
<p>The post <a href="https://jharaphula.com/icon-images-in-gridview-gatagrid-rows/">How to display various Files icon images in Datagrid rows?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/icon-images-in-gridview-gatagrid-rows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/gridview-demo-data-binding.jpg" medium="image" />
	</item>
		<item>
		<title>Random Password Generator Function using VB.NET</title>
		<link>https://jharaphula.com/random-password-generator-function/</link>
					<comments>https://jharaphula.com/random-password-generator-function/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 15:00:28 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[128 Cryptography functions]]></category>
		<category><![CDATA[Network Security Features]]></category>
		<category><![CDATA[Random Password Generator]]></category>
		<category><![CDATA[VB.NET Function]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1563</guid>

					<description><![CDATA[<img width="300" height="171" src="https://jharaphula.com/wp-content/uploads/2016/05/random-string-300x171.png" class="webfeedsFeaturedVisual wp-post-image" alt="Random password generator function using VB.NET" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/random-string-300x171.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/random-string.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Creating a secure password is a critical aspect of modern digital security. Weak passwords are vulnerable to brute-force attacks, dictionary attacks, and other malicious techniques....</p>
<p>The post <a href="https://jharaphula.com/random-password-generator-function/">Random Password Generator Function using VB.NET</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="171" src="https://jharaphula.com/wp-content/uploads/2016/05/random-string-300x171.png" class="webfeedsFeaturedVisual wp-post-image" alt="Random password generator function using VB.NET" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/random-string-300x171.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/random-string.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Creating a secure password is a critical aspect of modern digital security. Weak passwords are vulnerable to brute-force attacks, dictionary attacks, and other malicious techniques. To mitigate these risks, developers often implement random password generators that produce strong, unpredictable passwords. In this article, we will explore how to create a robust random password generator function using VB.NET, ensuring that the generated passwords meet common security requirements.</p>
<p>During an application development many time we required a <a href="https://jharaphula.com/javascript-function-random-string/" target="_blank" rel="noopener noreferrer">random string</a>. Whether it is to make the URL unique or to send a SMS for mobile verification or to generate dynamic Cookie random strings are very useful. In the below Random password generator function I am doing so using VB.NET String Builder methods from System.IO Namespace.</p>
<p>Logic I implemented here is so simple. Inside a for loop I am using Convert.ToChar() method against random.NextDouble() Function. Random function is taking care to generate random number. While using Convert.ToChar() I am converting the random number to String and appending that to a StringBuilder variable.</p>
<h3>VB.NET Random password generator</h3>
<pre class="brush: vb; title: ; notranslate">Private Function RandomString(ByVal size As Integer, ByVal lowerCase As Boolean) As String
Dim builder As New StringBuilder()
Dim random As New Random()
Dim ch As Char
Dim i As Integer
For i = 0 To size - 1
ch = Convert.ToChar(Convert.ToInt32((26 * random.NextDouble() + 65)))
builder.Append(ch)
Next i
If lowerCase Then
Return builder.ToString().ToLower()
End If
Return builder.ToString()
End Function</pre>
<h2>The Role of Randomness in Password Generation</h2>
<p>True randomness is crucial for password security. Pseudo-random number generators (PRNGs) in programming languages, such as the `Random` class in VB.NET, are sufficient for most applications. However, for cryptographic purposes, the `RNGCryptoServiceProvider` class (or its successor, `RandomNumberGenerator`) is preferred due to its higher entropy.</p>
<h2>Best Practices for Password Generation</h2>
<p>Weak or compromised passwords can lead to data breaches, identity theft, and financial losses. To mitigate these risks, it is essential to follow best practices for password generation. This article outlines key strategies, including avoiding predictable patterns, using sufficient length, incorporating all character types, avoiding password reuse, and storing passwords securely.</p>
<p><strong>Avoid Predictable Patterns</strong></p>
<p>One of the most common mistakes in password creation is using easily guessable patterns. Hackers often exploit predictable sequences, such as &#8220;123456,&#8221; &#8220;password,&#8221; or &#8220;qwerty.&#8221; These passwords are frequently targeted in brute-force attacks, where automated tools systematically try common combinations.</p>
<p>To enhance security, avoid using: </p>
<p>Sequential numbers or letters (e.g., &#8220;abcdef,&#8221; &#8220;987654&#8221;).<br />
Personal information (e.g., birthdays, pet names, or family members&#8217; names).<br />
Dictionary words, as these are vulnerable to dictionary attacks.</p>
<p>Instead, opt for random combinations that do not follow a recognizable structure. A passphrase—a sequence of unrelated words—can be a strong alternative if it is sufficiently long and unpredictable.</p>
<p><strong>Use Sufficient Length</strong></p>
<p>Password length is a critical factor in security. The longer a password, the more difficult it is to crack. Experts recommend a minimum of 12 characters, though longer passwords (16 characters or more) provide even greater protection.</p>
<p>Each additional character exponentially increases the number of possible combinations, making brute-force attacks impractical. For example, an 8-character password with lowercase letters has approximately 200 billion possible combinations, while a 12-character password with mixed characters has trillions.</p>
<p><strong>Incorporate All Character Types</strong></p>
<p>A strong password should include a mix of: </p>
<p>Uppercase letters (A-Z).<br />
Lowercase letters (a-z).<br />
Numbers (0-9).<br />
Special characters (e.g., !, @, , $, %).</p>
<p>This diversity makes the password more resistant to cracking attempts. For instance, &#8220;T7mP9$kL2!&#8221; is significantly stronger than &#8220;templk12.&#8221; Avoid substituting letters with similar-looking numbers (e.g., &#8220;P@ssw0rd&#8221;) as these are still predictable.</p>
<p><strong>Avoid Reusing Passwords</strong></p>
<p>Using the same password across multiple accounts is a significant security risk. If one account is compromised, attackers can gain access to all other accounts sharing that password. This practice, known as credential stuffing, is a common attack vector.</p>
<p>To prevent this, create unique passwords for each account. Managing dozens of distinct passwords can be challenging, but password managers (discussed later) can simplify this process.</p>
<p><strong>Store Passwords Securely</strong></p>
<p>Even the strongest passwords can be compromised if stored improperly. Avoid writing passwords on paper or saving them in unsecured digital files (e.g., plain text documents or spreadsheets). Instead, use a reputable password manager.</p>
<p>Password managers encrypt and store credentials in a secure vault, accessible via a master password. They also generate strong, random passwords and auto-fill them when needed. Popular options include LastPass, Bitwarden, and 1Password.</p>
<p>For additional security, enable two-factor authentication (2FA) wherever possible. This adds an extra verification step, such as a fingerprint scan or a one-time code sent to your phone, further protecting your accounts.</p>
<h2>Conclusion</h2>
<p>A well-implemented random password generator in VB.NET can significantly enhance security by creating strong, unpredictable passwords. By leveraging cryptographically secure random number generation and enforcing character diversity, developers can ensure that generated passwords resist common attack vectors. The provided function serves as a foundation that can be further customized to meet specific security requirements. Always test password generation logic thoroughly to confirm its effectiveness in real-world applications.</p>
<p>The post <a href="https://jharaphula.com/random-password-generator-function/">Random Password Generator Function using VB.NET</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/random-password-generator-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/random-string.png" medium="image" />
	</item>
		<item>
		<title>How to Generate Dynamic HTML Document using VB.NET Codes?</title>
		<link>https://jharaphula.com/create-dynamic-html-document-vb-net/</link>
					<comments>https://jharaphula.com/create-dynamic-html-document-vb-net/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:58:34 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Create Dynamic HTML]]></category>
		<category><![CDATA[Fun in Programming]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[VB.NET File Operations]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1561</guid>

					<description><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/05/html-page-300x182.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Create Dynamic HTML document from VB.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html-page-300x182.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html-page.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Generally while designing a CMS we found this situation (Generate Dynamic HTML) to handle. Let us assume we have records in Database. From those records...</p>
<p>The post <a href="https://jharaphula.com/create-dynamic-html-document-vb-net/">How to Generate Dynamic HTML Document using VB.NET Codes?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/05/html-page-300x182.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Create Dynamic HTML document from VB.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html-page-300x182.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html-page.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Generally while designing a CMS we found this situation (Generate Dynamic HTML) to handle. Let us assume we have records in Database. From those records we required to Create <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML</a> pages dynamically. Here I did the same using VB.NET File Operations.</p>
<p>Look at the below Codes from my Code behind file. Here I have 2 functions &amp; page load event. During page load I am calling the function CreatePage(). CreatePage function accepts 3 parameters page title, HTML text here I mean contents for HTML page &amp; The file name I want to create physically.</p>
<h2>VB.NET CreatePage function to Generate Dynamic HTML</h2>
<p>Inside CreatePage function I am concatenating a string with <a href="https://www.w3schools.com/html/html_intro.asp" target="_blank" rel="noopener noreferrer nofollow">HTML</a> format. In head tag I am adding the page title. Then entering a new-line character. Similarly did for title &amp; body content. Not doing the File Operations here. For file operation I have one more separate function SaveTextToFile(). SaveTextToFile accepts 2 parameters. First parameter is the HTML string we concatenating in CreatePage function. Second one is the file path. File path means where to Create the HTML page.</p>
<p>To Create file physically here I referred System.IO &amp; StreamWriter method. After Create Instance I am using Write method. Including this I have a boolean variable. Which helps to know whether the file created successfully or not. This variable default value is false. Just after StreamWriter Write method I am updating this variable.</p>
<h2>Generate Dynamic HTML using VB.NET Codes</h2>
<pre class="brush: vb; title: ; notranslate">Imports System.IO

Partial Class _CreateHtml
Inherits System.Web.UI.Page

Public Sub CreatePage(ByVal HTMLTitle As String, ByVal HTMLText As String, ByVal HTMLFileName As String)
Dim strFile As String
strFile = &quot;&quot;
'Constructing the String strFile
strFile = &quot;&lt;html&gt;&quot; &amp; vbNewLine
strFile = strFile &amp; &quot;&lt;head&gt;&quot; &amp; vbNewLine
strFile = strFile &amp; &quot;&lt;title&gt;&quot; &amp; HTMLTitle &amp; &quot;&lt;/title&gt;&quot; &amp; vbNewLine
strFile = strFile &amp; &quot;&lt;/head&gt;&lt;body&gt;&quot; &amp; vbNewLine
strFile = strFile &amp; HTMLText &amp; vbNewLine
strFile = strFile &amp; &quot;&lt;/body&gt;&lt;/html&gt;&quot;
'Calling SaveTextToFile function for IO Operation
SaveTextToFile(strFile, Server.MapPath(&quot;.&quot;) &amp; &quot;\HTMLFiles\&quot; &amp; HTMLFileName &amp; &quot;.html&quot;)
End Sub

Public Function SaveTextToFile(ByVal strData As String, ByVal FullPath As String, Optional ByVal ErrInfo As String = &quot;&quot;) As Boolean
Dim Contents As String
Dim Saved As Boolean = False
'Using StreamWriter to Create File
Dim objReader As IO.StreamWriter
Try
objReader = New IO.StreamWriter(FullPath)
objReader.Write(strData)
objReader.Close()
Saved = True
Catch Ex As Exception
Response.Write(Ex.Message)
End Try
Return Saved
End Function

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CreatePage(&quot;Title goes here&quot;, &quot;Hello world! This is a HTML file Created from Code Behind.&quot;, &quot;Sample&quot;)
End Sub
End Class</pre>
<h2>Introduction to Generate Dynamic HTML (DHTML)</h2>
<p>Unlike static HTML, which presents fixed content, DHTML allows elements on a webpage to change dynamically without requiring a full page reload. This interactivity is achieved through a combination of HTML, Cascading Style Sheets (CSS), JavaScript, and the Document Object Model (DOM).</p>
<p>For example, drop-down menus, form validations, and drag-and-drop interfaces are often powered by DHTML. The key advantage is that content modifications happen on the client side, reducing server requests and improving performance.</p>
<h2>Core Components of DHTML</h2>
<p>1. HTML (HyperText Markup Language) HTML forms the backbone of any webpage, defining the structure and content. In DHTML, HTML elements serve as the foundation upon which dynamic behaviors are applied. Elements like `</p>
<p>`, &#8220;, and forms are frequently manipulated using JavaScript and CSS to create interactive effects.</p>
<p>2. CSS (Cascading Style Sheets) CSS controls the presentation of HTML elements, including layout, colors, fonts, and animations. In DHTML, CSS is used to modify styles dynamically. For instance, JavaScript can change CSS properties to hide or show elements, adjust dimensions, or apply transitions.</p>
<p>3. JavaScript JavaScript is the scripting language that enables dynamic behavior. It interacts with the DOM to manipulate HTML and CSS in real-time. Functions like `document.getElementById()` allow developers to select and modify elements, while event listeners (e.g., `onclick`, `onmouseover`) trigger these changes based on user actions.</p>
<h2>How DHTML Works</h2>
<p>DHTML operates by combining these technologies in the following way:</p>
<p><strong>User Interaction Triggers an Event</strong> – A user action, such as clicking a button or hovering over an element, generates an event.</p>
<p><strong>JavaScript Handles the Event</strong> – An event listener in JavaScript detects the action and executes a corresponding function.</p>
<p><strong>DOM Manipulation Occurs</strong> – The function modifies the DOM, changing HTML content or adjusting CSS properties.</p>
<p><strong>Browser Renders Changes Instantly</strong> – The updated DOM is re-rendered by the browser, displaying the changes to the user.</p>
<h2>Common Applications of DHTML</h2>
<p>1. Drop-Down Menus Navigation menus that expand or collapse based on user clicks are powered by DHTML, improving site usability.</p>
<p>2. Drag-and-Drop Interfaces Web applications like Trello or file uploaders use DHTML to allow users to drag elements across the screen.</p>
<p>3. Dynamic Content Loading Single-page applications (SPAs) use DHTML to load new content without refreshing the page, providing a seamless browsing experience.</p>
<p>4. Animations and Effects Subtle animations, such as fading elements or sliding panels, enhance visual appeal and guide user attention.</p>
<h2>Best Practices for Implementing DHTML</h2>
<p><strong>Optimize Performance</strong> – Excessive DOM manipulation can slow down a webpage. Use efficient selectors and minimize reflows.</p>
<p><strong>Ensure Accessibility</strong> – DHTML elements should remain usable for screen readers and keyboard navigation.</p>
<p><strong>Graceful Degradation</strong> – Design webpages to function even if JavaScript is disabled, ensuring broader compatibility.</p>
<p><strong>Cross-Browser Testing</strong> – Verify that DHTML features work across different browsers and devices.</p>
<p><strong>Use Modern Frameworks</strong> – Libraries like jQuery, React, and Vue.js simplify DHTML implementation and improve maintainability.</p>
<h2>Future of DHTML</h2>
<p>As web technologies evolve, DHTML continues to integrate with modern frameworks and APIs. Web Components, for example, allow reusable custom elements with encapsulated functionality. Additionally, advancements in CSS (like Grid and Flexbox) and JavaScript (ES6+) enable more sophisticated dynamic behaviors.</p>
<p>The rise of progressive web apps (PWAs) and real-time web applications further emphasizes the importance of DHTML in delivering fast, interactive experiences.</p>
<h2>Conclusion</h2>
<p>Dynamic HTML remains a fundamental technology for creating engaging, interactive web applications. By leveraging HTML, CSS, JavaScript, and the DOM, developers can build responsive interfaces that enhance user experience while reducing server dependency. As web standards advance, DHTML will continue to evolve, offering even more powerful tools for modern web development.</p>
<p>The post <a href="https://jharaphula.com/create-dynamic-html-document-vb-net/">How to Generate Dynamic HTML Document using VB.NET Codes?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/create-dynamic-html-document-vb-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html-page.jpg" medium="image" />
	</item>
		<item>
		<title>How to export DataTable to Excel file using VB.NET?</title>
		<link>https://jharaphula.com/export-datatable-to-excel-vb/</link>
					<comments>https://jharaphula.com/export-datatable-to-excel-vb/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:55:18 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[DataTable to Excel File]]></category>
		<category><![CDATA[Display Excel File records]]></category>
		<category><![CDATA[How to export DataTable?]]></category>
		<category><![CDATA[VB.NET]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1559</guid>

					<description><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel-300x192.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to export DataTable to Excel file using VB.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel-300x192.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Excel is very common practice to share data across Network. Recently one of my Customer wants to provide export an excel button in their products...</p>
<p>The post <a href="https://jharaphula.com/export-datatable-to-excel-vb/">How to export DataTable to Excel file using VB.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel-300x192.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to export DataTable to Excel file using VB.NET?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel-300x192.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Excel is very common practice to <a href="https://jharaphula.com/types-of-network-topology-diagram/" rel="noopener noreferrer" target="_blank">share data across Network</a>. Recently one of my Customer wants to provide export an excel button in their products list page. What I did to implement Export DataTable to Excel functionality sharing the same here.</p>
<p>Exporting data from a DataTable to an Excel file is a common requirement in many business applications. Whether for reporting, data analysis, or sharing information, automating this process can save time and reduce errors. VB.NET, with its robust libraries and straightforward syntax, provides multiple ways to accomplish this task. This article explores various methods to export a DataTable to an Excel file, including using Microsoft Office Interop, OpenXML, and third-party libraries like EPPlus.</p>
<p>I added a asp.net server side button with text &#8220;Export to Excel&#8221;. Then inside this button click event I am calling a function Export2Excel. Export2Excel function accepts 2 parameters Select Query &amp; output File Name. Inside the function first I am clearing response object. Then defining Content Type &amp; File Header information. Then fetching data in SQLDataAdapter &amp; Cloning the same data to DataTable. To Create table running loop over TR. According to requirement showing the number of TD&#8217;s. Finally writing the complete string using response.write.</p>
<h3>Button Click</h3>
<pre class="brush: vb; title: ; notranslate">Protected Sub btnExportToExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportToExcel.Click
If Request(&quot;Keyword&quot;) = 1 Then
Export2Excel(&quot;SELECT SearchString, DateOfSearch FROM SearchString WHERE FoundNotFound=1 ORDER BY DateOfSearch DESC&quot;, &quot;SearchStrings.xls&quot;)
Else
Export2Excel(&quot;SELECT SearchString, DateOfSearch FROM SearchString WHERE FoundNotFound=0 ORDER BY DateOfSearch DESC&quot;, &quot;SearchStrings.xls&quot;)
End If
End Sub</pre>
<h3>Export DataTable to Excel Function</h3>
<pre class="brush: vb; title: ; notranslate">Private Sub Export2Excel(ByVal SqlQry As String, ByVal FileName As String)
Response.ClearContent()
Response.ContentType = &quot;Application/vnd.ms-excel&quot;
Response.AddHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=&quot; &amp; FileName &amp; &quot;&quot;)
Response.Flush()

Dim SqlDataAdp As New SqlDataAdapter(SqlQry, sqlConn)
Dim DT As New DataTable
SqlDataAdp.Fill(DT)
sqlConn.Open()

Dim tempTable As String = String.Empty
Dim DTCol As DataColumn
Dim DTRow As DataRow

tempTable = &quot;&lt;table cellpadding='2' cellspacing='2' border='1' width='100%'&gt;&quot;

tempTable = tempTable &amp; &quot;&lt;tr&gt;&quot;
For Each DTCol In DT.Columns
tempTable = tempTable &amp; &quot;&lt;td style='font-weight:bold;'&gt;&quot;
tempTable = tempTable &amp; DTCol.ColumnName.ToString()
tempTable = tempTable &amp; &quot;&lt;/td&gt;&quot;
Next
tempTable = tempTable &amp; &quot;&lt;/tr&gt;&quot;

For Each DTRow In DT.Rows
tempTable = tempTable &amp; &quot;&lt;tr&gt;&quot;
For i = 0 To DT.Columns.Count - 1
tempTable = tempTable &amp; &quot;&lt;td align='left'&gt;&quot;
tempTable = tempTable &amp; DTRow(i).ToString()
tempTable = tempTable &amp; &quot;&lt;/td&gt;&quot;
Next
tempTable = tempTable &amp; &quot;&lt;/tr&gt;&quot;
Next

tempTable = tempTable &amp; &quot;&lt;/table&gt;&quot;

Response.Write(tempTable)
Response.End()
End Sub</pre>
<h2>Conclusion</h2>
<p>Exporting a DataTable to Excel in VB.NET can be achieved through multiple methods, each with its advantages. Microsoft Office Interop is feature-rich but requires Excel installation, OpenXML is lightweight but complex, and EPPlus offers a balanced approach with easy implementation. Choose the method that best fits your project requirements to ensure efficient and reliable Excel exports.</p>
<p>The post <a href="https://jharaphula.com/export-datatable-to-excel-vb/">How to export DataTable to Excel file using VB.NET?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/export-datatable-to-excel-vb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/Export-to-Excel.jpg" medium="image" />
	</item>
		<item>
		<title>How to Create ASP.NET inline Table using data from a DataReader?</title>
		<link>https://jharaphula.com/asp-net-inline-table-datareader/</link>
					<comments>https://jharaphula.com/asp-net-inline-table-datareader/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:52:51 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET inline Table]]></category>
		<category><![CDATA[Bind Data using Datareader]]></category>
		<category><![CDATA[DataReader]]></category>
		<category><![CDATA[Table using data from a DataReader]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1557</guid>

					<description><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/html-Tables-300x190.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Create ASP.NET inline Table using data from a DataReader?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html-Tables-300x190.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html-Tables.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Customization in a web app is very common. Requirement updates everyday. Depending on this it happens occasionally Gridview is incapable to meet customers demand. In...</p>
<p>The post <a href="https://jharaphula.com/asp-net-inline-table-datareader/">How to Create ASP.NET inline Table using data from a DataReader?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/html-Tables-300x190.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to Create ASP.NET inline Table using data from a DataReader?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html-Tables-300x190.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html-Tables.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Customization in a web app is very common. Requirement updates everyday. Depending on this it happens occasionally Gridview is incapable to meet customers demand. In this case we choose ASP.NET inline Table to present data. Commonly there are 2 ways to fetch data from the database DataSet &amp; DataReader. DataSet is connection less architecture. While DataReader is a pointer. DataReader fetch data faster then DataSet mechanism.</p>
<p>Here in this below example I am fetching data from my table PortalWebLink. In side table tag before start the row (tr) I am with a while loop. The condition is until data read is readable bind data. Inside the td I am binding weblinks using dreaderobj(&#8220;WebLinkTitle&#8221;).ToString().</p>
<h3>Table using data from a DataReader</h3>
<pre class="brush: xml; title: ; notranslate">&lt;table border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot; bgcolor=&quot;#e3eef6&quot;&gt;
&lt;%
Dim connObj As New SqlConnection(ConfigurationManager.AppSettings.Get(&quot;DBKey&quot;).ToString())
Dim qryStr As String = &quot;SELECT * FROM PortalWebLink WHERE STATUS='ACTIVE' ORDER BY CreatedDate DESC&quot;
'Response.Write(qryStr)
Dim sqlCommObj As New SqlCommand(qryStr, connObj)

Try
connObj.Open()
Dim dreaderobj As SqlDataReader = sqlCommObj.ExecuteReader

While dreaderobj.Read
%&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#e3eef6&quot;&gt;
&lt;table border='0' cellpadding='0' cellspacing='0'&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;img src='../IMAGES/old-edit-redo.png' /&gt;
&lt;/td&gt;
&lt;td&gt;
&amp;nbsp;&lt;a href='&lt;%= dreaderobj(&quot;WebLink&quot;).ToString %&gt;' target='blank'&gt;&lt;%=dreaderobj(&quot;WebLinkTitle&quot;).ToString()%&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;%
End While
Catch ex As Exception
Dim TrackError As New ErrorLog()
TrackError.ErrorLog(ex.Message, ex.ToString(), ex.Source, ex.TargetSite.ToString(), &quot;&quot;, &quot;../Admin/Weblink.aspx&quot;, connObj)
Finally
connObj.Close()
End Try
%&gt;
&lt;%
Dim strChkQry As String = &quot;SELECT Count(*) as CNT FROM PortalWebLink WHERE STATUS='ACTIVE'&quot;
Dim sqlCommandObj As New SqlCommand(strChkQry, connObj)

try
connObj.Open()
Dim str As Object = sqlCommandObj.ExecuteScalar()
Dim i As Integer = str

If i = 0 Then
%&gt;
&lt;table cellpadding=&quot;2&quot; cellspacing=&quot;2&quot; width=&quot;100%&quot; class=&quot;fbox&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
No Record(s) Found.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;%
end if
Catch ex As Exception
Dim TrackError As New ErrorLog()
TrackError.ErrorLog(ex.Message, ex.ToString(), ex.Source, ex.TargetSite.ToString(), &quot;&quot;, &quot;../Admin/Weblink.aspx&quot;, connObj)
Finally
connObj.Close()
End Try
%&gt;
&lt;tr&gt;
&lt;td&gt;
&amp;nbsp;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</pre>
<p>The post <a href="https://jharaphula.com/asp-net-inline-table-datareader/">How to Create ASP.NET inline Table using data from a DataReader?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/asp-net-inline-table-datareader/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html-Tables.png" medium="image" />
	</item>
		<item>
		<title>How to bind data to a ASP.NET Dropdownlist using DataReader?</title>
		<link>https://jharaphula.com/bind-data-asp-net-dropdownlist-using-datareader/</link>
					<comments>https://jharaphula.com/bind-data-asp-net-dropdownlist-using-datareader/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:49:50 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Dropdownlist using DataReader]]></category>
		<category><![CDATA[ASP.NET Repeater Control]]></category>
		<category><![CDATA[Bind Data using Datareader]]></category>
		<category><![CDATA[ExecuteReader]]></category>
		<category><![CDATA[How to Bind Data?]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1555</guid>

					<description><![CDATA[<img width="300" height="173" src="https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind-300x173.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to a ASP.NET Dropdownlist using DataReader?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind-300x173.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind.jpg 704w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Generally where only one option lefts to Choose from a list of records we use Dropdownlist Control. Let&#8217;s talk about a Country dropdownlist. What you...</p>
<p>The post <a href="https://jharaphula.com/bind-data-asp-net-dropdownlist-using-datareader/">How to bind data to a ASP.NET Dropdownlist using DataReader?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="173" src="https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind-300x173.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to a ASP.NET Dropdownlist using DataReader?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind-300x173.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind.jpg 704w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Generally where only one option lefts to Choose from a list of records we use Dropdownlist Control. Let&#8217;s talk about a Country dropdownlist. What you need to do is need to fetch records from Database. In second step need to <a href="https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/" rel="noopener noreferrer" target="_blank">bind that data</a> to the data-source of ASP.NET dropdownlist. The same I did in the below example.</p>
<p>The logic here I implement is very simple. Using ExecuteReader I am executing my command object against a DataReader. Then with the conditional check DataReader.read method I am running a while loop. Inside this loop adding new listitems with key &amp; value pair from DataReader.</p>
<p>Compare to DataSet DataReader executes faster. DataReader is like a pointer. While DataSet is Connection less architecture.</p>
<h3>dropdown</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:DropDownList ID=&quot;ddlOrgType&quot; runat=&quot;server&quot; TabIndex=&quot;3&quot; ToolTip=&quot;Select your Organization Type&quot; Width=&quot;244px&quot; AutoPostBack=&quot;True&quot;&gt;&lt;/asp:DropDownList&gt;</pre>
<h3>Connection String I Used</h3>
<pre class="brush: vb; title: ; notranslate">Dim connObj As New SqlConnection(ConfigurationManager.AppSettings.Get(&quot;connString&quot;).ToString())</pre>
<p>in web.config:</p>
<pre class="brush: xml; title: ; notranslate">&lt;appSettings&gt;
&lt;add key=&quot;connString&quot; value=&quot;Data Source=localhost; uid=sa; pwd=tiger; database=TRAINNINGMANAGER;&quot;/&gt;
&lt;/appSettings&gt;</pre>
<h3>SelectedIndexChanged event of dropdown</h3>
<pre class="brush: vb; title: ; notranslate">Protected Sub ddlOrgType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlOrgType.SelectedIndexChanged
ddlDivision.Items.Clear()
'Fill up ddlDivision dropdownlist from DivisionTab
Dim commDivision As New SqlCommand(&quot;SELECT * FROM DivisionTab WHERE divisionStatus='1' and fkTypeOrgID=&quot; &amp; ddlOrgType.SelectedValue.ToString, connObj)

Try
connObj.Open()
Dim Objdr As SqlDataReader = commDivision.ExecuteReader
ddlDivision.Items.Add(New ListItem(&quot;Please Select...&quot;, 0))
While Objdr.Read
ddlDivision.Items.Add(New ListItem(Objdr(1), Objdr(0)))
End While

Catch ex As Exception
Response.Write(ex.ToString())

Finally
connObj.Close()
End Try
End Sub</pre>
<p>The post <a href="https://jharaphula.com/bind-data-asp-net-dropdownlist-using-datareader/">How to bind data to a ASP.NET Dropdownlist using DataReader?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/bind-data-asp-net-dropdownlist-using-datareader/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/dropdown-data-bind.jpg" medium="image" />
	</item>
		<item>
		<title>How to implement Paging and Sorting in ASP.NET Gridview Example?</title>
		<link>https://jharaphula.com/paging-sorting-asp-net-gridview-example/</link>
					<comments>https://jharaphula.com/paging-sorting-asp-net-gridview-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 06:22:08 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Gridview Example]]></category>
		<category><![CDATA[HeaderTemplate]]></category>
		<category><![CDATA[ItemTemplate]]></category>
		<category><![CDATA[Paging and Sorting]]></category>
		<category><![CDATA[Paging in ASP.NET Gridview]]></category>
		<category><![CDATA[Sorting in ASP.NET Gridview]]></category>
		<category><![CDATA[TemplateField]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1284</guid>

					<description><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Paging &amp; Sorting in ASP.NET Gridview Example?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Among Server side web programming ASP.NET is so popular. It was found in ASP.NET applications Gridview is a key element to present data in tabular...</p>
<p>The post <a href="https://jharaphula.com/paging-sorting-asp-net-gridview-example/">How to implement Paging and Sorting in ASP.NET Gridview Example?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Paging &amp; Sorting in ASP.NET Gridview Example?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Among Server side web programming ASP.NET is so popular. It was found in ASP.NET applications Gridview is a key element to present data in tabular shape. Above 90% ASP.NET web application uses Gridview. While presenting data in a Gridview to make this more user friendly Customer like to implement Paging and Sorting. Pagination helps to load data faster. Rather loading all records in one turn pagination loads data page wise. Similarly sorting give flexibility to sort the <a href="https://jharaphula.com/database-basics-terminologies-definition/" rel="noopener noreferrer" target="_blank">data</a> alphabetically. Sorting also helps for search.</p>
<p>In this session I am sharing an example from my application, where I did implemented pagination &amp; sorting in a Gridview. Look at the Code below how I did this.</p>
<h3>Paging and Sorting in ASP.NET Gridview</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView DataKeyNames=&quot;AdvID&quot; CssClass=&quot;bodytext&quot; AutoGenerateColumns=&quot;False&quot; PageSize=&quot;25&quot;
AllowPaging=&quot;True&quot; AllowSorting=&quot;True&quot; ID=&quot;grdEditViewAll&quot; runat=&quot;server&quot;
Width=&quot;100%&quot; CellPadding=&quot;4&quot; BackColor=&quot;White&quot; BorderColor=&quot;#CCCCCC&quot;
BorderStyle=&quot;None&quot; BorderWidth=&quot;1px&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField ItemStyle-HorizontalAlign=&quot;Center&quot;&gt;
&lt;HeaderTemplate&gt;
&lt;img src=&quot;../../IMAGES/input_arrow_down.gif&quot; /&gt;
&lt;/HeaderTemplate&gt;
&lt;ItemTemplate&gt;
&lt;img src=&quot;../../IMAGES/icn_paper.gif&quot; /&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle Width=&quot;25px&quot; /&gt;
&lt;ItemStyle HorizontalAlign=&quot;Center&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot; HeaderText=&quot;Title&quot; SortExpression=&quot;AdvTitle&quot;&gt;
&lt;ItemTemplate&gt;
&lt;span onmouseover=&quot;Tip('Click to preview &lt;%# Container.DataItem(&quot;AdvTitle&quot;) %&gt;')&quot; onmouseout=&quot;UnTip()&quot;&gt;
&lt;asp:HyperLink ID=&quot;hypPreview&quot; runat=&quot;server&quot; Text=&lt;%# Container.DataItem(&quot;AdvTitle&quot;) %&gt;&gt;&lt;/asp:HyperLink&gt;
&lt;/span&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:BoundField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;AdvCompany&quot; HeaderText=&quot;Company&quot; SortExpression=&quot;AdvCompany&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:BoundField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;AdResolution&quot; HeaderText=&quot;Resolution&quot; SortExpression=&quot;AdResolution&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:BoundField Visible=&quot;false&quot; ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;NewCopyNPaste&quot; HeaderText=&quot;Flag&quot; SortExpression=&quot;NewCopyNPaste&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:BoundField Visible=&quot;false&quot; ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;textColor&quot; HeaderText=&quot;textColor&quot; SortExpression=&quot;textColor&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:BoundField Visible=&quot;false&quot; ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;Backgroundcolor&quot; HeaderText=&quot;Backgroundcolor&quot; SortExpression=&quot;Backgroundcolor&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:TemplateField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
HeaderText=&quot;Edit&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:HyperLink ID=&quot;hypEdit&quot; runat=&quot;server&quot; ImageUrl=&quot;../../Images/grdEdit.png&quot;&gt;&lt;/asp:HyperLink&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
HeaderText=&quot;Delete&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:HyperLink ID=&quot;hypDelete&quot; runat=&quot;server&quot; ImageUrl=&quot;../../Images/grdDelete.png&quot;&gt;&lt;/asp:HyperLink&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
HeaderText=&quot;Code&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a href='javascript:popupPageWH(&quot;../../AdManager/GenerateCode.aspx?AdvID=&lt;%# Container.DataItem(&quot;AdvID&quot;) %&gt;&quot;,&quot;theWindow&quot;,&quot;750&quot;,&quot;250&quot;)'
style=&quot;cursor: hand;&quot;&gt;&lt;img src=&quot;../../Images/arrow_circle_double.png&quot; style=&quot;border:0px;&quot; /&gt;&lt;/a&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;
&lt;/Columns&gt;
&lt;RowStyle Height=&quot;20px&quot; ForeColor=&quot;#000066&quot; /&gt;
&lt;FooterStyle BackColor=&quot;White&quot; ForeColor=&quot;#000066&quot; /&gt;
&lt;PagerStyle BackColor=&quot;White&quot; ForeColor=&quot;#000066&quot; HorizontalAlign=&quot;Left&quot; /&gt;
&lt;SelectedRowStyle BackColor=&quot;#669999&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; /&gt;
&lt;HeaderStyle BackColor=&quot;#005b90&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; /&gt;
&lt;/asp:GridView&gt;</pre>
<p>To enable pagination &amp; sorting first add these attribute to your Gridview control AllowPaging=&#8221;True&#8221; AllowSorting=&#8221;True&#8221;. Define DataKeyNames to your Gridview.</p>
<h3>from Code-Behind</h3>
<p>In your Code-Behind file first declare two variables ASCENDING &amp; DESCENDING.</p>
<pre class="brush: vb; title: ; notranslate">Dim ASCENDING As String = &quot; ASC&quot;
Dim DESCENDING As String = &quot; DESC&quot;</pre>
<p>Then to Create PageIndexChanging event for your Gridview &amp; add the below Code. Directly don&#8217;t Copy the below Code. First Create event then Copy the Code Inside.</p>
<pre class="brush: vb; title: ; notranslate">Protected Sub grdEditViewAll_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdEditViewAll.PageIndexChanging
grdEditViewAll.PageIndex = e.NewPageIndex
grdEditViewAll.DataBind()
End Sub</pre>
<p>Then to implement Sorting implement the following. Here I created events for my Gridview while implementing make sure you updated correctly.</p>
<pre class="brush: vb; title: ; notranslate">Protected Sub grdEditViewAll_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdEditViewAll.Sorting
Dim sortExpression As String = e.SortExpression
If GridViewSortDirection = SortDirection.Ascending Then
GridViewSortDirection = SortDirection.Descending
SortGridView(sortExpression, DESCENDING)
Else
GridViewSortDirection = SortDirection.Ascending
SortGridView(sortExpression, ASCENDING)
End If
End Sub

Public Sub SortGridView(ByVal sortExpression As String, ByVal direction As String)
Dim dtable As DataTable = ds.Tables(0)
Dim dview As New DataView(dtable)
dview.Sort = sortExpression &amp; direction
grdEditViewAll.DataSource = dview
grdEditViewAll.DataBind()
End Sub

Private Property GridViewSortDirection() As SortDirection
Get
If ViewState(&quot;sortDirection&quot;) Is Nothing Then
ViewState(&quot;sortDirection&quot;) = SortDirection.Ascending
End If
Return CType(ViewState(&quot;sortDirection&quot;), SortDirection)
End Get
Set(ByVal Value As SortDirection)
ViewState(&quot;sortDirection&quot;) = Value
End Set
End Property</pre>
<p>The post <a href="https://jharaphula.com/paging-sorting-asp-net-gridview-example/">How to implement Paging and Sorting in ASP.NET Gridview Example?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/paging-sorting-asp-net-gridview-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting.jpg" medium="image" />
	</item>
		<item>
		<title>In a dynamic ASP.NET Gridview Delete row example</title>
		<link>https://jharaphula.com/asp-net-gridview-delete-row-example/</link>
					<comments>https://jharaphula.com/asp-net-gridview-delete-row-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 06:20:47 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Gridview]]></category>
		<category><![CDATA[Datagrid]]></category>
		<category><![CDATA[Datagrid Delete row example]]></category>
		<category><![CDATA[Gridview Delete row example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1282</guid>

					<description><![CDATA[<img width="300" height="193" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-300x193.png" class="webfeedsFeaturedVisual wp-post-image" alt="In a dynamic ASP.NET Gridview Delete row example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-300x193.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-294x190.png 294w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-records.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During we display data in a Gridview in many places Customer wants to implement checkbox in the grid for Select all &#38; individual rows. Using...</p>
<p>The post <a href="https://jharaphula.com/asp-net-gridview-delete-row-example/">In a dynamic ASP.NET Gridview Delete row example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="193" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-300x193.png" class="webfeedsFeaturedVisual wp-post-image" alt="In a dynamic ASP.NET Gridview Delete row example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-300x193.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-records-294x190.png 294w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-records.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During we display data in a Gridview in many places Customer wants to implement checkbox in the grid for Select all &amp; individual rows. Using this feature user can edit or delete records. Expected behavior is like user can select the rows which one he/she want to edit or delete. For edit purpose only one row need to select. While for delete multiple rows can be OK. During delete we need to ask confirmation. After confirmation we can go for delete records. The same I implemented in my App. Sharing you the code from there. Hope it will help you to implement your own.</p>
<h3>ASP.NET Gridview</h3>
<pre class="brush: xml; title: ; notranslate">&lt;asp:GridView DataKeyNames=&quot;VisitorTrackingID&quot; CssClass=&quot;bodytext&quot; AutoGenerateColumns=&quot;false&quot; PageSize=&quot;18&quot;
AllowPaging=&quot;True&quot; AllowSorting=&quot;True&quot; ID=&quot;grdVisitorTracking&quot; runat=&quot;server&quot;
Width=&quot;100%&quot; CellPadding=&quot;2&quot; BackColor=&quot;White&quot; BorderColor=&quot;#CCCCCC&quot;
BorderStyle=&quot;None&quot; BorderWidth=&quot;1px&quot;&gt;
&lt;Columns&gt;
&lt;asp:TemplateField&gt;
&lt;HeaderTemplate&gt;
&lt;input type=&quot;checkbox&quot; style=&quot;width: 20px;&quot; id=&quot;chkAll&quot; onclick=&quot;javascript:checkAll(this);&quot; /&gt;
&lt;/HeaderTemplate&gt;
&lt;ItemTemplate&gt;
&lt;input type=&quot;checkbox&quot; style=&quot;width: 20px;&quot; id=&quot;chkSelect&quot; runat=&quot;server&quot; name=&quot;chkSelect&quot; /&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle Width=&quot;25px&quot;/&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:BoundField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;TrackingID&quot; HeaderText=&quot;Tracking ID&quot; SortExpression=&quot;TrackingID&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;
&lt;asp:BoundField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot;
DataField=&quot;TrackingCompany&quot; HeaderText=&quot;Company&quot; SortExpression=&quot;TrackingCompany&quot;&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:BoundField&gt;

&lt;asp:TemplateField HeaderStyle-HorizontalAlign=&quot;Left&quot; HeaderText=&quot;Weblink&quot; SortExpression=&quot;TrackingUrl&quot;&gt;
&lt;ItemTemplate&gt;
&lt;a href='&lt;%# Container.DataItem(&quot;TrackingUrl&quot;) %&gt;' target=&quot;_blank&quot; style=&quot;cursor: hand;&quot;&gt;
&lt;%# Container.DataItem(&quot;TrackingUrl&quot;) %&gt;&lt;/a&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;

&lt;asp:TemplateField ItemStyle-CssClass=&quot;bodytext&quot; HeaderStyle-HorizontalAlign=&quot;Left&quot; HeaderText=&quot;Edit&quot;&gt;
&lt;ItemTemplate&gt;
&lt;asp:HyperLink ID=&quot;hypEdit&quot; runat=&quot;server&quot; ImageUrl=&quot;../Images/grdEdit.png&quot;&gt;&lt;/asp:HyperLink&gt;
&lt;/ItemTemplate&gt;
&lt;HeaderStyle HorizontalAlign=&quot;Left&quot;&gt;&lt;/HeaderStyle&gt;
&lt;ItemStyle CssClass=&quot;bodytext&quot; HorizontalAlign=&quot;Left&quot;&gt;&lt;/ItemStyle&gt;
&lt;/asp:TemplateField&gt;
&lt;/Columns&gt;
&lt;RowStyle Height=&quot;20px&quot; ForeColor=&quot;#000066&quot; /&gt;
&lt;FooterStyle BackColor=&quot;White&quot; ForeColor=&quot;#000066&quot; /&gt;
&lt;PagerStyle BackColor=&quot;White&quot; ForeColor=&quot;#000066&quot; HorizontalAlign=&quot;Left&quot; /&gt;
&lt;SelectedRowStyle BackColor=&quot;#669999&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; /&gt;
&lt;HeaderStyle BackColor=&quot;#005b90&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;White&quot; /&gt;
&lt;%--&lt;AlternatingRowStyle BackColor=&quot;#E1F0FF&quot; /&gt;--%&gt;
&lt;/asp:GridView&gt;</pre>
<p>To implement delete functionality depending upon those rows we selected, here I added checkbox in the TemplateField of my Grid. For Select All I added a checkbox in HeaderTemplate &amp; for rows I added another checkbox (HTML Control) in ItemTemplate. To make Select All operate on its onClick event I am calling a JavaScript function checkAll(this).</p>
<h3>CheckAll() Function</h3>
<pre class="brush: jscript; title: ; notranslate">function checkAll(obj)
{
if(obj.checked) markAllState = true;
else markAllState = false;
frm = document.forms[0];
for(i=0;i&lt; frm.elements.length;i++)
{
e = frm.elements[i];
//GridView2$ctl01$check&quot; type=&quot;checkbox&quot; id=&quot;GridView2_ctl01_check
if (e.type == 'checkbox' &amp;&amp; e.name != 'GridView2$ctl01$check')
{
temp='e.checked = '+markAllState;
eval(temp);
}
}
}</pre>
<p>This function is responsible to Check all rows in the grid. The logic I implemented here is first I am getting all the checkbox from the form. Then to identify grid related checkbox I am doing a conditional checking if (e.type == &#8216;checkbox&#8217; &amp;&amp; e.name != &#8216;GridView2$ctl01$check&#8217;).</p>
<p>Once rows are selected to proceed ahead delete operation we need to show a confirmation to the user. To handle this I implemented the below <a href="https://jharaphula.com/javascript-function-random-string/" rel="noopener noreferrer" target="_blank">JavaScript function</a>.</p>
<h3>Delete User Confirmation Function</h3>
<pre class="brush: jscript; title: ; notranslate">function deluser()
{
var j= 0;
frm = document.forms[0];
for(i=0;i&lt; frm.elements.length;i++)
{
e = frm.elements[i];

if (e.type == 'checkbox')
{
if(e.checked==true)
j=j+1;
}
}
//if(j&gt;1 || j&lt;1)
if(j&lt;1)
{
alert(&quot;Please select a Visitor Tracking to Delete.&quot;)
return false;
}
//return true;
var con = confirm(&quot;Are you sure, You want to delete this Visitor Tracking.&quot;);
if(con) return true;
else return false;
}</pre>
<p>This function checks state of the Check-boxes. If checkbox is checked it means user selected that row for delete. To get the confirmation from user showing a confirmation window with message &#8220;Are you sure, You want to delete this Visitor Tracking.&#8221;.</p>
<p>This is all about front-end. After user confirmation we need to fire delete query from code behind. Look at the Code below.</p>
<h3>Code-Behind Delete Query</h3>
<pre class="brush: vb; title: ; notranslate">Protected Sub btnDel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDel.Click
Dim i As Integer
For i = 0 To grdVisitorTracking.Rows.Count - 1
Dim row As GridViewRow = grdVisitorTracking.Rows(i)
Dim ischecked As Boolean = (CObj(row).FindControl(&quot;chkSelect&quot;)).Checked
If (ischecked) Then
aDel.Add(grdVisitorTracking.DataKeys.Item(i).Value)
End If
Next
If Not aDel.Count &lt;&gt; 0 Then
'Do Nothing
Else
'Dim confirm = MsgBox(&quot;Are you sure you want to delete this item&quot;, MsgBoxStyle.OkCancel)
'If confirm = 1 Then
For i = 0 To aDel.Count - 1

Dim sDelStr As String = &quot;DELETE FROM VisitorsTracking WHERE VisitorTrackingID=&quot; &amp; aDel(i)
Dim oDelComm As New SqlCommand(sDelStr, sqlConn)
sqlConn.Open()
oDelComm.ExecuteNonQuery()
sqlConn.Close()

grdVisitorTracking.DataBind()
Next
End If

Response.Redirect(&quot;../ADMIN/EditVisitorTracking.aspx&quot;)
End Sub</pre>
<p>Finally for delete operation in Code-behind I am detecting chkSelect state. If it returns true I am storing its value to an array &#8220;aDel&#8221;. In next phase checking the count of aDel if it is greater then zero then executing SQL Delete command against that particular record id.</p>
<p>The post <a href="https://jharaphula.com/asp-net-gridview-delete-row-example/">In a dynamic ASP.NET Gridview Delete row example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/asp-net-gridview-delete-row-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/gridview-records.png" medium="image" />
	</item>
		<item>
		<title>How to Execute a Stored Procedure from VB.NET Code behind File?</title>
		<link>https://jharaphula.com/execute-stored-procedure-vb-net-code-behind/</link>
					<comments>https://jharaphula.com/execute-stored-procedure-vb-net-code-behind/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 06:19:32 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ConvertDataReaderToDataSet]]></category>
		<category><![CDATA[Execute a Stored Procedure]]></category>
		<category><![CDATA[ExecuteReader]]></category>
		<category><![CDATA[Stored Procedure from VB.NET]]></category>
		<category><![CDATA[VB.NET Code behind File]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1280</guid>

					<description><![CDATA[<img width="300" height="194" src="https://jharaphula.com/wp-content/uploads/2016/05/database-300x194.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Execute a Stored Procedure from VB.NET Code behind File?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/database-300x194.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/database-294x190.jpg 294w, https://jharaphula.com/wp-content/uploads/2016/05/database-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2016/05/database.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Stored procedures are precompiled SQL statements stored in a database, offering improved performance, security, and maintainability. In VB.NET, executing a stored procedure from a code-behind...</p>
<p>The post <a href="https://jharaphula.com/execute-stored-procedure-vb-net-code-behind/">How to Execute a Stored Procedure from VB.NET Code behind File?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="194" src="https://jharaphula.com/wp-content/uploads/2016/05/database-300x194.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Execute a Stored Procedure from VB.NET Code behind File?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/database-300x194.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/database-294x190.jpg 294w, https://jharaphula.com/wp-content/uploads/2016/05/database-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2016/05/database.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Stored procedures are precompiled SQL statements stored in a database, offering improved performance, security, and maintainability. In VB.NET, executing a stored procedure from a code-behind file involves connecting to the database, setting up command objects, and handling parameters. This guide provides a step-by-step approach to executing stored procedures efficiently.</p>
<p>Experienced programmers prefer to use stored procedures in place of inline SQL Query. There are several advantages of using stored procedure. First of all stored procedure provides security &amp; it helps to improve performance. Once a stored procedure execute it cached on the server. Stored procedure are easy to maintain &amp; debug like a separate unit. Stored procedure can be tested independent of the application. In this session let us show you in <a href="https://jharaphula.com/category/programming-solutions/microsoft-technologies/" rel="noopener noreferrer" target="_blank">Microsoft Technology</a> VB.NET how to execute a stored procedure from the Code behind file. </p>
<p>In the below example I am using the stored procedure &#8220;USP_SearchLogo&#8221;. This stored procedure accepts 4 parameters. To execute this stored procedure here I am creating a new instance (SearchLogoCmd) of SqlCommand object by passing the stored procedure name &amp; connection details (Connection String). Then to make compiler know that we are using stored procedure in command object in place of SQL Query, I defined command type to StoredProcedure. Now I need to pass parameter values before execute the procedure. To do that I am using SearchLogoCmd.Parameters.Add method. In this method I am passing parameter name with the data type depending upon the Stored procedure. Finally executing the Command object using ExecuteReader.</p>
<h3>Execute a Stored Procedure from VB.NET Example</h3>
<pre class="brush: vb; title: ; notranslate">Dim SearchLogoCmd As New SqlCommand(&quot;USP_SearchLogo&quot;, sqlConn)

SearchLogoCmd.CommandType = CommandType.StoredProcedure

SearchLogoCmd.Parameters.Add(&quot;@NativeFlag&quot;, SqlDbType.NVarChar).Value = Request(&quot;NativeFlag&quot;)
SearchLogoCmd.Parameters.Add(&quot;@LogoName&quot;, SqlDbType.NVarChar).Value = Trim(txtLogoName.Text)
SearchLogoCmd.Parameters.Add(&quot;@LogoFileName&quot;, SqlDbType.NVarChar).Value = Trim(txtFileName.Text)
SearchLogoCmd.Parameters.Add(&quot;@Status&quot;, SqlDbType.NVarChar).Value = ddlStatus.SelectedValue

Try
sqlConn.Open()
ds = ConvertDataReaderToDataSet(SearchLogoCmd.ExecuteReader())

grdImageFiles.DataSource = ds
grdImageFiles.DataBind()

Catch ex As Exception
Response.Write(ex.ToString())
Finally
sqlConn.Close()
End Try</pre>
<p>You may noticed here I used a function ConvertDataReaderToDataSet(). This is because of here my Stored procedure returns reader specific data. To bind those data to my gridview &#8220;grdImageFiles&#8221; using a DataSet I used this function.</p>
<h2>Best Practices</h2>
<p>1. Use Parameterized Queries – Avoid SQL injection by always using parameters.<br />
2. Dispose Objects – Utilize `Using` statements to ensure proper disposal of `SqlConnection` and `SqlCommand`.<br />
3. Connection Pooling – Let ADO.NET manage connections efficiently.<br />
4. Error Logging – Log exceptions for debugging and monitoring.</p>
<h2>Conclusion</h2>
<p>Executing a stored procedure from VB.NET involves setting up a database connection, configuring a `SqlCommand` object, passing parameters, and handling results. Following these steps ensures secure and efficient database operations. By adhering to best practices, developers can maintain robust and scalable applications.</p>
<p>The post <a href="https://jharaphula.com/execute-stored-procedure-vb-net-code-behind/">How to Execute a Stored Procedure from VB.NET Code behind File?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/execute-stored-procedure-vb-net-code-behind/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/database.jpg" medium="image" />
	</item>
		<item>
		<title>SqlDataReader to DataSet Converter VB.NET Function</title>
		<link>https://jharaphula.com/sqldatareader-to-dataset-converter-function/</link>
					<comments>https://jharaphula.com/sqldatareader-to-dataset-converter-function/#comments</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 18:56:08 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[DataReader]]></category>
		<category><![CDATA[SqlDataReader]]></category>
		<category><![CDATA[SqlDataReader to DataSet Converter]]></category>
		<category><![CDATA[VB.NET Function]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1238</guid>

					<description><![CDATA[<img width="300" height="193" src="https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-300x193.bmp" class="webfeedsFeaturedVisual wp-post-image" alt="SqlDataReader to DataSet Converter VB.NET Function" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-300x193.bmp 300w, https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-294x190.bmp 294w, https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework.bmp 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During application development sometime we fetch data from the database using DataReader. Later to do some other operations we required that DataReader data in a...</p>
<p>The post <a href="https://jharaphula.com/sqldatareader-to-dataset-converter-function/">SqlDataReader to DataSet Converter VB.NET Function</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="193" src="https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-300x193.bmp" class="webfeedsFeaturedVisual wp-post-image" alt="SqlDataReader to DataSet Converter VB.NET Function" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-300x193.bmp 300w, https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework-294x190.bmp 294w, https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework.bmp 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During application development sometime we fetch data from the database using DataReader. Later to do some other operations we required that DataReader data in a DataSet. In this case the below function can help you. Here I created the <a href="https://jharaphula.com/php-string-functions-with-example/" rel="noopener noreferrer" target="_blank">function</a> which will accept a DataReader &amp; will return DataSet for you.</p>
<p>The Logic I implemented here is very simple. After receiving DataReader as a parameter to the function I am storing its schema to a DataTable. Then using a for loop I am adding row &amp; columns definition to the DataTable. After define the row &amp; column adding DataTable to DataSet using dataSet.Tables.Add method. Now to fill data in DataTable executing a while loop until reader.Read(). Creating an instance for new row &amp; using a for loop adding DataRow dynamically. To store value from DataReader here I am using GetValue() method. Finally using dataTable.Rows.Add method adding all rows to the DataTable. Already before binding rows data, my DataTable is added to DataSet. Now by just using return dataSet I am getting DataSet with DataReader values.</p>
<p>While Creating this function create it as public shared function so that you can easily use this with your executeReader method like ds = convertDataReaderToDataSet(cmd.ExecuteReader()).</p>
<h3>DataReader to DataSet Converter Function</h3>
<pre class="brush: vb; title: ; notranslate">Public Shared Function convertDataReaderToDataSet(ByVal reader As SqlDataReader) As DataSet
Dim dataSet As New DataSet()
Do
' Create a New Data Table to store DataReader data temporarily
Dim tblSchema As DataTable = reader.GetSchemaTable()
Dim dataTable As New DataTable()

If tblSchema IsNot Nothing Then
For i As Integer = 0 To tblSchema.Rows.Count - 1
Dim dataRow As DataRow = tblSchema.Rows(i)
' Creating unique Column name to Data Table
Dim columnName As String = DirectCast(dataRow(&quot;ColumnName&quot;), String)
Dim column As New DataColumn(columnName, DirectCast(dataRow(&quot;DataType&quot;), Type))
dataTable.Columns.Add(column)
Next

dataSet.Tables.Add(dataTable)

' Fill the data table from Data Reader
While reader.Read()
Dim dataRow As DataRow = dataTable.NewRow()

For i As Integer = 0 To reader.FieldCount - 1
dataRow(i) = reader.GetValue(i)
Next

dataTable.Rows.Add(dataRow)
End While
Else
' No records to Return
Dim column As New DataColumn(&quot;AffectedRows&quot;)
dataTable.Columns.Add(column)
dataSet.Tables.Add(dataTable)
Dim dataRow As DataRow = dataTable.NewRow()
dataRow(0) = reader.RecordsAffected
dataTable.Rows.Add(dataRow)
End If
Loop While reader.NextResult()
Return dataSet
End Function</pre>
<p>The post <a href="https://jharaphula.com/sqldatareader-to-dataset-converter-function/">SqlDataReader to DataSet Converter VB.NET Function</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/sqldatareader-to-dataset-converter-function/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/visual-basic-framework.bmp" medium="image" />
	</item>
		<item>
		<title>ASP.NET File Upload to Server using FileUpload Control Example</title>
		<link>https://jharaphula.com/asp-net-file-upload-to-server-example/</link>
					<comments>https://jharaphula.com/asp-net-file-upload-to-server-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 09:52:52 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET File Upload]]></category>
		<category><![CDATA[File Upload to Server]]></category>
		<category><![CDATA[FileUpload Control Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=976</guid>

					<description><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-300x192.png" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET File Upload to Server using FileUpload Control Example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-300x192.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/file-uploading.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During web application design some time we required to upload local files to server. Let&#8217;s talk about a job portal, where candidates need to upload...</p>
<p>The post <a href="https://jharaphula.com/asp-net-file-upload-to-server-example/">ASP.NET File Upload to Server using FileUpload Control Example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-300x192.png" class="webfeedsFeaturedVisual wp-post-image" alt="ASP.NET File Upload to Server using FileUpload Control Example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-300x192.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/file-uploading.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During web application design some time we required to upload local files to server. Let&#8217;s talk about a job portal, where candidates need to upload their career profiles. To provide this facility we need to implement file uploading in our application. If your application is designed using <a href="https://jharaphula.com/category/programming-solutions/microsoft-technologies/" rel="noopener noreferrer" target="_blank">Microsoft Technology</a> ASP.NET compare to other languages in web it is very easy to implement File uploading. In the below example I created a sample application to implement ASP.NET File Upload to Server.</p>
<p>To implement ASP.NET File Uploading Create a new web project using Visual Studio. Then in the root folder add a folder &#8220;upload&#8221;. Look at the code below in my Default.aspx.vb file I used Server.MapPath to generate the path for file uploading. Here I used the folder upload, where user file will store. You can update this as per your folder structure.</p>
<h2>Understanding the FileUpload Control</h2>
<p>The FileUpload control is a powerful tool that provides an easy way to allow users to send files from their local system to a web server. With this control, developers can efficiently handle file uploads while also ensuring they meet security standards. The control enables applications to collect essential information from users, which can be critical for operations like applying for jobs.</p>
<p><img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-demo.png" alt="file-uploading-demo" width="750" height="239" class="alignnone size-full wp-image-2923" srcset="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-demo.png 750w, https://jharaphula.com/wp-content/uploads/2016/05/file-uploading-demo-300x96.png 300w" sizes="auto, (max-width: 750px) 100vw, 750px" /></p>
<p>Look at my aspx file to make this presentation simple I used one ASP.NET file uploader control &amp; a button. On click of my button btnUpload I am calling the file uploader SaveAs method with the parameter file path. By declaring fileUploader.FileName I am uploading the file with similar name. If you want to generate different file name for uploaded files you can implement your logic here.</p>
<p>Keep remember by default file uploading supports the maximum size 4096 (4 MB) file. To upload larger file you need to update your web.config file as below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;configuration&gt;
&lt;system.web&gt;
&lt;httpRuntime maxRequestLength=&quot;Size in KB&quot; /&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</pre>
<h3>Default.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Default.aspx.vb&quot; Inherits=&quot;_Default&quot; %&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;ASP.NET File Upload to Server Example&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmUpload&quot; runat=&quot;server&quot;&gt;
&lt;asp:FileUpload ID=&quot;fileUploader&quot; runat=&quot;server&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;asp:Button ID=&quot;btnUpload&quot; runat=&quot;server&quot; Text=&quot;Upload File&quot; /&gt;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;asp:Label ID=&quot;lblStatus&quot; runat=&quot;server&quot;&gt;&lt;/asp:Label&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Default.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
'Checking is file uploader control has any file.
If fileUploader.HasFile Then
Try
'Using SaveAs method to upload the file.
fileUploader.SaveAs(Server.MapPath(&quot;upload/&quot;) &amp; fileUploader.FileName)
'After Successfully file uploaded show msg to user.
lblStatus.Text = &quot;File name: &quot; &amp; fileUploader.PostedFile.FileName &amp; &quot;&lt;br&gt;&quot; &amp; &quot;File Size: &quot; &amp; fileUploader.PostedFile.ContentLength &amp; &quot; kb&lt;br&gt;&quot; &amp; &quot;Content type: &quot; &amp; fileUploader.PostedFile.ContentType()
Catch ex As Exception
'Handling exception if any.
lblStatus.Text = &quot;ERROR: &quot; &amp; ex.Message.ToString()
End Try
Else
'Showing msg if user hit on upload button without selected a valid file.
lblStatus.Text = &quot;You have not specified a file.&quot;
End If
End Sub
End Class</pre>
<h2>Conclusion</h2>
<p>The capability to upload files in a web application is essential, especially for platforms like job portals where candidates frequently submit their resumes. By using the FileUpload control, developers can create a seamless experience for users while ensuring the application remains secure and efficient. Implementing proper validation and feedback mechanisms will further enhance the effectiveness of file uploads, making them a vital feature of any job application platform.</p>
<p>The post <a href="https://jharaphula.com/asp-net-file-upload-to-server-example/">ASP.NET File Upload to Server using FileUpload Control Example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/asp-net-file-upload-to-server-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/file-uploading.png" medium="image" />
	</item>
		<item>
		<title>On Mouseover how to Highlight ASP.NET Gridview Selected Row</title>
		<link>https://jharaphula.com/highlight-asp-net-gridview-selected-row/</link>
					<comments>https://jharaphula.com/highlight-asp-net-gridview-selected-row/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 09:09:46 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[CSS in UI designing]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[Gridview Selected Row]]></category>
		<category><![CDATA[On Mouseover]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=943</guid>

					<description><![CDATA[<img width="300" height="176" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows-300x176.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="On Mouseover how to Highlight ASP.NET Gridview Selected Row" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows-300x176.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows.jpg 748w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To present data in tabular form in ASP.NET Gridview is so popular. Nearly 90% ASP.NET Developers love to work with Gridview. In a Gridview we...</p>
<p>The post <a href="https://jharaphula.com/highlight-asp-net-gridview-selected-row/">On Mouseover how to Highlight ASP.NET Gridview Selected Row</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="176" src="https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows-300x176.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="On Mouseover how to Highlight ASP.NET Gridview Selected Row" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows-300x176.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows.jpg 748w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To present data in tabular form in ASP.NET Gridview is so popular. Nearly 90% ASP.NET Developers love to work with Gridview. In a Gridview we can bind several <a href="https://jharaphula.com/database-basics-terminologies-definition/" target="_blank" rel="noopener noreferrer">data sources</a>. Gridview is easy &amp; take less time to implement. Any time of Customization we required to show in a tabular data it is possible using Gridview. In this example let us discuss a situation where On mouse over I want to Highlight Gridview Selected Row. To do this here I used a XML data source to display records in Gridview. On over the mouse event I am binding 2 different CSS classes to highlight the row.</p>
<p>From several events of a Gridview control RowCreated is fired when a row created programmatically. To add my CSS classes for highlight feature inside grdDemo_RowCreated() event I added 2 events onmouseover &amp; onmouseout to each row of the Grid. In onmouseover event I am assigning the CSS class hightlighrow with background-color:#CCCCCC;. While when user remove his mouse from the row to revert back into previous background color I added onmouseout event with CSS class normalrow. normalrow CSS class contains the default background color white. Look at the demo code below.</p>
<h3>Default.aspx</h3>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Default.aspx.vb&quot; Inherits=&quot;_Default&quot; %&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;On Mouseover how to Highlight ASP.NET Gridview Selected Row&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
.normalrow
{
background-color:white;
}
.hightlighrow
{
background-color:#cccccc;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmGridview&quot; runat=&quot;server&quot;&gt;
&lt;asp:GridView ID=&quot;grdDemo&quot; runat=&quot;server&quot;&gt;
&lt;/asp:GridView&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Default.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim employeelog = New DataSet
employeelog.ReadXml(MapPath(&quot;employees.xml&quot;))
grdDemo.DataSource = employeelog
grdDemo.DataBind()
End If
End Sub

Protected Sub grdDemo_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdDemo.RowCreated
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes.Add(&quot;onmouseover&quot;, &quot;this.className='hightlighrow'&quot;)
e.Row.Attributes.Add(&quot;onmouseout&quot;, &quot;this.className='normalrow'&quot;)
End If
End Sub
End Class</pre>
<h3>employees.xml</h3>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;employees&gt;
&lt;emp&gt;
&lt;name&gt;Abhishek Srivastab&lt;/name&gt;
&lt;designation&gt;Technical Head&lt;/designation&gt;
&lt;company&gt;Cognizant Solution&lt;/company&gt;
&lt;salary&gt;75,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Biswabhusan Panda&lt;/name&gt;
&lt;designation&gt;Project Manager&lt;/designation&gt;
&lt;company&gt;TATA Technology&lt;/company&gt;
&lt;salary&gt;86,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Sunanda Patnayak&lt;/name&gt;
&lt;designation&gt;Team Leader&lt;/designation&gt;
&lt;company&gt;Wipro&lt;/company&gt;
&lt;salary&gt;82,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Raghav Roy&lt;/name&gt;
&lt;designation&gt;Sr. UI Developer&lt;/designation&gt;
&lt;company&gt;Persistent System&lt;/company&gt;
&lt;salary&gt;61,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;/employees&gt;</pre>
<p>The post <a href="https://jharaphula.com/highlight-asp-net-gridview-selected-row/">On Mouseover how to Highlight ASP.NET Gridview Selected Row</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/highlight-asp-net-gridview-selected-row/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/gridview-alternate-rows.jpg" medium="image" />
	</item>
		<item>
		<title>How to Fetch Data from a XML File using ASP.NET Repeater Control?</title>
		<link>https://jharaphula.com/bind-xml-data-asp-net-repeater-control/</link>
					<comments>https://jharaphula.com/bind-xml-data-asp-net-repeater-control/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 08:25:20 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET Repeater Control]]></category>
		<category><![CDATA[Bind XML Data]]></category>
		<category><![CDATA[How to Bind XML?]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=927</guid>

					<description><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind-300x186.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind XML data to ASP.NET repeater control?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind-300x186.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To present data from several data source ASP.NET introduced controls like datagrid, datalist &#38; repeater. Compare to datagrid repeater is connection oriented &#38; gives faster...</p>
<p>The post <a href="https://jharaphula.com/bind-xml-data-asp-net-repeater-control/">How to Fetch Data from a XML File using ASP.NET Repeater Control?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind-300x186.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind XML data to ASP.NET repeater control?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind-300x186.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To present data from several data source ASP.NET introduced controls like datagrid, datalist &amp; repeater. Compare to datagrid repeater is connection oriented &amp; gives faster access to data. Inner logic of repeater is similar to pointer. During data bind for custom structure repeater control is very useful. In this example I created a demo app to display a <a href="https://jharaphula.com/learn-xml-online-tutorial-beginners/" target="_blank" rel="noopener noreferrer">XML</a> file data in tabular shape using ASP.NET repeater control.</p>
<h2>Fetch Data from a XML File</h2>
<p>In the below example I have a employees.xml file which contains name, designation, company &amp; salary of several employees. What I want is, I want to display these data in a HTML Table using ASP.NET repeater control. To achieve this in code-behind file &#8220;Default.aspx.vb&#8221; page_load event I am creating an instance of new DataSet as employeelog. Then using ReadXml() method I am assigning the XML file data to the DataSet employeelog. Later to bind these data in repeater control I pointed the repeater control DataSource to DataSet employeelog. Finally calling emplog.DataBind() to bind XML data.</p>
<p>Now in Default.aspx page I have my repeater control is with data. To show these data in particular table rows &amp; columns here I used &lt;%#Container.DataItem(&#8220;Respective Field Name&#8221;)%&gt; inside ItemTemplate of repeater control. To make each data rows user friendly here with ItemTemplate I used AlternatingItemTemplate with background color #e8e8e8.</p>
<h2>Data from a XML File using ASP.NET Repeater</h2>
<pre class="brush: xml; title: ; notranslate">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Default.aspx.vb&quot; Inherits=&quot;_Default&quot; %&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;How to bind XML data to ASP.NET repeater control?&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;frmRepeater&quot; runat=&quot;server&quot;&gt;
&lt;asp:Repeater id=&quot;emplog&quot; runat=&quot;server&quot;&gt;

&lt;HeaderTemplate&gt;
&lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Employee Name&lt;/th&gt;
&lt;th&gt;Designation&lt;/th&gt;
&lt;th&gt;Company&lt;/th&gt;
&lt;th&gt;Monthly Salary&lt;/th&gt;
&lt;/tr&gt;
&lt;/HeaderTemplate&gt;

&lt;ItemTemplate&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;name&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;designation&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;company&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;salary&quot;)%&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/ItemTemplate&gt;

&lt;AlternatingItemTemplate&gt;
&lt;tr bgcolor=&quot;#e8e8e8&quot;&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;name&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;designation&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;company&quot;)%&gt; &lt;/td&gt;
&lt;td&gt;&lt;%#Container.DataItem(&quot;salary&quot;)%&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/AlternatingItemTemplate&gt;

&lt;FooterTemplate&gt;
&lt;/table&gt;
&lt;/FooterTemplate&gt;

&lt;/asp:Repeater&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Default.aspx.vb</h3>
<pre class="brush: vb; title: ; notranslate">Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim employeelog = New DataSet
employeelog.ReadXml(MapPath(&quot;employees.xml&quot;))
emplog.DataSource = employeelog
emplog.DataBind()
End If
End Sub
End Class</pre>
<h2>XML File to Fetch Data (employees.xml)</h2>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;employees&gt;
&lt;emp&gt;
&lt;name&gt;Sujata Panigraphi&lt;/name&gt;
&lt;designation&gt;Chief Business Officer&lt;/designation&gt;
&lt;company&gt;Infosys&lt;/company&gt;
&lt;salary&gt;92,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Abhishek Srivastab&lt;/name&gt;
&lt;designation&gt;Technical Head&lt;/designation&gt;
&lt;company&gt;Cognizant Solution&lt;/company&gt;
&lt;salary&gt;75,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Biswabhusan Panda&lt;/name&gt;
&lt;designation&gt;Project Manager&lt;/designation&gt;
&lt;company&gt;TATA Technology&lt;/company
&lt;salary&gt;86,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Sunanda Patnayak&lt;/name&gt;
&lt;designation&gt;Team Leader&lt;/designation&gt;
&lt;company&gt;Wipro&lt;/company&gt;
&lt;salary&gt;82,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Raghav Roy&lt;/name&gt;
&lt;designation&gt;Sr. UI Developer&lt;/designation&gt;
&lt;company&gt;Persistent System&lt;/company&gt;
&lt;salary&gt;61,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;John Markoni&lt;/name&gt;
&lt;designation&gt;QA Developer&lt;/designation&gt;
&lt;company&gt;Intel Corporation&lt;/company&gt;
&lt;salary&gt;32,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Megha Srivastab&lt;/name&gt;
&lt;designation&gt;HTML5 Developer&lt;/designation&gt;
&lt;company&gt;Synechron Technologies&lt;/company&gt;
&lt;salary&gt;22,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Manjulata Panda&lt;/name&gt;
&lt;designation&gt;Sr. UI Developer&lt;/designation&gt;
&lt;company&gt;Dell Technology&lt;/company&gt;
&lt;salary&gt;72,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Bidyadhara Panda&lt;/name&gt;
&lt;designation&gt;Sr. Oracle Developer&lt;/designation&gt;
&lt;company&gt;InfoSys BPO&lt;/company&gt;
&lt;salary&gt;45,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;emp&gt;
&lt;name&gt;Sinha Malhotra&lt;/name&gt;
&lt;designation&gt;Front-end Developer&lt;/designation&gt;
&lt;company&gt;ESSPL&lt;/company&gt;
&lt;salary&gt;32,000&lt;/salary&gt;
&lt;/emp&gt;
&lt;/employees&gt;</pre>
<p>The post <a href="https://jharaphula.com/bind-xml-data-asp-net-repeater-control/">How to Fetch Data from a XML File using ASP.NET Repeater Control?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/bind-xml-data-asp-net-repeater-control/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/repeater-control-data-bind.jpg" medium="image" />
	</item>
		<item>
		<title>RC2, MD5, Triple Des, Byte, 128 Cryptography functions</title>
		<link>https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/</link>
					<comments>https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Thu, 12 May 2016 15:29:11 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[128 Cryptography functions]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[RC2]]></category>
		<category><![CDATA[Triple Des]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=410</guid>

					<description><![CDATA[<img width="300" height="168" src="https://jharaphula.com/wp-content/uploads/2016/05/Cryptography-300x168.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="RC2, MD5, Triple Des, Byte, 128 Cryptography functions" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Cryptography-300x168.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Cryptography.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Security is a key in Information Technologies. From banking to insurance domain every where we want our data to be safe. In web technologies security...</p>
<p>The post <a href="https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/">RC2, MD5, Triple Des, Byte, 128 Cryptography functions</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="168" src="https://jharaphula.com/wp-content/uploads/2016/05/Cryptography-300x168.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="RC2, MD5, Triple Des, Byte, 128 Cryptography functions" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Cryptography-300x168.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Cryptography.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Security is a key in Information Technologies. From banking to insurance domain every where we want our data to be safe. In web technologies security is a major factor. Looking into this Microsoft provides Cryptography in their <a href="https://jharaphula.com/category/programming-solutions/" rel="noopener noreferrer" target="_blank">advanced programming languages</a> .NET Framework. There are several types of encryption &amp; decryption available in the chapter of Cryptography. The most common used Cryptography functions are RC2, MD5, Triple Des, 128 Encryption &amp; Byte.</p>
<p>In the area of day today developments programmers are looking for a ready-made function to encrypt or decrypt their strings. To start with Cryptography Microsoft provides the base Class System.Security.Cryptography. You need to import this System Class before using the following functions. Here with I am sharing the functions how to encrypt or decrypt a string using vb.net. With these functions you can easily encrypt or decrypt a string to RC2, MD5, 128 &amp; Byte format. Enjoy the programming.</p>
<h3>Cryptography function to encrypt a String</h3>
<pre class="brush: vb; title: ; notranslate">Public Function EncodeString(ByVal value As String, ByVal key As String) As String
Dim crdes As New System.Security.Cryptography.TripleDESCryptoServiceProvider
crdes.IV = New Byte(7) {}
Dim pdb As New System.Security.Cryptography.PasswordDeriveBytes(key, New Byte(-1) {})
crdes.Key = pdb.CryptDeriveKey(&quot;RC2&quot;, &quot;MD5&quot;, 128, New Byte(7) {})
Dim ms As New IO.MemoryStream((value.Length * 2) - 1)
Dim encStream As New System.Security.Cryptography.CryptoStream(ms, crdes.CreateEncryptor(), System.Security.Cryptography.CryptoStreamMode.Write)
Dim plainBytes As Byte() = Text.Encoding.UTF8.GetBytes(value)
encStream.Write(plainBytes, 0, plainBytes.Length)
encStream.FlushFinalBlock()
Dim encryptedBytes(CInt(ms.Length - 1)) As Byte
ms.Position = 0
ms.Read(encryptedBytes, 0, CInt(ms.Length))
encStream.Close()
Return Convert.ToBase64String(encryptedBytes)
End Function</pre>
<h3>Cryptography function to decrypt a String</h3>
<pre class="brush: vb; title: ; notranslate">Public Function DecodeString(ByVal value As String, ByVal key As String) As String
Dim crdes As New System.Security.Cryptography.TripleDESCryptoServiceProvider
crdes.IV = New Byte(7) {}
Dim pdb As New System.Security.Cryptography.PasswordDeriveBytes(key, New Byte(-1) {})
crdes.Key = pdb.CryptDeriveKey(&quot;RC2&quot;, &quot;MD5&quot;, 128, New Byte(7) {})
Dim encryptedBytes As Byte() = Convert.FromBase64String(value)
Dim ms As New IO.MemoryStream(value.Length)
Dim decStream As New System.Security.Cryptography.CryptoStream(ms, crdes.CreateDecryptor(), System.Security.Cryptography.CryptoStreamMode.Write)
decStream.Write(encryptedBytes, 0, encryptedBytes.Length)
decStream.FlushFinalBlock()
Dim plainBytes(CInt(ms.Length - 1)) As Byte
ms.Position = 0
ms.Read(plainBytes, 0, CInt(ms.Length))
decStream.Close()
Return Text.Encoding.UTF8.GetString(plainBytes)
End Function</pre>
<p>The post <a href="https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/">RC2, MD5, Triple Des, Byte, 128 Cryptography functions</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/rc2-md5-byte-128-cryptography-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/Cryptography.jpg" medium="image" />
	</item>
	</channel>
</rss>
