NUnit - Unit Testing framework for MS .NET

Sunday, April 26, 2009


What is NUnit ?


NUnit is an open source unit testing framework for Microsoft .NET. It was actually ported from JUnit.


What it's developers say?


"Initially ported from JUnit, the current production release, version 2.4, is the fifth major release of this xUnit based unit testing tool for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features, for example custom attributes and other reflection related capabilities. NUnit brings xUnit to all .NET languages."


From where can I download?


http://www.nunit.org/index.php?p=download


Test Runners:-


1. Console Runner(nunit-console.exe).


2. GUI Runner(nunit-gui.exe).


For more information see,


http://www.nunit.org/index.php?p=home



NUnit - Unit Testing framework for MS .NET


What is NUnit ?


NUnit is an open source unit testing framework for Microsoft .NET. It was actually ported from JUnit.


What it's developers say?


"Initially ported from JUnit, the current production release, version 2.4, is the fifth major release of this xUnit based unit testing tool for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features, for example custom attributes and other reflection related capabilities. NUnit brings xUnit to all .NET languages."


From where can I download?


http://www.nunit.org/index.php?p=download


Test Runners:-


1. Console Runner(nunit-console.exe).


2. GUI Runner(nunit-gui.exe).


For more information see,


http://www.nunit.org/index.php?p=home



NUnit - Unit Testing framework for MS .NET


What is NUnit ?


NUnit is an open source unit testing framework for Microsoft .NET. It was actually ported from JUnit.


What it's developers say?


"Initially ported from JUnit, the current production release, version 2.4, is the fifth major release of this xUnit based unit testing tool for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features, for example custom attributes and other reflection related capabilities. NUnit brings xUnit to all .NET languages."


From where can I download?


http://www.nunit.org/index.php?p=download


Test Runners:-


1. Console Runner(nunit-console.exe).


2. GUI Runner(nunit-gui.exe).


For more information see,


http://www.nunit.org/index.php?p=home



Mono - The .NET development platform

Thursday, April 23, 2009

What is Mono?
It is an Cross-platform, Open Source .net development framework.

Novell is giving the sponsorhip for it. The objective is to enable UNIX developers develope cross platform .NET applications. The latest version is Mono 2.4.

The Components:
1. C# compiler
2. Mono Runtime
3. Base Class Library
4. Mono Class Library

How to download?
Goto the http://mono-project.com page and from there you can download

For more information :
http://mono-project.com

Mono - The .NET development platform

What is Mono?
It is an Cross-platform, Open Source .net development framework.

Novell is giving the sponsorhip for it. The objective is to enable UNIX developers develope cross platform .NET applications. The latest version is Mono 2.4.

The Components:
1. C# compiler
2. Mono Runtime
3. Base Class Library
4. Mono Class Library

How to download?
Goto the http://mono-project.com page and from there you can download

For more information :
http://mono-project.com

Mono - The .NET development platform

What is Mono?
It is an Cross-platform, Open Source .net development framework.

Novell is giving the sponsorhip for it. The objective is to enable UNIX developers develope cross platform .NET applications. The latest version is Mono 2.4.

The Components:
1. C# compiler
2. Mono Runtime
3. Base Class Library
4. Mono Class Library

How to download?
Goto the http://mono-project.com page and from there you can download

For more information :
http://mono-project.com

Description about Out of Box Libraries

Wednesday, April 22, 2009


Description about  Out of Box Libraries

What is a document library?

A document library is where you upload your core documents. They consist of a row and column view with links to the documents. When the document is updated so is the link on your site. You can also track metadata on your documents. Metadata would consist of document properties.

What are picture libraries?

Picture libraries allow you to access a photo album and view it as a slide show or thumbnails or a film strip. You can have separate folder for each event, category, etc.

What is a Slide library?

The SharePoint Slide Library is a feature that comess with MOSS only. It provides rich integration with the PowerPoint 2007 client to track slides used from the library in a presentation to ensure that updates to the master slide are notified to users of the slides

 

