Engineering

How to programmatically create iFrame in ASP.NET

Sometimes we may need to create iFrames and use it within GridView or Repeater, and we want to pass some values to it.This example will show you how to create iFrame Programmatically and add it to a PlaceHolder.HtmlGenericControl myFrame = new HtmlGenericControl();myFrame.TagName = "IFRAME"; myFrame.Attributes["src"] = "MyPagePath"; myFrame.Attributes["id"] = "myFrame1"; myFrame.Attributes["name"] = "myFrame1"; myFrame.Attributes["width"] =...

Operation is not valid due to the current state of the object exception in ASP.NET

I got this error when I tried to save a Page with lots of form fields to SQL Server Database.The default max number of form fields that can be post is 1000.In order to solve this error add this Line to your Web.Config File:<appSettings> <add key="aspnet:MaxHttpCollectionKeys" value="10000" /> </appSettings>

How to convert SqlDataSource to DataTable and DataView in C#.NET

Sometimes I want to use SqlDataSource  returned data programmatically and here is how you can do this,In this example I will assume that SqlDataSource  ID is SqlDataSource1 which is the default ID:DataSourceSelectArguments args = new DataSourceSelectArguments(); DataView view = SqlDataSource1.Select(args) as DataView; DataTable dt = view.ToTable();

JavaScript regular expression to match a comma delimited list

This method uses the JavaScript String's match() method to parse a comma delimited list and show its content in a Panel control.You can try it here http://jsfiddle.net/38tXU/function parseList(list) { var reg = list.match(/\w+(,\w+)*/g); document.getElementById('pnl').innerHTML = 'Total length:' + reg.length + '<br />'; ...

Difference between inner and outer join in SQL

Joins are used to combine the data from two tables, with the result being a new, temporary table.The temporary table is created based on column(s) that the two tables share, which represent meaningful column(s) of comparison.The goal is to extract meaningful data from the resulting temporary table.Joins are performed based...

How to check SQL Server database is exists using C#.NET

The following method using sys. schema and views such as sys.databases and sys.tables.As we know that the old style sysobjects and sysdatabases and those catalog views have been deprecated since SQL Server.private static bool CheckDatabaseExists(string connectionString, string databaseName) { string sqlQuery; bool result = false; try ...