Tuesday, May 25, 2010

Domain Knowledge

http://msdn.microsoft.com/en-us/library/aa137855(v=MSDN.10).aspx

Industry

* Communications
* Financial Services
* Healthcare and Health Plans
* Manufacturing and Retail


code samples

http://msdn.microsoft.com/en-us/library/bb931739(v=office.12).aspx

share point

http://msdn.microsoft.com/en-us/sharepoint/default.aspx

http://technet.microsoft.com/en-us/sharepoint/default.aspx

videos

http://technet.microsoft.com/hi-in/sharepoint/ff677987(en-us).aspx

Saturday, May 22, 2010

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Record

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Record

SELECT @@IDENTITY
It returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value.
@@IDENTITY will return the last identity value entered into a table in your current session. While @@IDENTITY is limited to the current session, it is not limited to the current scope. If you have a trigger on a table that causes an identity to be created in another table, you will get the identity that was created last, even if it was the trigger that created it.

SELECT SCOPE_IDENTITY()
It returns the last IDENTITY value produced on a connection and by a statement in the same scope, regardless of the table that produced the value.
SCOPE_IDENTITY(), like @@IDENTITY, will return the last identity value created in the current session, but it will also limit it to your current scope as well. In other words, it will return the last identity value that you explicitly created, rather than any identity that was created by a trigger or a user defined function.

SELECT IDENT_CURRENT(‘tablename’)
It returns the last IDENTITY value produced in a table, regardless of the connection that created the value, and regardless of the scope of the statement that produced the value.
IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope.

To avoid the potential problems associated with adding a trigger later on, always use SCOPE_IDENTITY() to return the identity of the recently added row in your T SQL Statement or Stored Procedure.

Friday, May 14, 2010

mvc

http://www.learn-mvc.blogspot.com/

ModalPopupExtender Example for Editing Rows in a GridView (Master/Detail Scenario)

http://mattberseth.com/blog/2007/07/modalpopupextender_example_for.html

http://mattberseth2.com/thickbox_master_detail/default.aspx(edititemtemplate)

displaying a picture in an image control from stream??(FROM ASP.NET)

http://www.revenmerchantservices.com/page/asp-net-image-upload.aspx

test

http://runtingsproper.blogspot.com/2010/03/could-not-load-type.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+RunTingsProper+(Run+Tings+Proper)

Thursday, May 13, 2010

Gridview tips_Tricks

#Export Gridview to xls

The below code will export the gridview contents to the excel file


protected void Button1_Click(object sender, EventArgs e)
{
Response.AddHeader("content-disposition", "attachment;filename=ExportData.xls");
Response.Charset = String.Empty;
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter strWr = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmWr = new HtmlTextWriter(strWr);
GridView1.RenderControl(htmWr);
Response.Write(strWr.ToString());
Response.End();
}




#Summary in the footer of the gridview
To display the summary in the footer of the gridview , try the following code.


decimal priceTotal = 0;
int quantityTotal = 0;
void detailsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// add the UnitPrice and QuantityTotal to the running total variables
priceTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"UnitPrice"));
quantityTotal += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, _
"Quantity"));
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[0].Text = "Totals:";
// for the Footer, display the running totals
e.Row.Cells[1].Text = priceTotal.ToString();
e.Row.Cells[2].Text = quantityTotal.ToString();

e.Row.Cells[1].HorizontalAlign = _
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Right;
e.Row.Font.Bold = true;
}
}






#Confirmation message on button click in GridView


To ask the user for the confirmation message on the button click, try the below code









#Change the back color of a GridView Row based on some condition

To change the gridview row color based on some conditions on record, try the below code









---
---
---



protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl = (Label)e.Row.Cells[1].FindControl("lblFlagNew");
if (lbl.Text == "True")
{
e.Row.BackColor = System.Drawing.Color.Red;
}
else
{
e.Row.BackColor = System.Drawing.Color.Black;
}
}
}


#Alternative rows back color in gridview


To display the gridview with alternative rows back color, try the below code


----
----
----
----


you can also use css class , try the below code



----
----
----
----



#Message for empty grid




---
---
---
---
---



#generate row number in the grid





<%# Container.DataItemIndex + 1 %>




math EQUATION EDITOR

math equation Editor

http://www.wiris.com/
http://www.dessci.com/en/support/mathflow/downloads.htm#sdk_installers

http://www.vbdotnetheaven.com/UploadFile/mgold/MathEquationEditor04072005082425AM/MathEquationEditor.aspx?ArticleID=5065fecc-3a02-457f-b3ff-bad8d38a411d

ip

http://www.dessci.com/en/support/mathflow/technotes/default.htm

Thursday, May 6, 2010

msdn links

http://msdn.microsoft.com/en-us/library/dd560515%28v=MSDN.10%29.aspx

http://code.msdn.microsoft.com/aspnetmsdnexamples

ARCHITECURE

http://msdn.microsoft.com/en-us/architecture/default.aspx

component based programming(Interface Introduction)

Interfaces are constructs having abstract members only. This means that they have the signature or declaration of members only and no functionality implementation is done. The motive behind the use of interfaces is to provide service abstraction i.e. separation of interface from implementation which is a core concept in component based programming.