How to create Slide library?

 

. To create a Slide Library, you need to have at least Designer permissions.

1.       On the Site Actions menu, click  View all site content

 

  1. Clcik Create button      
  2. Under Libraries, click Slide Library.

     

             Note:    Slide Libraries can be created in only certain types of sites, such as a Team site and Document Workspace.   If
                          you  do not see Slide Library under Libraries, the type of site you are working on does not support Slide Libraries.

4.       On the New page, under Name, type a name for the library. The name appears in any navigation links that you set up.

5.       Under Description, type an optional description.

6.       Click Create.

 

Description about Out of Box Libraries


Description about  Out of Box Libraries

What is a document library?

A document library is where you upload your core documents. They consist of a row and column view with links to the documents. When the document is updated so is the link on your site. You can also track metadata on your documents. Metadata would consist of document properties.

What are picture libraries?

Picture libraries allow you to access a photo album and view it as a slide show or thumbnails or a film strip. You can have separate folder for each event, category, etc.

What is a Slide library?

The SharePoint Slide Library is a feature that comess with MOSS only. It provides rich integration with the PowerPoint 2007 client to track slides used from the library in a presentation to ensure that updates to the master slide are notified to users of the slides

 

How to create Slide library?

 

. To create a Slide Library, you need to have at least Designer permissions.

1.       On the Site Actions menu, click  View all site content

 

  1. Clcik Create button      
  2. Under Libraries, click Slide Library.

     

             Note:    Slide Libraries can be created in only certain types of sites, such as a Team site and Document Workspace.   If
                          you  do not see Slide Library under Libraries, the type of site you are working on does not support Slide Libraries.

4.       On the New page, under Name, type a name for the library. The name appears in any navigation links that you set up.

5.       Under Description, type an optional description.

6.       Click Create.

 

Description about Out of Box Libraries


Description about  Out of Box Libraries

What is a document library?

A document library is where you upload your core documents. They consist of a row and column view with links to the documents. When the document is updated so is the link on your site. You can also track metadata on your documents. Metadata would consist of document properties.

What are picture libraries?

Picture libraries allow you to access a photo album and view it as a slide show or thumbnails or a film strip. You can have separate folder for each event, category, etc.

What is a Slide library?

The SharePoint Slide Library is a feature that comess with MOSS only. It provides rich integration with the PowerPoint 2007 client to track slides used from the library in a presentation to ensure that updates to the master slide are notified to users of the slides

 

How to create Slide library?

 

. To create a Slide Library, you need to have at least Designer permissions.

1.       On the Site Actions menu, click  View all site content

 

  1. Clcik Create button      
  2. Under Libraries, click Slide Library.

     

             Note:    Slide Libraries can be created in only certain types of sites, such as a Team site and Document Workspace.   If
                          you  do not see Slide Library under Libraries, the type of site you are working on does not support Slide Libraries.

4.       On the New page, under Name, type a name for the library. The name appears in any navigation links that you set up.

5.       Under Description, type an optional description.

6.       Click Create.

 

How to disable Autocomplete in Asp.net Textbox




Set AutoCompleteType Property to None


How to disable Autocomplete in Asp.net Textbox




Set AutoCompleteType Property to None


How to disable Autocomplete in Asp.net Textbox



Set AutoCompleteType Property to None

Bandwidth monitoring tool

Tuesday, April 21, 2009




Bandwidth monitoring tool




Bandwidth monitoring tool




Free asp.net hosting sites

Free asp.net hosting sites

Free asp.net hosting sites

Some Good Website collections 1

Some Good Website collections 1

Some Good Website collections 1

Sharepoint WebParts for Chart,Datagrid, Maps



Sharepoint WebParts for Chart,Datagrid, Maps

Sharepoint WebParts for Chart,Datagrid, Maps



Sharepoint WebParts for Chart,Datagrid, Maps

Sharepoint WebParts for Chart,Datagrid, Maps



Sharepoint WebParts for Chart,Datagrid, Maps

