.NET

...now browsing by category

 

jQuery for a ASP.NET Developer

Wednesday, November 30th, 2011

I have been following Dave Ward’s posts on Encosia for a very long time. He’s one of the few developers who actively posts several useful tricks/solutions for ASP.NET developers.

Today, I came across his latest post where he is attempting to list all the posts that he has ever written on jQuery for the ASP.Net Developer. If you ever need a reference point for using jQuery in your projects then please refer to Dave’s post here: http://encosia.com/jquery-for-the-asp-net-developer/

Written by Deepak Vasa - Visit Website

How to setup jQuery Intellisense in VS 2008

Wednesday, November 26th, 2008

Title says it all. Refer to Scotts post here:

http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx

Written by Deepak Vasa - Visit Website

LINQ to SQL – Not Dead

Monday, November 3rd, 2008

For those who are not aware, last week there has been some misunderstanding regarding the future of LINQ to SQL based on announcements made by MS at PDC. Well after reading a few blogs around the Blogosphere I have come accross the following posts which explain that there is future for L2S:

Read Damien Guard’s blog ->http://damieng.com/

Read Huagati’s Blog -> http://blog.huagati.com/res/index.php/2008/11/03/quiet-blog-gone-fishing-is-linq-to-sql-dead-etc/

Further I found this cool image supporing L2S here

Long live LINQ to SQL !!!

Long live LINQ to SQL !!!

Written by Deepak Vasa - Visit Website

LINQ query to get all the column names in the DBML tables

Friday, October 31st, 2008

// LINQ query to get all the column names for every Table
var model = new AttributeMappingSource().GetModel(typeof(ReportDBMLClassesDataContext));
int i = 0;
ArrayList lblList = new ArrayList();
foreach (var mt in model.GetTables())
{
i++;
Label lbl = new Label();
lbl.Text = mt.TableName.ToString();
lbl.ID = “lbl” + i;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(new LiteralControl(“<br>”));
int r = 0;
foreach (var dm in mt.RowType.DataMembers)
{
r++;
Label rlbl = new Label();
rlbl.Text = dm.MappedName.ToString();
rlbl.ID = “rlbl” + i + “” + r;
Panel1.Controls.Add(rlbl);
Panel1.Controls.Add(new LiteralControl(“<br>”));
}
}

Written by Deepak Vasa - Visit Website

Dynamic Data Entities Web Application

Monday, August 25th, 2008

Today, I started playing with the new Visual Studio 2008 Service Pack 1. The download was massive (800mb) and installer wanted 4 gb free, so as a few people around the web have been saying it is almost like a new release (read Visual Studio 2009).

Any ways, coming back to the Dynamic Data Entities, I first saw a glimpse of this feature in Sql Sever 2008 presentation (read my prev. post), and was thinking this is cool, so gave it a go…It was simple in VS 2008 with SP1 you basically go to File > New > and chose ‘Dynamic Data Entities WebApplication’ project; VS gives us the usual web application template along with a new folder called “DynamicData” and this folder contains all the files required to generate dynamic data drive web application. Next click on Add New > ADO.NET Entity Data Model and follow the steps in the wizard. At the end of this step you will have a simple Entity model of the various table from the SQL Server.

With the entity model in place all we have to do now is edit the Global.asax file and read the instructions which are in the comments. I have put in the name of my model and chose true for ScaffoldAllTables.

model.RegisterContext(typeof(MyEntities), new ContextConfiguration() { ScaffoldAllTables = true });

With that step done…did the build and lo..and behold you get this simple interface which lists all the tables in the model and gives the user the ability to page thru the data in each table by rendering the data in Grid View and gives the options to perform CRUD (Create/Read/Update/Delete) operations. The cool thing is till now I haven’t done any code except for editing the above one line.

Search Feature

This is one thing that is currently missing in the entity driven web app. Currently I am investigating how I can implement this feature. If any of you know how, please let me know.

Written by Deepak Vasa - Visit Website