Also with the use of interfaces, service providers i.e. the classes which implement the interface elements are independent to change their implementation details without any interaction with clients as clients and these service providers are connected in loose coupling.

Before discussing the interface implementation there are some important points about interfaces you should know like interfaces can’t be instantiated and they have public members only. Also all the interface members must be implemented by the class which is implementing the interface.

An interface can extend other interfaces and a class can implement multiple interfaces. Now for understanding the interface implementation by a class consider the following example:

public interface IMyfirstInterface
{
void Method11();
void Method12();
}

public class ImplementorClass : IMyfirstInterface
{
public void Method11()
{...}
public void Method12()
{...}
}

In order to implement an interface a class is required which should derive it. Here in the example an interface IMyfirstInterface is defined which has two method’s signatures. For the implementation of this interface a class named ImplementorClass is defined which has implemented both of its methods. This method of implementing interface is called implicit interface implementation.

There is a different technique too where each interface member has to qualify with the interface name which declares it or whose member it is. This technique allows the separation of interface from the implementation and known as explicit interface implementation. Consider the following example to understand how this is done:


public interface IMyfirstInterface
{
void Method11();
void Method12();
}

public class ImplementorClass : IMyfirstInterface
{
void IMyfirstInterface .Method11()
{...}
void IMyfirstInterface .Method12()
{...}
}

.NET allows to mix the both techniques but it should be avoided in order to maintain consistency. In C# you can not extend more than one class at a time i.e multiple inheritance is not allowed. To overcome this limitation interfaces are used as there is no restriction in implementing multiple interfaces, so in .NET interface also provide a way to maintain scalability and flexibility.

One construct which also defines the signature of members leaving the functionality implementation is abstract class and it was used as a mechanism to provide service abstraction in earlier object oriented languages. Though abstracts classes sounds similar to the interfaces, both of them have some fundamental differences.

A class in .NET can extend from only one base class, no matter if the base class is abstract. But as stated earlier it can implement multiple interfaces. Also abstract classes can have constructors, variables and even non-abstract methods but interfaces are not allowed to have any of these.

Abstract classes can derive from one base class or multiple interfaces but interfaces can derive from other interfaces only. These restrictions in interfaces enable .NET to isolate the definition of implementation (in interfaces) from the actual implementation code (in the classes implementing the interfaces).

link

http://www.dotnet-guide.com/understanding-net-interface-based-programming.html


http://www.c-sharpcorner.com/uploadfile/rmcochran/csharp_interrfaces03052006095933am/csharp_interrfaces.aspx?login=true&user=ravuripradeep

Monday, May 3, 2010

listview imp links

http://basgun.wordpress.com/category/web-development/aspnet/listview/

http://wiki.asp.net/page.aspx/74/listview/


http://basgun.wordpress.com/category/web-development/aspnet/


SQL SERVER

http://msdn.microsoft.com/en-us/library/dd631807(v=SQL.10).aspx
SQL SERVER SAMPLES
http://blogs.msdn.com/bonniefe/default.aspx

Comparing ListView with GridView,DataList and Repeater

The ListView control is a new data presentation control that was added in ASP.Net 3.5.You may wonder why its added to the framework , and what it provide .

From what i have seen, ListView control was added to provide The following functionalities :

1.A very flexible and customizable layout.
2.A built in data paging support with the new DataPager control.
3.Support data grouping (repeating items) in a flexible way.
4.Built in support for deleting,inserting,paging,sorting,and updating the data.
Now , to compare the ListView control with the dataList,GridView and repeater control , lets look at the table below :



Supported Funcationalities
Control Paging Data Grouping Provide Flexible Layout Update,Delete Insert Sorting
ListView supported supported supported supported supported supported
GridView supported Not supported Not Supported supported Not Supported supported
DataList Not supported supported supported Not supported Not supported Not supported
Repeater Not supported Not supported supported Not supported Not supported Not supported


* Supported: means that it's provided out of the box without any custom code or hacks.

* Not Supported: means that it's not provided out of the box by the control but it could be possible to implement it using custom code \ hacks.

The GridView : it supports paging but it doesn't provide a flexible layout , since its mainly used to display the data in a table based layout.And If we looked at data inserting , the Gridview doesn't have a built in support for inserting data( since it doesn't call the insert method of it underlying data source when you click on a button with a CommadName set to "Insert" ).

The DataList : it support data grouping ( through its RepeatColumns property) , but it doesn't have a built in support for paging,inserting ,deleting , updating the data. and if you looked at its laout , you will find that by default the datalist renders as html table and you will have to set its flowLayout to "Flow" to stop that behaviour.


The Repeater control : you will find that it provides a flexible layout but it doesn't support data grouping ,inserting,deleting , updating and paging through the data .




Summary :

The ListView control was added to provide a rich data control that can support all the required functionalities at the same time , so now you can easily display a fully customizable layout that supports Grouping,paging , inserting , deleting , updating and sorting the data.



useful link

http://mike.members.winisp.net/filesfordownload/ASP.NET/