Unit testing Tool for Microsoft SharePoint



Unit testing Tool for Microsoft SharePoint



Unit testing Tool for Microsoft SharePoint



Unit testing Tool for Microsoft SharePoint



Unit testing Tool for Microsoft SharePoint



Unit testing Tool for Microsoft SharePoint



Sharepoint Server Download

Microsoft Office SharePoint Server 2007 Trial Version






Sharepoint Server Download

Microsoft Office SharePoint Server 2007 Trial Version






Sharepoint Server Download

Microsoft Office SharePoint Server 2007 Trial Version






Basics of MOSS


What is MOSS?

Microsoft Office SharePoint Server (MOSS) 2007 is a portal-based platform built over Windows SharePoint Services (WSS) 3.0. It organizes and aggregates an organization's information in one central, web-based application. MOSS enables users to create portals, has enterprise-level services, such as business intelligence and business process integration, etc.

 

What is it used for?

It is primarily used for Content Management, Collaboration, organizing and aggregating an enterprise's data into web-based portal. For e.g. Knowledge Management Portal.

 

Advantages:

Many built-in features, Rich Security, Content Management, Integration with Office products, business process can be integrated with workflows, less effort to create basic sites with standard functionalities such as search etc.

 

Hierarchy:

Web Application -> Site Collection -> Sites->database (Content db, Config db, SSO db). An interesting point to note here is that the equivalent of .Net website here is Web Application and not the sites under site collection.  Also the databases are encrypted hence developers can't view data.

 


Location of CAML


Location of CAML

CAML, the XML-based language used throughout SharePoint Team Services from Microsoft, is implemented in schemas and HTML files in the wwwroot and web server extensions folders of a SharePoint team Web site. The contents of the web server extensions folder represent global settings on the server and provide templates for creating new sites, while the contents of the wwwroot folder are used at run time and represent a specific instance of a site.

The following directories are the primary locations of files where you can edit CAML:

  • List of Lists table (tp_Fields column) and Views table (tp_View column) in the server database — Contain metadata that describes lists and views.
  • Inetpub\wwwroot\_layouts — Contains general purpose forms used to create new views or lists and to modify site settings at the site's top level.
  • Inetpub\wwwroot\Lists — Each subfolder contains HTML files that are used in forms for creating or modifying a specific list on a team Web site.
  • Inetpub\wwwroot\Shared Documents\Forms — Contains HTML files that are used in forms for document libraries.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Layouts — Contains HTML template files used for creating the forms that are instantiated in the _layouts folder of wwwroot. Each subfolder in the Layouts folder in turn contains a SCHEMA.XML file that serves as a template for defining the fields, forms, and views of the given list represented by the subfolder. Each of these folders also includes HTML files that apply CAML.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml — Contains the five core XML schemas that provide basic definition of types. The following table describes these files that are used in schema definition.
    Schema Description
    BASE.XML Defines the schema for built-in base types for lists.
    DOCICON.XML Used for mapping file extensions to particular icons.
    FLDTYPES.XML Defines how field types are rendered.
    ONET.XML Defines the schema for built-in base types of lists.
    STDVIEW.XML Defines the base view used when creating new views.

In addition to the locations listed here, you can also add CAML data islands directly to HTML files on the team Web site. The CAML ows: namespace must be specified in the containing element for the data island.

Note   The Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\admisapi folder contains files used in administration of the site. CAML is not used in these files and their contents should not be altered.

Caution   Changes to files in the web server extensions \...\Templates folder can break functionality in SharePoint Team Services. It is recommended that you make any changes on a test server first and then copy the final files to a production server.


Basics of MOSS


What is MOSS?

Microsoft Office SharePoint Server (MOSS) 2007 is a portal-based platform built over Windows SharePoint Services (WSS) 3.0. It organizes and aggregates an organization's information in one central, web-based application. MOSS enables users to create portals, has enterprise-level services, such as business intelligence and business process integration, etc.

 

