RSSCategory: C#

Concatenate strings in .aspx page

| November 5, 2011 | 0 Comments

Problem I am trying to set label value dynamically in .aspx page. Additionally I need to concatenate strings in the .aspx page. Solution We would need to use string.Concat() function for same. Here is solution for concatenating string values in .aspx page: Code Snippet for .aspx: Above code results in string as http://80Hello.

Continue Reading

Apply Style to ListItem in List Controls

| December 26, 2010 | 0 Comments

We can apply CSS class or styles to our List Controls (CheckBoxList, RadioButtonList, DropDownList and ListBox). But there is no way to add or apply style to ListItem within them in .aspx. So this article deals with how to add attributes to ListItems in all ListControls. We would apply required style or attributes at runtime […]

Continue Reading

Image in TextBox & RichTextBox

| December 25, 2010 | 0 Comments

This article deals with how to show Image in TextBox and RichTextBox control. I googled for same but found little or was too complex to implement as per my understanding. Well! The noteworthy point is that in either of methods shared here uses alternative solution. There is no such direct way to do. Second thing is […]

Continue Reading

Update database from DataGridView

| December 21, 2010 | 0 Comments

Most of time developer want their users to be able to update database from DataGridView in Window Forms. So this article deals with concept of how to update tables in database from DataGridView. The main task of updating database is done with the help of System.Data.SqlClient.SqlDataAdapter.Update() method.  System.Data.SqlClient.SqlCommandBuilder generates required command for SqlDataAdapter when Select […]

Continue Reading

How to access controls within User Control

| December 20, 2010 | 7 Comments

This article helps you to know step-by-step how to access controls within User Control from Asp.Net Page. 1. For this we would need to register our UserControl in Asp.Net Page. Code Snippet for UserControl: 2. And then in .aspx.cs page we can find the control within user control and caste it accordingly to use further in […]

Continue Reading

Modify MessageBox by MessageBoxManager

| December 18, 2010 | 0 Comments

You want to modify your default System.Windows.Forms.MessagBox look. You want to modify its fonts or its own size. In all you want to modify its appearance. And sometimes you wish to modify or change its functionality to some extent. Well … then there is some good news for you. But its not from Microsoft and […]

Continue Reading

Capture screen image by Screen shot in C#

| August 10, 2010 | 0 Comments

As the name suggests you can take screenshot by application Screen shot !!! Pre-Requisites Visual Studio 2005 or more .NET Framework 2.0 Concepts Covered Dynamic creation of Image on basis of Screen (represents Display Device) width and height. Handling most general error The process  cannot access  the file because it is being used by another  […]

Continue Reading

Display Image instead of CheckBox in DataGridView

| July 31, 2010 | 6 Comments

Well! I am not so much expert about the Window Controls. But sometimes we get stuck by problem which seems to easy. I tried lot on internet but I didn’t get solution as I wanted. After spending three to four hours ( yes it’s true) I found a solution which is working fine. So what’s […]

Continue Reading

