Showing posts from 2013 connector Step by step guide to get fields from a table BAPI Function GET_RFC_TABLE

Directly access data from  the SAP tables from

For Visual Studio 2010, you will need to download the latest one:
Unzip and install to a convenient location on your machine.

Create An App

Right click on project and select “Add Reference”
When window opens, select “Browse” and navigate to the folder where you installed the SAP Nco Connector.
You will need to select the following dll:
 First, create a class that implements IDestinationConfiguration.  VB.NET code shown below.

Imports SAP.Middleware.Connector

Public Class ECCDestinationConfig
    Implements IDestinationConfiguration

    Public Event ConfigurationChanged(ByVal destinationName As String, ByVal args As RfcConfigurationEventArgs) Implements IDestinationConfiguration.ConfigurationChanged

    Public Function GetParameters(ByVal destinationName As String) As RfcConfigParameters Implements IDestinationConfiguration.GetParameters

        Dim parms As New RfcConfigParamet…

ASP.Net Jquery Ajax noconflict solution for multiple plugins

dont use var $x = jQuery.noConflict(true)
Use   var $x = jQuery.noConflict()  


            <head id="Head1" runat="server">
    <script src="jquery1.6.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
     jQuery.noConflict();  //this line saves my life by allowing multi plugins work together.
     jQuery(document).ready(function ($) {
        // $(document).ready(fileCount);

    <script language="javascript" type="text/javascript">
        var $x = jQuery.noConflict()

         function fileCount(name) {
                 type: "POST",
                 url: "vinservice.asmx/updatefileCount",
                 data: "{filename:'" + name + "'}",
                 contentType: "application/json; chars…

ASP.Net MySql Date time conflict resolution

Add this line on your page tag   Culture="pl-PL"

this is yyyy-MM-dd format default used by mysql database for date time..

Now use any date format string in your page like DataFormatString="{0:d.M.yyyy}"  or .Tosting("mm/dd/y")

ultimately internal date time will be compatible with mysql connection.

link to a good resource on culture info

-vinod kotiya

Add Telerik RADControls for ASP.NET Ajax on existing .Net website

1. Install Telerik RADControls for ASP.NET Ajax setup.

2. Register the HTTP handler required by RadScriptManager by pasting the following in your web.config inside the < httpHandlers /> tag:

and the following inside the  handlers /> tag:
addname="Telerik_Web_UI_WebResource_axd"verb="*"preCondition="integratedMode"path="Telerik.Web.UI.WebResource.axd"type="Telerik.Web.UI.WebResource"/>3. At top of aspx page <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>4. use RADScript manager and controls in aspx as desired.5. In vb pageImports Telerik.Web.UI 'Namespace civilfronts1 Partial Public MustInherit Class civilfronts Inherits System.Web.UI.PageEnd Class

Searcharoo : Open Source .Net Search Engine

## Post originaly written by Dragon, i have just simplified it more.

Searcharoo is an open-source C#/ASP.NET implementation of a search engine and website spider. This is an open-source project initiated and maintained by Australian Craig Dunn. It runs very fast and provides pretty configurable interface. Over the years it grew to become a full-featured search engine with many of the modern features which became a standard. Some of these are the following:
- stemming
- stop words
- use of robots
- search of phrases from within files such as PDFs, Word, etc.
- geotagging results
- many many more.

You can find the full list of features at the Searcharoo website. The latest version is 7.0 and that is the version I am going to be using in my example. So for the purpose of this example go and download a latest version source code and unzipp it to the folder of your choice. You will get several folders at the destination:
- EPocalipse.IFilter (internal component used by the Searcharoo, no …

VB.Net MySQL save datatable as CSV

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports System.IO
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Csv As New Exporter()
        Dim c As New common
        Using CsvWriter As New StreamWriter(Application.StartupPath() & "\" & "milestones.csv")
            Dim q = "SELECT m.project,projectcode1,m.unit,milestone,ext_sch_date,int_sch_date,act_ant_date FROM `Projects_ntpc` p, Units u , " & _
              " MileStones m WHERE p.projectname = u.project and u.project = m.project and u.unit = m.unit and u.completed !=0 and  u.zerodate is not null"
        End Using
        ' System.Diagnostics.Process.Start(&qu…

How To Open And Access Blocked Sites

"This website/URL has been blocked until further notice either pursuant to Court orders or on the Directions issued by the Department of Telecommunications"

Are you getting above message while opening the site which is useful and not porn or restricted.

 Internet should be Free and without restriction. Here are few methods to avoid that error message:

Solution 1: Use IP Address instead of

You can get ip address from this site
type there and get relevent ipaddress like

You can change dns adress provided by ISP manually to google dns like or

go to control panel > Network connection > Adapter settings > choose LAN/WIFI > right click to properties > tcp IP 4 > enter manual dns

Solution 3: use proxy site like kproxy

Solution 4 : Use browsers like ultra surf or opera turbo

- Vinod Kotiya

Recieve email with attachment using VB.Net and

Grabbing the body of the e-mail message is a little bit trying. You need to actually grab the MessagePart (in the e-mail address we used the MessageHeader). Once you have the MessagePart you can then access the following methods .FindFirstPlainTextVersion() and .FindFirstHtmlVersion(), plain text and HTML respectively.
First you will need to test whether the e-mail has an attachment. If it does we need to set up a situation where we can loop through all the attachments, in case there is more than one. Below is a bit of code that will save the attachments to a folder on the local drive

Imports OpenPop.Pop3
Imports OpenPop.Mime
Imports System.Data
Public Class Form1

    Private Sub btnGet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGet.Click
        Dim pop3Client As Pop3Client

        pop3Client = New Pop3Client
        pop3Client.Connect(txtServer.Text, Integer.Parse(txtPort.Text), cbSSL.Checked)
        pop3Client.Authenticate(txtUser.Text, txtPwd.Text)


Install vncserver / No machine for remote access on Debian Linux

Update and Upgrade your server with current packages

Being logged into your server as root, do the following:

server$ apt-get update
server$ apt-get upgrade
server$ apt-get dist-upgrade
to upgade your whole installation.

IV. Installing GNOME

After having done a dist-upgrade we are used to reboot the servers. This might not be necessary in all cases and might be a strange obsession from ancient MS Windows times, but we would recommend it to allow all scripts to become initialized anew.

After reboot login as root again and do the following:

server$ apt-get install gnome-desktop-environment
V. Install fonts for GNOME and VNC

Install some (required) fonts for the VNC server GNOME session:

server$ apt-get install xfonts-100dpi
server$ apt-get install xfonts-100dpi-transcoded
server$ apt-get install xfonts-75dpi
server$ apt-get install xfonts-75dpi-transcoded
server$ apt-get install xfonts-base
VI. Install VNC server

We prefer TightVNCServer, simply because it worked from the very beginning…


Backup Windows Server to another Server : SyncToy

Backup Windows Server A to another Server B.

To create backup of data at A to server B.

1. Create a shared folder with write permission in B.

2. Access this folder in server A in my computer > Mapnetwork drive and create a new drive named z:
which represent //B/sharedfolder

3. Install a free windows software SyncToy

4. Create the folder pair and give it a name "server backup".

5. To automate the backup schedule a task in Task scheduler.
 > use synctoycmd.exe  with folder pair name as  argument  "server backup" - R

Problem you may face
problem with synctoy 2.1. It can't find mapped network drives when run via Task Scheduler running the following command: "C:\Program Files\SyncToy 2.1\SyncToyCmd.exe" with aruments "-R" It works fine when I run it manually from the synctoy GUI. The command also works fine when I execute the command above via the command line. Solution:
You need to setup synctoy using the UNC path instead of the mapped dri…

Setting Windows Server 2008 / IIS / .Net / Crystal Report Viewer

1. Install Windows Server 2008 R2 Enterprise 64 Bit from CD

2. Customize the server Add Roles
    > IIS > TFTP etc
3.Install .Net framework 4.5 64bit

4. Install Mysql-connector 6.5.6 64bit. Also change reference to this version in web.config of website or application

5. Install mysql odbc driver both 32 bit and 64bit and create system DNS connection to your database server. 32bit is required to have crystal report application running for reports created earlier in 32 bit. It will also to solve “The report you requested requires further information” error message in client machines.

6. Install Crystal Report Viewer for .net 64bit.

7. Install Crystal Report 2011

8. Install Visual studio IDE 2010

9. Install CR Viewer for VS2010. To avoid CrystalDecision assembly error copy dll files to

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet

10. Create websites in inetmgr with app…

mysql update from another table

UPDATE contacts_New p, users pp
SET pp.last_name = concat(p.desig, ' ',p.dept)
WHERE pp.username = p.eid

Lets say we have 2 tables one named contacts_New and one named users .

I waana update users last_name field from contacts_New p.desig, ' ',p.dept field. use above query.

ASP.Net Update Panel Dropdownlist Abnormal Behaviour

ASP.Net Update Panel Dropdownlist Abnormal Behaviour: while selecting value some other item gets selected or lost its state in asyncpostback. To resolve the issue check that  DataValueField is having unique values

asp:UpdatePanel ID="UpdatePanel2" runat="server">Triggers>
                   asp:AsyncPostBackTrigger ControlID="ddlMoU" EventName="SelectedIndexChanged"

asp:DropDownList ID="ddlMoU" runat="server" datatextfield="mou" DataValueField="mou" AutoPostBack="True" OnSelectedIndexChanged="ddlMoU_SelectedIndexChanged" EnableViewState="true"

ASP.Net Download Data in Excel File without using interop.

ASP.Net  Download Data in Excel File  without using interop.
Use following code to download data as excel. First you should bind your data to gridview .

Sub saveExcel()
        ' Change the Header Row back to white color
        GridView1.HeaderRow.Style.Add("background-color", "#FFFFFF")

        ' This loop is used to apply stlye to cells based on particular row
        For Each gvrow As GridViewRow In GridView1.Rows
            gvrow.BackColor = Drawing.Color.White

            If gvrow.Cells(4).Text = "True" Then
                gvrow.BackColor = Drawing.Color.Yellow
                'For k As Integer = 0 To gvrow.Cells.Count - 1
                '    gvrow.Cells(k).Style.Add("background-color", "#EFF3FB")
            End If


        Response.AddHeader("content-disposition", "attachment; filename=GridViewToExcel.xls")


ASP.Net Read microsoft project MPP file using opensource mpxj and net.sf.mpxj wih vb

ASP.Net Read microsoft project MPP file using opensource mpxj or net.sf.mpxj in vb language

Due to limitation of interop , i have used mpxj so that it can be used in clients machine for web based access.. Following code is used to read mpp data and bind this to grid which can be later exported to SAP PS Module..

1. Download mpxj from internet unzip it in root folder of application
2. right click on project add reference
3. browse to unzip folder and add mpx.dll
4. import following classes and add functions mentioned in bottom of this code.

Imports net.sf.mpxj
Imports net.sf.mpxj.reader
Imports System.Collections.Generic
Imports System.Collections
Imports java.util

Partial Class _wbsx
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

 Dim maxlevel = 0
        Dim currentlevel = 0
        Dim wbs = ""

        Dim reader = ProjectReaderUtility.getProjectReader(Server.MapPath("./upload/") & "…

ASP.Net Reading Microsoft Project MPP File using interop.

ASP.Net Reading Microsoft Project MPP File using interop.
Its easy but works only on running at machine having visual studio installed. Below is a program made for importing data from MPP to SAP PS Module. The code can read data from MPP File and bind to a Grid for display.

Imports Microsoft.Office.Interop.MSProject

Page Load

        Dim appclass As New Application

        Dim oMissing = Type.Missing
        Dim bopen = appclass.FileOpenEx(Server.MapPath("./upload/") & "mspfile.mpp", True, PjMergeType.pjDoNotMerge, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, PjPoolOpen.pjDoNotOpenPool, oMissing, oMissing, oMissing, oMissing)

        If bopen = False Then
            lblMsg.Text = "File not opened"
            Exit Sub
        End If

        appclass.Visible = False
        Dim project As Project = appclass.ActiveProject

        Dim temp As String = "
        Dim id As Integer = 1
        '########### ' Store t…

Google+ Followers