What is it used for?

It is primarily used for Content Management, Collaboration, organizing and aggregating an enterprise's data into web-based portal. For e.g. Knowledge Management Portal.

 

Advantages:

Many built-in features, Rich Security, Content Management, Integration with Office products, business process can be integrated with workflows, less effort to create basic sites with standard functionalities such as search etc.

 

Hierarchy:

Web Application -> Site Collection -> Sites->database (Content db, Config db, SSO db). An interesting point to note here is that the equivalent of .Net website here is Web Application and not the sites under site collection.  Also the databases are encrypted hence developers can't view data.

 


Location of CAML


Location of CAML

CAML, the XML-based language used throughout SharePoint Team Services from Microsoft, is implemented in schemas and HTML files in the wwwroot and web server extensions folders of a SharePoint team Web site. The contents of the web server extensions folder represent global settings on the server and provide templates for creating new sites, while the contents of the wwwroot folder are used at run time and represent a specific instance of a site.

The following directories are the primary locations of files where you can edit CAML:

  • List of Lists table (tp_Fields column) and Views table (tp_View column) in the server database — Contain metadata that describes lists and views.
  • Inetpub\wwwroot\_layouts — Contains general purpose forms used to create new views or lists and to modify site settings at the site's top level.
  • Inetpub\wwwroot\Lists — Each subfolder contains HTML files that are used in forms for creating or modifying a specific list on a team Web site.
  • Inetpub\wwwroot\Shared Documents\Forms — Contains HTML files that are used in forms for document libraries.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Layouts — Contains HTML template files used for creating the forms that are instantiated in the _layouts folder of wwwroot. Each subfolder in the Layouts folder in turn contains a SCHEMA.XML file that serves as a template for defining the fields, forms, and views of the given list represented by the subfolder. Each of these folders also includes HTML files that apply CAML.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml — Contains the five core XML schemas that provide basic definition of types. The following table describes these files that are used in schema definition.
    Schema Description
    BASE.XML Defines the schema for built-in base types for lists.
    DOCICON.XML Used for mapping file extensions to particular icons.
    FLDTYPES.XML Defines how field types are rendered.
    ONET.XML Defines the schema for built-in base types of lists.
    STDVIEW.XML Defines the base view used when creating new views.

In addition to the locations listed here, you can also add CAML data islands directly to HTML files on the team Web site. The CAML ows: namespace must be specified in the containing element for the data island.

Note   The Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\admisapi folder contains files used in administration of the site. CAML is not used in these files and their contents should not be altered.

Caution   Changes to files in the web server extensions \...\Templates folder can break functionality in SharePoint Team Services. It is recommended that you make any changes on a test server first and then copy the final files to a production server.


Location of CAML


Location of CAML

CAML, the XML-based language used throughout SharePoint Team Services from Microsoft, is implemented in schemas and HTML files in the wwwroot and web server extensions folders of a SharePoint team Web site. The contents of the web server extensions folder represent global settings on the server and provide templates for creating new sites, while the contents of the wwwroot folder are used at run time and represent a specific instance of a site.

The following directories are the primary locations of files where you can edit CAML:

  • List of Lists table (tp_Fields column) and Views table (tp_View column) in the server database — Contain metadata that describes lists and views.
  • Inetpub\wwwroot\_layouts — Contains general purpose forms used to create new views or lists and to modify site settings at the site's top level.
  • Inetpub\wwwroot\Lists — Each subfolder contains HTML files that are used in forms for creating or modifying a specific list on a team Web site.
  • Inetpub\wwwroot\Shared Documents\Forms — Contains HTML files that are used in forms for document libraries.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\Layouts — Contains HTML template files used for creating the forms that are instantiated in the _layouts folder of wwwroot. Each subfolder in the Layouts folder in turn contains a SCHEMA.XML file that serves as a template for defining the fields, forms, and views of the given list represented by the subfolder. Each of these folders also includes HTML files that apply CAML.
  • Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml — Contains the five core XML schemas that provide basic definition of types. The following table describes these files that are used in schema definition.
    Schema Description
    BASE.XML Defines the schema for built-in base types for lists.
    DOCICON.XML Used for mapping file extensions to particular icons.
    FLDTYPES.XML Defines how field types are rendered.
    ONET.XML Defines the schema for built-in base types of lists.
    STDVIEW.XML Defines the base view used when creating new views.

