Friday, August 5, 2011

WCF hosting types

Hello Friends,

Find the below link for different ways to host the WCF Service.

Click here

follow the all the step u will get it done.....

Enjoy wih WCF.

Friday, July 8, 2011

Create Windows Service

Hello Friends,

Find the below link for create the windows service by using simple step.

Click here

happy coding...

Thursday, June 16, 2011

Scheduling and Event Logging Windows Service

Hello Guys,

Now u can create windows service with some easy step.
Also u create can "Scheduling Windows Service with Timer Control".

http://www.aspnetajaxtutorials.com/2008/01/create-windows-service-with-cnet-part-2.html

Create CSV file in Asp.Net

Hello Friends,

U can create CSV file using below code.
Call below GetRecord() function in your button click event or wherver u need.
Folder name and file name will be get from .config file.

Sub GetRecord()
Dim dt As DataTable
Dim Id As Integer
Id = Convert.ToInt32(ConfigurationSettings.AppSettings("Id").ToString())
Dim ds As DataSet = SqlHelper.ExecuteDataset(sConnString, "Get_Record", Id)
Dim headers(ds.Tables(0).Columns.Count) As String
Dim cnt As Integer = 0
For Each column As DataColumn In ds.Tables(0).Columns
headers(cnt) = column.ColumnName
cnt = cnt + 1
Next
ExportCSV(ds, 0, headers)
End Sub

Sub ExportCSV(ByRef ds As DataSet, ByVal tableIndex As Int32, ByRef headers As String())
'Write out column headers
Dim headerOut As String = ""
If Not headers Is Nothing Then

For i As Integer = 0 To headers.Length - 2 'Don't do the last item yet
headerOut += headers(i)
headerOut += ","
Next
headerOut += headers(headers.Length - 1) 'Now do the last item, so you don't have a trailing comma.
'CSVWriter.WriteLine(headerOut)
End If
headerOut += Environment.NewLine

'Write out data
Dim CSVOut As String = ""
For Each r As DataRow In ds.Tables(tableIndex).Rows
For i As Integer = 0 To (ds.Tables(tableIndex).Columns.Count - 2) 'Don't do the last item yet
If Not IsDBNull(r(i)) Then
CSVOut += Chr(34)
CSVOut += CStr(r(i))
CSVOut += Chr(34)
End If
CSVOut += ","
Next
If Not IsDBNull(r(ds.Tables(tableIndex).Columns.Count - 1)) Then
CSVOut += CStr(r(ds.Tables(tableIndex).Columns.Count - 1)) 'Now do the last item, so you don't have a trailing comma.
End If
CSVOut += Environment.NewLine
'CSVWriter.WriteLine(CSVOut)
Next

