Remove strings between double quotes


How many times you have to bullet proof your application against some bad or junk data ? Sometimes we might not have anticipated some scenario until quite a while. And this can quite possible if your application relies on some other program ( data from web service, some sort of incoming XML or something like that )

Well LINQ is your friend !

Just a heads up :

Going forward I shall try to maintain all string manipulation related posts ALSO under ‘string-manipulation‘ tag, just if that helps you drill down the content better. Cheers ! 😉

Continue reading Remove strings between double quotes

Advertisements

Quickly Clean-up Blank lines from a multi-line String


Scenario : At the time of consuming data from another application or program, one of the frequent issue is data in and data out ! I was working for similar scenario the other day where a flat was generated and then another program had lexical parser and would generate tokens etc. Long story short, in a typical workflow we had blank lines and they were causing issue. Very simple issue … once this stupid thing is identified and verified being the actual culprit !

Let’s take a look :

Continue reading Quickly Clean-up Blank lines from a multi-line String

C#


Below are some code snippets / recipes that I have had prepared for myself and I thought of sharing with ya’ll as a firs post in C# category. If you do not find one that you are looking for or want more, just drop me a request or comment below, I’d try to address the request.

Example Description Download
Global Variables in C# Different scenarios as your requirement and need zip
Text to SQL Server Read a text file and insert all records in SQL Server. zip
Update combobox items according to selection of column-name in other combobox zip
MySQL(SQL Server) To MsAccess Copy table of Ms-Access from the data of the MySQL zip
(Basic) Reading Ms-Excel spreadsheets Reading data from Excel sheets using C# zip
Updating Ms-Excel spreadsheets Updating data of Excel sheets using C# zip
Accessing .config file The app.config can be used to access some setings (like conn string) anywhere in the project zip
MySQL (SQL Server) database to CSV Convert record set from MySQL query to csv file zip
String Delimiter Various illustrations in a single project, demonstrating ways to use the String.Split() function zip
Date – Times Gets the beginning and ending dates of

  • This Week
  • Last Week
  • This Month
  • Last Month
  • Last 6 Months
  • This Year
  • Last 3 Years
zip
Update/Delete CSV Here is the work around for Updating / Deleting records from CSV, which usually is just a file IO operation otherwise zip
json json in C# using JSON .NET & LINQ zip
json serialization serialization/de-serialization of json zip
Stateful iterations By using yield keyword, difference b/w IEnumerable and IEnumerator zip

Unobtrusive validation from scratch in ASP.Net 4.5 WebForms


Jupaol’s blog post

Free Web based IIS like manager


http://servant.io/

http://blog.servant.io/

ASP.NET


Below are some code snippets that I have prepared initially, if you do not find one that you are looking for, just [ drop me an E-mail ] or just a comment below would suffice. Also please note that a demo illustrated in SQL server should also work with MySQL & vice-versa.
Example Description Download
Populate gridview programmatically using MySQL Loading the gridview programmatically using C# from database zip
Gridview with a drop-down filter in the header Filter your gridview with a drop down in the table header zip
Adding controls on the fly in GridView (Esp. with custom user control,) add hyper-link check-boxes dynamically zip
Paging & Sorting in Gridview Programmatically handle paging and sorting events of gridview zip
Insert/Update/Delete using Button field of the DataGridView(Accessing the cell values of the row containing the button clicked) if you want to retrieve the cell values of the row after the button from that row has clicked and to fire database queries zip
Export Gridview to … MS ACCESS / MS EXCEL / CSV zip
Combobox hard-coded values & Database records to gather Loading a combobox, with static items as well as items from database zip
Sending plain text E-mail message from web app to Gmail You can specify from, password, to, subject and message to send an email zip
Caching 1 Simple Page Level Caching zip
Caching 2 Caching SQL Server Caching for certain amount of time zip
Caching 3 SQLServer Automated Caching and Updating Cached version at Regular Intervals and upon Create/Update/Delete operations zip
Caching 4 Partial Page Caching, Multiple & Multi-Level Page caching and … Clearing the cache zip
Shortening GUID Sometimes we want to get the shortest GUID for building URLs or for dynamic file names, So I created a slight variant of GUID zip
Parsing Uri (Query Params) When one has the URL of the page from which QueryParams are wanted but can not use Request.QueryString (when the URL is not of current page, stored in a object in a memory etc) zip
Nested GridViews A basic example of how a grid can become a part of data row of some master table (master – grid ) zip
Nested GridViews + Conditional Formatting Apply conditional formatting to your nested grid zip
Filter DataGrid w/ LINQ An example demonstrating how LINQ can be used to filter out the data from the Data Grid zip
Gridview : JavaScript/jQuey to databing + filter An example demonstrating how to bind data to Gridview using Client Side Script + filtering ( filter as you type ) zip
Nested GridVeiw A gridview inside a gridview zip
Nested Gridview Nested Expandable & Collapsible Gridview (Same Row) zip
Nested Gridview Nested Expandable & Collapsible Gridview (Next Row) zip
Signal R Move Shape + Group Discussion / Chat + etc … zip
G.Drive Spreadsheets Access Google-SpreadSheet Via Gdata And C# zip
Parameter Parsing Parsing parameters from query string zip
Short GUID Get Short (& sweet) : unique strings, unique, not random chars as random may not be unique zip
String Float Double InterConversion zip
2D Array To-String And Vice-Versa zip
Async GridView (Take # 1) Loading the data for the gridview asynchronously from database

  • Poll Approach
  • Wait Approach
zip
CSV to Gridview A sample web app demonstrating how to load gridview from multiple CSV dynamically (one at a time) zip
Crystal Report : Dynamic Binding Conditional Data-binding from multiple tables, after the report has been loaded zip

Repository Index


I am going to share all the code snippets that I have. At the moment, this page is being updated, every, single, day. You can download most of the archives from here, at once.

C#
Most posts in this section would be describing Mid to advanced level of features of C#, mainly as
a console application [View]
ASP.NET
Most posts in this section would be describing Mid to advanced level of features of ASP.NET / C# ,
mainly as simple web projects [View]
LINQ
Mostly in this section would be describing features of LINQ, mainly as a C# console application [View]
API / SDK
Mostly in this section would be describing features of in-demand tools & libraries like TFS, twitter, facebook, using C# mainly [View]
Modern Web & Windows App
Most posts in this section would be describing javascript/HTML 5 – CSS 3 for Web Apps and/or Windows Store Apps [View]
telerik ASP.NET AJAX Controls
This section would be talking about ASP.NET AJAX Controls in, code snippets.
Windows Phone
Most posts in this section would be describing Windows Phone, Applications

Management


Muttitasking is a myth, The only type of multi tasking I know is to think about a problem and then to sleep ! Many of the times I hear people talking, “I can multi task” well most of the times it actually is not it, but just “task switching”. You know it probably is 3:30 pm and you’re so deep and concentrated on your task, coding, designing, reading, planning whatever may it be, and then all of a sudden your phone rings, if you notice carefully, you’re dumping the thought process of your current task and answering the call, ( chances are less that you’d continue “multi tasking” and you’d be doing both them well ! ) What could you’ve done ? You could’ve probably asked your phone to keep mum !

The way I start my day is I ask my self what N ( = 3 ) things I want to accomplish today ? Then visualize those things getting accomplished, just imagine, how good would I feel if these N things get done today. Then what I do ?  Continue reading Management