In addition to the locations listed here, you can also add CAML data islands directly to HTML files on the team Web site. The CAML ows: namespace must be specified in the containing element for the data island.

Note   The Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\admisapi folder contains files used in administration of the site. CAML is not used in these files and their contents should not be altered.

Caution   Changes to files in the web server extensions \...\Templates folder can break functionality in SharePoint Team Services. It is recommended that you make any changes on a test server first and then copy the final files to a production server.


Basics of MOSS


What is MOSS?

Microsoft Office SharePoint Server (MOSS) 2007 is a portal-based platform built over Windows SharePoint Services (WSS) 3.0. It organizes and aggregates an organization's information in one central, web-based application. MOSS enables users to create portals, has enterprise-level services, such as business intelligence and business process integration, etc.

 

What is it used for?

It is primarily used for Content Management, Collaboration, organizing and aggregating an enterprise's data into web-based portal. For e.g. Knowledge Management Portal.

 

Advantages:

Many built-in features, Rich Security, Content Management, Integration with Office products, business process can be integrated with workflows, less effort to create basic sites with standard functionalities such as search etc.

 

Hierarchy:

Web Application -> Site Collection -> Sites->database (Content db, Config db, SSO db). An interesting point to note here is that the equivalent of .Net website here is Web Application and not the sites under site collection.  Also the databases are encrypted hence developers can't view data.

 


Sharepoint Minimal Master Page from MS

Sharepoint Minimal Master Page from MS

Sharepoint Minimal Master Page from MS

DataConnections in InfoPath 2007- Part I

Monday, April 20, 2009

What is InfoPath?

Infopath is a very powerful Form Designer. One of the major advantages of InfoPath is, it is wholely XML-based and the form design is based on XSD. Infopath 2007 comes with MS Office 2007.

What is Form Template and Form Data?

Form Template is nothing but the Form Design. Form Data is what we store through the Form.

Data Connections

It is the connection to Data Source. They allow to do read, write operations over the Data Source. There are many types of connections in InfoPath. They are :

1. SQL Server

2. Web Service

3. XSD

4. XML

5. Data Connection Library (DCL)

6. E- mail

7. SharePoint Document Library

The objective of this topic is to explain “How to work with DataConnections in InfoPath 2007”. So, We are not going to discuss the basics of InfoPath in detail.

We are going to see here a sample in a step by step manner , which shows you the basic of Data Connection in InfoPath. Here InfoPath is the front-end and MS Sql Server 2005 is the back-end.

A sample displaying an Employee Information from the back-end

Let us see the sample in a step by step manner with back-end and fron-end flow.

Back-end (SQL Server):

We are creating a PayRoll Database for this sample. You can either create this database or use your existing database. But you need to create the following Employee table.

The code to create employee table:

CREATE TABLE [dbo].[Employee](

[EmpId] [bigint] IDENTITY(1,1) NOT NULL,

[EmpName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[DOJ] [datetime] NOT NULL,

[Designation] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Department] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Salary] [money] NOT NULL,

CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED

(

[EmpId] ASC

)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

Code to insert data into the table:

INSERT INTO [Employee]([EmpName],[DOJ],[Designation],[Department],[Salary])

VALUES ("Bill Gates","01/01/1983","CEO","Computers","12222222.0000")

Simillarly insert few records.

Front-End (InfoPath):

Step 1 : Start InfoPath

Click Start > All Programs > MS Office > MS InfoPath 2007 as show in Fig. 1

Step 2: Decide Way of Designing

You will be shown a ‘Getting Started’ Window as shown in Fig. 2.