Dim sFileName As String = ConfigurationSettings.AppSettings("FileName").ToString()
Dim dtTime As DateTime
dtTime = DateTime.Now()
Dim swOut As New StreamWriter(sADPOut + "\" + sFileName & "_" & dtTime.ToString.Replace("/", "").Replace(":", "") + ".csv")
swOut.Write(headerOut.ToString())
swOut.Write(CSVOut.ToString())
swOut.Flush()
swOut.Close()

End Sub

.CSV file will be save in specified folder.

Sunday, December 6, 2009

Open div tag layer in Javascript

Hello Friends

Please find the below javascript script for open the div base layer on the screen.


/*function showBox()
{
var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;


var layer = document.createElement('div');
layer.style.zIndex = 2;
layer.id = 'layer';
layer.style.position = 'absolute';
layer.style.top = '0px';
layer.style.left = '0px';
if(document.documentElement.scrollHeight < 800 )
{
layer.style.height = 835 + 'px';
}
else
{
layer.style.height = document.documentElement.scrollHeight + 'px';
}

layer.style.width = width + 'px';
layer.style.backgroundColor = 'black';
layer.style.opacity = '.6';
layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
document.body.appendChild(layer);

var div = document.createElement('div');
div.style.zIndex = 3;
div.id = 'box';
div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
div.style.top = '200px';
div.style.left = (width / 2) - (400 / 2) + 'px';
div.style.height = '150px';
div.style.width = '500px';
div.style.backgroundColor = 'white';
div.style.border = '2px solid silver';
div.style.padding = '20px';
document.body.appendChild(div);

var a = document.createElement('div');
a.innerHTML = '
';

div.appendChild(a);
var divSub = document.createElement('div');
divSub.innerHTML = '

Under Construction

';
div.appendChild(divSub);

}
function removelayer()
{
document.body.removeChild(document.getElementById('layer'));
document.body.removeChild(document.getElementById('box'));
};


Call the above script using
opendivlayer */

Add close.jpg image in your root directory.

Thanks & Regards
Jignesh Patel

Wednesday, December 2, 2009

Application folder in Asp.Net

Hello Friends

Go through the below link for get good knowledge of application folder in Asp.Net.

http://www.codeproject.com/KB/aspnet/AspNetAppFolder.aspx

Tuesday, October 13, 2009

User Creation and Role Assignment in Dotnetnuke

Hello Friends

Go through the below link for create user and role assignment in Dotnetnuke(DNN)

http://www.codeproject.com/KB/aspnet/DNNRolesnUser.aspx

Thursday, October 8, 2009

Login in dotnetnuke

Hello friends

You r in trouble with login in dotnetnuke web site.

So login in your DNN web site just add the "?ctl=login" in any page.

suppose your web site name is "http://www.test.com"

than u can login in that using "http://www.test.com/Default.aspx?ctl=login"

Thursday, October 1, 2009

Increase dotnetnuke website performance

Hello Guys

Go through below way for increase dotnetnuke web site performance

(1)If your DotnetNuke website is running slow. You can increase it’s performance by deleting it’s logs. To do that, please login to your dotnetnuke site as HOST. Then go to "Admin" --> "Log Viewer". Then in the log viewer page , "Delete all selected exceptions" and "Clear log" link at the bottom of page Clear all your logs will increase your dotnetnuke performance. Another faster way would be connecting to your Dotnetnuke db directly and run the following SQL command:

delete from eventlog;

(2)Extra caching (Not in the menu)

Although the above caching options let you decide if you want Dotnetnuke to offer caching there is something extra you can do. This will require you to edit your ascx skin files. Open your skinfile and add the following script:

Tuesday, September 22, 2009

Open popup in button click event

Hello guys

Add below C# code in button click event.

StringBuilder sb = new StringBuilder();
sb.Append("");
System.Web.UI.ScriptManager.RegisterStartupScript(this.upnlStd, this.GetType(), "sb", sb.ToString(), false);

Monday, September 7, 2009

Add thumbnail in skin

Hello Friends

Follow the below step for add thumbnail to skin and container in DNN.

Step 1: Suppose your project name is TestThumbnail.
Step 2: You have create skin in your project at the location TestThumbnail\Portals\_default\Skins\TitleBlue.ascx.
Step3 : Your skin name is TitleBlue.ascx. Now you need to add thumbnail at same location with same name.
means TestThumbnail\Portals\_default\Skins\TitleBlue.jpg.

After follow the step you can see the thumbnail in manage skin after login.

Wednesday, August 12, 2009

Change FCKeditor Default Font

Hello Friends

If u want to change the default font in fck editory than change in below .css file.

File Location: fck\editor\css\fck_editorarea.css

Open up the fck_editorarea.css and look for:
below is the default setting.
body, td
{
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
}

change in this and u will get the default setting according to that

Saturday, August 1, 2009

Get Sql Server table structure and Data

Hello friends


Download Microsoft SQL Server Database Publishing Wizard 1.1 using the below link and install it.
Go through it and u will get the script of Sql Server table and its data.

http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

Thanks & Regards
Jignesh Patel

Thursday, July 16, 2009

Remove default paragraph in FckEditor

Hello Friends

When we work with Editor than it shows default text like "Here it shows blank space" in source...

Also when we press Enter than it will take Paragraph in place of break..

So find the solution using below step.
Step 1 : open the fckeditor/fckconfig.js file
Step 2 : Change in that

FCKConfig.EnterMode = 'br' ; // p | div | br
FCKConfig.ShiftEnterMode = 'p' ; // p | div | br

Step 3 : Save it and remove the cache,cookie,history and check...

Also this solution is work in Dotnetnuke...


Thanks & Regards
Jignesh Patel

Working with Math Equation Editor

Hello friends

Please download the Editor using below link.

Click here to Download

Register fck editor in your page by using

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

And use it by


Add downloded editor dll in Bin folder and paste FckEditor in your application.

For more detail click here

Enjoy with math equation editor....

Thanks & Regards
Jignesh Patel

Monday, July 13, 2009

Backup using Query in Sql Server

Hello Guys


Execute the below query for create backup file.


EXEC sp_addumpdevice 'disk', 'MyBackupDevice', 'D:\Shared\MyBackup.bak'
BACKUP DATABASE Test TO MyBackupDevice



Here "D:\Shared\MyBackup.bak" is the path of the back up file.
"Test" is the name of database.

Execute it u will get the back up file at "D:\Shared\MyBackup.bak" location.


Thanks & Regards
Jignesh Patel

Monday, July 6, 2009

HTML Codes - Characters and symbols

Hello Friends

You need a html codes for Characters and symbols.

Please go through to below link.

http://www.ascii.cl/htmlcodes.htm

Thanks & Regards
Jignesh Patel

Thursday, June 18, 2009

Working with DotNetNuke

Hello Friends

Below link is useful to work with Dotnetnuke.

Go through it step by step.

http://www.codeproject.com/KB/MCMS/DotNetNuke.aspx

Thanks & Regards
Jignesh Patel

Create module in Dotnetnuke

Hello guys

Dotnetnuke is useful for CMS application.

Below link is useful to create module in Dotnetnuke application.

http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/1410/DotNetNuke-4-5-and-ASP-NET-AJAX.aspx

Thanks & Regards
Jignesh Patel

Tuesday, June 2, 2009

Control the Page Numbering in word document

Hello friends

Here is the sample code using that u can set the page number starting from 5.

Microsoft.Office.Interop.Word._Application oWord oWord = new Microsoft.Office.Interop.Word.Application(); oWord.ActiveWindow.Selection.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.RestartNumberingAtSection = true;

oWord.ActiveWindow.Selection.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.StartingNumber = 5;

Thanks & Regards
Jignesh Patel