Posts

Showing posts from February, 2016

Edit code while application is debugging or run in visual studio

Go to debug tab --> Options and Settings --> Debugging --> Edit and Continue --> uncheck (Enable Edit and Continue)

Drop Down List item add in 0 index

ddlCategory.Items.Insert() have two overloads 1- define index,you can define value with item name by (ListItem) that is the simple code to add item of zero index in drop down list:     ddlCategory.Items.Insert(0, new ListItem("--Select Category--","0"));         ddlCategory.SelectedIndex = 0; 2- define index, only allowed to add item name like string

ConfigurationManager ConnectionStrings not available in c#

ConfigurationManager not show ConnectionStrings until you will not add reference System.Configuration dll, right click on Project -- Add Reference after click to Assemblies then Framework and find System.Configuration dll vs2010: Project -- Add Reference after click to .NET components and find System.Configuration dll If also add this reference but then again its not showing its a simple way to solve you add System.Configuration.ConfigurationManager.ConnectionStrings

Fatal error cygwin1.dll not found

Solved: The repository clone from source tree the following error occurred   cygwin1.dll missing errors or not found Reinstalling the source tree its fix this problem.

Find item in dropdownlist using jquery

var contain = false; $('#dropdownlist option').each(function(){     if (this.value == 'item-name') {         contain = true;         return false;     } });

Insert collection of data to sql table using c#

insert collection of data in SQL table is called bulk data manipulations, this is the simple and best way to add multiple row with the single collection now define a step's to easy to understand 1- You make a user defined table types  CREATE TYPE [dbo].[TTMultiRowCollection] AS TABLE(     [ID] [int] NULL,     [Name] [varchar(50)] NULL, ) 2- Create SP and take parameter table type as well as READONLY keyword. CREATE PROCEDURE [dbo].[AddMultiRow](@MultiRowCollection TTMultiRowCollection READONLY) AS BEGIN     INSERT INTO [User](ID,Name)         SELECT ID, Name FROM @MultiRowCollection END 3-  Create table in c# for passing the sql DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Rows.Add(1, "Dawood"); table.Rows.Add(2, "Ahmed"); 4- Connect to SQL server and passing the table from stored procedure  us...

how to get last primary key in sql

Solved: If you want to get last primary key id instead of Max() aggregate function: IDENT_CURRENT('dbo.TableName') this is the best method to get last primary key id this is helpful for logic's

HTTP Error 500.19 Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid. Solved: Mostly 500 error occurred to three problems 1- Framework version not set according to the website 2- Permission the required folder 3- Directory not set to website where is located -- (cannot read configuration file)

How to use four clause in one query

Get records using with joins, where,group by, having and order by clauses FROM & JOINs determine & filter the selected rows WHERE more filters on the rows to desire columns GROUP BY combines those rows into groups like 1,1,1,2,2,3 result: 1,2,3 HAVING filters groups using to aggregate functions ORDER BY arranges the remaining rows/groups to order wise ascending or descending order

Get all rack according to shelf but books should not contain any position

select ri.RackID,ri.RackNo from RackInfo ri where ri.shelfID = 5 group by ri.RackID having (select Count(*) from fnGetPostionByRack(5,ri.RackNo,1)) > 0 so given some error any one can help me Column 'RackInfo.RackNo' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.