Click on Design a Form Template.

Step 3: Select Template

Select Database , Check whether “Enable browser-compatible features only” is checked. If not then check it. Form Template Option button will also bet selected. Then Click Ok.

Step 4: Select Database

Data Connection Wizard will be shown .

Click on Select Database.

Double click on +NewSQLServerConnection

Enter the server name.

Select “Use Windows Authentication”

Click Next.

Choose PayRoll database from the combo box.

Select Employee table , then Click Next.

Click on Finish.

Select desired fields there in this screen.

Click Next

Click Finish in the next Screen.

Step 5: Design Form

Expand the queryFields in the DataSource Window.

Then Drag EmpId into the form and drop into “Drag query fields here” area.

Simillarly expand dataFields and drag remaining fields into “Drag data fields here” area.

Then the resultant form will look like in the Fig.10

Now the Form creation and data connection is over. That’s all the database form generation.

The final step is to test the Form we created above.

Step 6: Running and Testing the Form

Click Preview in the toolbar.

Enter 1 in the EmpId field.

Click Run Query.

A security screen will be shown, click Yes in it. After that the form will fetch the corresponding values for the empId “1”, as shown in the following diagram. You can test with your desired values and it will display the result.

Click Close Preview to exit.

Have fun creating forms.

DataConnections in InfoPath 2007- Part I

What is InfoPath?

Infopath is a very powerful Form Designer. One of the major advantages of InfoPath is, it is wholely XML-based and the form design is based on XSD. Infopath 2007 comes with MS Office 2007.

What is Form Template and Form Data?

Form Template is nothing but the Form Design. Form Data is what we store through the Form.

Data Connections

It is the connection to Data Source. They allow to do read, write operations over the Data Source. There are many types of connections in InfoPath. They are :

1. SQL Server

2. Web Service

3. XSD

4. XML

5. Data Connection Library (DCL)

6. E- mail

7. SharePoint Document Library

The objective of this topic is to explain “How to work with DataConnections in InfoPath 2007”. So, We are not going to discuss the basics of InfoPath in detail.

We are going to see here a sample in a step by step manner , which shows you the basic of Data Connection in InfoPath. Here InfoPath is the front-end and MS Sql Server 2005 is the back-end.

A sample displaying an Employee Information from the back-end

Let us see the sample in a step by step manner with back-end and fron-end flow.

Back-end (SQL Server):

We are creating a PayRoll Database for this sample. You can either create this database or use your existing database. But you need to create the following Employee table.

The code to create employee table:

CREATE TABLE [dbo].[Employee](

[EmpId] [bigint] IDENTITY(1,1) NOT NULL,

[EmpName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[DOJ] [datetime] NOT NULL,

[Designation] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Department] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Salary] [money] NOT NULL,

CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED

(

[EmpId] ASC

)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

Code to insert data into the table:

INSERT INTO [Employee]([EmpName],[DOJ],[Designation],[Department],[Salary])

VALUES ("Bill Gates","01/01/1983","CEO","Computers","12222222.0000")

Simillarly insert few records.

Front-End (InfoPath):

Step 1 : Start InfoPath

Click Start > All Programs > MS Office > MS InfoPath 2007 as show in Fig. 1

Step 2: Decide Way of Designing

You will be shown a ‘Getting Started’ Window as shown in Fig. 2.

Click on Design a Form Template.

Step 3: Select Template

Select Database , Check whether “Enable browser-compatible features only” is checked. If not then check it. Form Template Option button will also bet selected. Then Click Ok.

Step 4: Select Database

Data Connection Wizard will be shown .

Click on Select Database.

Double click on +NewSQLServerConnection

Enter the server name.

Select “Use Windows Authentication”

Click Next.

Choose PayRoll database from the combo box.

Select Employee table , then Click Next.

Click on Finish.

Select desired fields there in this screen.

Click Next

Click Finish in the next Screen.

Step 5: Design Form

Expand the queryFields in the DataSource Window.