' AND t.term_id = 32 LIMIT 1 62 | 0.0005 | enabled | not cached | 897 | SELECT tr.object_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('nav_menu') AND tt.term_id IN ('32') ORDER BY tr.object_id ASC 63 | 0.0006 | enabled | not cached | 11135 | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (225,226,227,228,229) AND wp_posts.post_type = 'nav_menu_item' AND ((wp_posts.post_status = 'publish')) ORDER BY wp_posts.menu_order ASC 64 | 0.0004 | enabled | not cached | 2087 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (226) ORDER BY meta_id ASC 65 | 0.0004 | enabled | not cached | 2087 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (229) ORDER BY meta_id ASC 66 | 0.0004 | enabled | not cached | 2087 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (227) ORDER BY meta_id ASC 67 | 0.0004 | enabled | not cached | 2087 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (225) ORDER BY meta_id ASC 68 | 0.0005 | enabled | not cached | 2087 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (228) ORDER BY meta_id ASC 69 | 0.0007 | enabled | not cached | 4495 | SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') AND t.term_id IN ( 4,8,9,2,3 ) ORDER BY t.name ASC 70 | 0.0346 | enabled | not cached | 3608 | SELECT * FROM wp_users WHERE ID = '1' 71 | 0.0386 | enabled | not cached | 8422 | SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1) ORDER BY umeta_id ASC 72 | 0.0006 | enabled | not cached | 698 | SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 2 AND (wp_posts.post_mime_type LIKE 'image/%') AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit')) ORDER BY wp_posts.menu_order ASC, wp_posts.ID ASC LIMIT 0, 1 73 | 0.0002 | enabled | not cached | 529 | SELECT option_value FROM wp_options WHERE option_name = 'disabled_likes' LIMIT 1 74 | 0.0003 | enabled | not cached | 7984 | SELECT * FROM wp_posts WHERE ID = 63 LIMIT 1 75 | 0.0002 | enabled | not cached | 2200 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (63) ORDER BY meta_id ASC 76 | 0.0004 | enabled | not cached | 8020 | SELECT * FROM wp_posts WHERE ID = 71 LIMIT 1 77 | 0.0005 | enabled | not cached | 2073 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (71) ORDER BY meta_id ASC 78 | 0.0003 | enabled | not cached | 8041 | SELECT * FROM wp_posts WHERE ID = 81 LIMIT 1 79 | 0.0005 | enabled | not cached | 2185 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (81) ORDER BY meta_id ASC 80 | 0.0006 | enabled | not cached | 698 | SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 8 AND (wp_posts.post_mime_type LIKE 'image/%') AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit')) ORDER BY wp_posts.menu_order ASC, wp_posts.ID ASC LIMIT 0, 1 81 | 0.0006 | enabled | not cached | 698 | SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 9 AND (wp_posts.post_mime_type LIKE 'image/%') AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit')) ORDER BY wp_posts.menu_order ASC, wp_posts.ID ASC LIMIT 0, 1 82 | 0.0004 | enabled | not cached | 8029 | SELECT * FROM wp_posts WHERE ID = 176 LIMIT 1 83 | 0.0004 | enabled | not cached | 2182 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (176) ORDER BY meta_id ASC 84 | 0.0003 | enabled | not cached | 8061 | SELECT * FROM wp_posts WHERE ID = 180 LIMIT 1 85 | 0.0004 | enabled | not cached | 2213 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (180) ORDER BY meta_id ASC 86 | 0.0016 | enabled | not cached | 3065 | SELECT p.ID AS 'id', p.post_title AS 'title', p.post_date AS 'date', p.post_author AS 'uid', ( SUM(v.pageviews)/(IF ( DATEDIFF('2015-10-14 03:27:56', DATE_SUB('2015-10-14 03:27:56', INTERVAL 1 WEEK)) > 0, DATEDIFF('2015-10-14 03:27:56', DATE_SUB('2015-10-14 03:27:56', INTERVAL 1 WEEK)), 1) ) ) AS 'avg_views' FROM wp_popularpostssummary v LEFT JOIN wp_posts p ON v.postid = p.ID WHERE 1 = 1 AND p.post_type IN('post','page') AND v.last_viewed > DATE_SUB('2015-10-14 03:27:56', INTERVAL 1 WEEK) AND p.post_password = '' AND p.post_status = 'publish' GROUP BY v.postid ORDER BY avg_views DESC LIMIT 5; 87 | 0.0002 | enabled | not cached | 11898 | SELECT * FROM wp_posts WHERE ID = 1 LIMIT 1 88 | 0.0005 | enabled | not cached | 11284 | SELECT * FROM wp_posts WHERE ID = 17 LIMIT 1 89 | 0.0005 | disabled (query) | not cached | 0 | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 5 90 | 0.0001 | disabled (query) | not cached | 0 | SELECT FOUND_ROWS() 91 | 0.0003 | enabled | not cached | 22115 | SELECT wp_posts.* FROM wp_posts WHERE ID IN (353,339,3) 92 | 0.0009 | enabled | not cached | 5627 | SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format') AND tr.object_id IN (3, 339, 353) ORDER BY t.name ASC 93 | 0.0007 | enabled | not cached | 7914 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (3,339,353) ORDER BY meta_id ASC 94 | 0.0398 | enabled | not cached | 7307 | SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,100) AS com_excerpt FROM wp_comments LEFT OUTER JOIN wp_posts ON (wp_comments.comment_post_ID = wp_posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5 95 | 0.0004 | enabled | not cached | 10061 | SELECT * FROM wp_posts WHERE ID = 15 LIMIT 1 96 | 0.0005 | enabled | not cached | 14705 | SELECT * FROM wp_posts WHERE ID = 42 LIMIT 1 97 | 0.0006 | enabled | not cached | 2074 | SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC 98 | 0.0003 | enabled | cached | 4714 | SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') ORDER BY t.name ASC 99 | 0.0009 | enabled | not cached | 8853 | SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('post_tag') AND tt.count > 0 ORDER BY tt.count DESC LIMIT 200 100 | 0.0004 | enabled | not cached | 3470 | SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'nav_menu' AND t.term_id = 33 LIMIT 1 101 | 0.0006 | enabled | not cached | 946 | SELECT tr.object_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('nav_menu') AND tt.term_id IN ('33') ORDER BY tr.object_id ASC 102 | 0.0006 | enabled | not cached | 11910 | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (231,232,234,244,289,306) AND wp_posts.post_type = 'nav_menu_item' AND ((wp_posts.post_status = 'publish')) ORDER BY wp_posts.menu_order ASC 103 | 0.0003 | enabled | not cached | 2109 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (234) ORDER BY meta_id ASC 104 | 0.0004 | enabled | not cached | 2092 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (231) ORDER BY meta_id ASC 105 | 0.0004 | enabled | not cached | 2086 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (232) ORDER BY meta_id ASC 106 | 0.0004 | enabled | not cached | 2086 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (289) ORDER BY meta_id ASC 107 | 0.0003 | enabled | not cached | 2086 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (244) ORDER BY meta_id ASC 108 | 0.0003 | enabled | not cached | 2086 | SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (306) ORDER BY meta_id ASC 109 | 0.0007 | enabled | not cached | 26416 | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (207,209,279,239,301) AND wp_posts.post_type = 'page' AND ((wp_posts.post_status = 'publish')) ORDER BY wp_posts.post_date DESC -->