Friday, January 11, 2019

Send SMS using Twilio API in C#

Hello Friends,

Here, I'm providing link to send SMS using Twilio API in C#.

https://www.twilio.com/docs/sms/quickstart/csharp-dotnet-core#sign-up-for-twilio-and-get-a-twilio-phone-number

Twilio API has all the features to know status of SMS & it's very easy to integrate in application.

Thanks

Integrate Bootstrap Full year calendar control

Hello Friends,

Here, I'm providing links where we've all the information to integrate Bootstrap Full year calendar control.

This control has all inbuilt functionality like.

  • Show event information on tooltip
  • Show booked event with different background color
  • Open modal pop-up to add event data

Feel free to reach me if you face any difficulty while integrating it.

Thanks

Friday, January 4, 2019

Paste JSON As Class Or XML As Class in Visual Studio

Hello Friends,

In this article I'm explaining how we can quickly create class entities from json/xml data.

let's consider we've below JSON data based on it we've to generate class with same entity name.



How to generate class within Visual Studio


Step 1: Create a blank class



Step 2: Delete high lighted code. And keep your cursor inside namespace curly braces



Step 3: Open menu as per high lighted sub menu



Step 4 : Paste JSON code in class


Here you can see your JSON data have been converted into class. You can follow same step to paste XML As Class convert.

Friday, July 13, 2012

OpenRowset in 32 bit Operation system

Hello Friends, 

If you face the error like below while use "OpenRowset" in Sql server 2008 using the 32 bit Operation system. 

Error : OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error". Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)". Than follow the below steps :

1) Go to the SQL Server Management studio --> Server Objects--> Linked Server --> Providers --> Microsoft.ACE.OLEDB.12.0 

2) Right click on "Microsoft.ACE.OLEDB.12.0" and goes to Properties --> Uncheck the checkbox of "Allow in Process". 

Please note this solution is for 32 bit operating system. :)  

Regards 
Jignesh Patel

Monday, December 26, 2011

Get Stored Procedure name by using table name in Sql Server

Hello Friends,

Find the below two query for get Stored Procedure list by using table name.


SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%Nameoftable%'
AND ROUTINE_TYPE='PROCEDURE'


SELECT DISTINCT o.name, o.xtype
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
WHERE xtype = 'P' and c.TEXT LIKE '%Nameoftable%'

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