Then Drag EmpId into the form and drop into “Drag query fields here” area.

Simillarly expand dataFields and drag remaining fields into “Drag data fields here” area.

Then the resultant form will look like in the Fig.10

Now the Form creation and data connection is over. That’s all the database form generation.

The final step is to test the Form we created above.

Step 6: Running and Testing the Form

Click Preview in the toolbar.

Enter 1 in the EmpId field.

Click Run Query.

A security screen will be shown, click Yes in it. After that the form will fetch the corresponding values for the empId “1”, as shown in the following diagram. You can test with your desired values and it will display the result.

Click Close Preview to exit.

Have fun creating forms.

DataConnections in InfoPath 2007- Part I

What is InfoPath?

Infopath is a very powerful Form Designer. One of the major advantages of InfoPath is, it is wholely XML-based and the form design is based on XSD. Infopath 2007 comes with MS Office 2007.

What is Form Template and Form Data?

Form Template is nothing but the Form Design. Form Data is what we store through the Form.

Data Connections

It is the connection to Data Source. They allow to do read, write operations over the Data Source. There are many types of connections in InfoPath. They are :

1. SQL Server

2. Web Service

3. XSD

4. XML

5. Data Connection Library (DCL)

6. E- mail

7. SharePoint Document Library

The objective of this topic is to explain “How to work with DataConnections in InfoPath 2007”. So, We are not going to discuss the basics of InfoPath in detail.

We are going to see here a sample in a step by step manner , which shows you the basic of Data Connection in InfoPath. Here InfoPath is the front-end and MS Sql Server 2005 is the back-end.

A sample displaying an Employee Information from the back-end

Let us see the sample in a step by step manner with back-end and fron-end flow.

Back-end (SQL Server):

We are creating a PayRoll Database for this sample. You can either create this database or use your existing database. But you need to create the following Employee table.

The code to create employee table:

CREATE TABLE [dbo].[Employee](

[EmpId] [bigint] IDENTITY(1,1) NOT NULL,

[EmpName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[DOJ] [datetime] NOT NULL,

[Designation] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Department] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Salary] [money] NOT NULL,

CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED

(

[EmpId] ASC

)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

Code to insert data into the table:

INSERT INTO [Employee]([EmpName],[DOJ],[Designation],[Department],[Salary])

VALUES ("Bill Gates","01/01/1983","CEO","Computers","12222222.0000")

Simillarly insert few records.

Front-End (InfoPath):

Step 1 : Start InfoPath

Click Start > All Programs > MS Office > MS InfoPath 2007 as show in Fig. 1

Step 2: Decide Way of Designing

You will be shown a ‘Getting Started’ Window as shown in Fig. 2.

Click on Design a Form Template.

Step 3: Select Template

Select Database , Check whether “Enable browser-compatible features only” is checked. If not then check it. Form Template Option button will also bet selected. Then Click Ok.

Step 4: Select Database

Data Connection Wizard will be shown .

Click on Select Database.

Double click on +NewSQLServerConnection

Enter the server name.

Select “Use Windows Authentication”

Click Next.

Choose PayRoll database from the combo box.

Select Employee table , then Click Next.

Click on Finish.

Select desired fields there in this screen.

Click Next

Click Finish in the next Screen.

Step 5: Design Form

Expand the queryFields in the DataSource Window.

Then Drag EmpId into the form and drop into “Drag query fields here” area.

Simillarly expand dataFields and drag remaining fields into “Drag data fields here” area.

Then the resultant form will look like in the Fig.10

Now the Form creation and data connection is over. That’s all the database form generation.

The final step is to test the Form we created above.

Step 6: Running and Testing the Form

Click Preview in the toolbar.

Enter 1 in the EmpId field.

Click Run Query.

A security screen will be shown, click Yes in it. After that the form will fetch the corresponding values for the empId “1”, as shown in the following diagram. You can test with your desired values and it will display the result.

Click Close Preview to exit.

Have fun creating forms.

Blog Widget by LinkWithin