Wednesday, March 30, 2011

AIFBIZTALKADAPTER CONFIGURATION:

AIFBIZTALKADAPTER CONFIGURATION:
================================
AIF:(applocation integrtion framework) it is used to enable the businuss logic and dataexchage with the other applications.

now my requriment is  to transfer data from biztalkserver to dynamicsax for that i am using AIF.

AIF is act like a mediater between DAX and Biztalkserver.

after installing the AIF we need to configure the AIF

it includes channels,services and endpoints.

AIF contains 3 layers

client layer:

serverlayer:
  
    windowsserver(iis,msmq) and biztalkserver(AIF Biztalkadapter)

Businusslayer:


Inbound and outbound message exchange:
=======================================

Inbound:
==========

clientresends xml message--->  msmq,Filesystem.Biztalk----> Gatewayqueue--->  AIF Service  -------->     MicrosoftDyanamics AX Database
Outbound:
==========

MicrosoftDyanamics AX Database --->    AIF Service  --------> Outboundprocessing--->  Gatewayqueue ----> msmq,Filesystem.Biztalk------->  clientreceives xml message

we should know these Terms:

adapter----it is component used as dataexchange

businussdocument---> xml representation of data

document service---> it is new programming model service in aif,it enable any class as a service so you can call the that service from your x++

getwayqueue---> it is a temprory storage used for processing

channel---> where to send message and how to request message and how to get response from the message

pipelineprocessor---->it enables transimission when data exchange b/w one system to another system

webservices----> it is a mechanism for transefering data from one application to another application
 

Saturday, March 26, 2011

html timer

<html>
<head>
<script type="text/javascript">
var c=0;
var t;
var timer_is_on=0;
var m=0;
function timedCount()
{
document.getElementById('txt').value=m+":"+c;
c=c+1;
if(c==59)
{
m++;
c=1;
}
if(m==2)
{
alert("your time is over");
}


t=setTimeout("timedCount()",1000);a
}

function doTimer()
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }
}
</script>
</head>

<body>
<form>
<input type="button" value="Start count!" onClick="doTimer()">
<input type="text" id="txt">
</form>
<p>Click on the button above. The input field will count forever, starting at 0.</p>
</body>
</html>

Thursday, March 17, 2011

to catch the query string value using javascript


to catch the query string value using javascript

window.location.href = "Default2.aspx?username=" + txtusername;

in the reading page.aspx

 var query = location.search.substring(1)   //you get the username=somename in query variable so you need to split
        
            var str = query.split('=');
            alert(str[0]);  //username
            alert(str[1]); // somename

IF YOU WANT TO SEND THE DATA USING GET IN $.AJAX

IF YOU WANT TO SEND THE DATA USING GET IN $.AJAX
=================================================


[OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,UriTemplate="nextqtn/{qtno}")]
        List<getjson> nextqtn(string qtno);


UNDER.ASPX
============

 $.ajax({
http://192.168.1.9:150/Service.svc/nextqtn/" + id + "",
                type: "GET",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                processdata: true,
                success: function (msg) {
                   
                    count = parseInt(msg);
                  
                },
                Error: function (msg) {


                }
            });

IF YOU WANT TO SEND THE DATA USING POST METOD IN $.AJAX


IF YOU WANT TO SEND THE DATA USING POST METOD IN $.AJAX

YOU SHOULD FOLLOW THE BELOW CODE:


[OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "usrregistration")]
        bool usrregistration(string Firstname);


SERVICE1.CS
==============

 public bool usrregistration(string Firstname)
        {
            con.Open();
            bool var = false;
            cmd = new SqlCommand("insert into tblusereg(Firstname) values(@Firstname)", con);
            cmd.Parameters.Add(new SqlParameter("@Firstname", Firstname));
            //cmd.Parameters.Add(new SqlParameter("@Lastname", Lastname));
            int i = cmd.ExecuteNonQuery();
            if (i > 0)
            {
                var = true;
            }
            con.Close();
            return var;
        }


UNDER.ASPX
=============

  <script type="text/javascript">
        function Register() {
            var Firstname = $("#txtFirstName").val();
            var Lastname = $("#txtLastName").val();
            var Email = $("#txtEmail").val();
            var Phone = $("#txtPhone").val();
            var Address = $("#txtAddress").val();
            var City = $("#txtCity").val();
            var State = $("#txtState").val();
            var ddlcountry = $("#ddlcountry").val();
            var ddlcourse = $("#ddlcourse").val();
            //
            //var msg2 = {"Firstname": "Denny","":"","":"","":"","":"","":"",};
            var msg2 = { "Firstname": Firstname, "Lastname": Lastname, "Email": Email, "Address": Address, "City": City, "State": State, "ddlcountry": ddlcountry, "ddlcourse": ddlcourse };
           // var msg2 = { "Firstname:" + Firstname + ",LastName:" + LastName };

            Data = JSON.stringify(msg2);
            alert(Data);
            alert('Firstname' + Firstname + 'LastName:' + LastName);
            $.ajax({

                url: "http://192.168.1.9:150/Service.svc/usrregistration",
                type: "POST",
                // data: '{"Firstname":' + Firstname + ',"LastName:"'+LastName+'}',
                // data:"{'Firstname':'rose'}",
                data: Data,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                processdata: true,
                success: function (msg) {
                    alert(msg);

                    alert('Registerd successfully');
                },
                error: function (msg) {

                    alert('Faild'+msg.status);
                }

            });
      
      
      
        }
  
    </script>

sending data using post method in jquery with wcf services

http://pranayamr.blogspot.com/2011/03/rest.html

Tuesday, March 15, 2011

READING EXCEL SHEET DATA INTO DATABASE TABLE USING BULK UPLOAD

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Data.Common;
using System.Text;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
//        string excelConnectionString = @"Provider=Microsoft
//    .Jet.OLEDB.4.0;Data Source=C:\Users\CRM5\Desktop\demo.xls;Extended
//    Properties=""Excel 8.0;HDR=YES;""";


        string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\CRM5\Desktop\Book1.xlsx;Extended Properties=Excel 12.0";



      //Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + strPath + ";Extended Properties=""Excel 12.0;IMEX=1;HDR=YES

// Create Connection to Excel Workbook
using (OleDbConnection connection =
             new OleDbConnection(excelConnectionString))
{
    OleDbCommand command = new OleDbCommand
            ("Select id,data FROM [Sheet1$]", connection);

    connection.Open();
   
    // Create DbDataReader to Data Worksheet
    using (DbDataReader dr = command.ExecuteReader())
    {
        // SQL Server Connection String
        string sqlConnectionString = "Data Source=.; Initial Catalog=test;Integrated Security=True";

        // Bulk Copy to SQL Server
        using (SqlBulkCopy bulkCopy =
                   new SqlBulkCopy(sqlConnectionString))
        {
            bulkCopy.DestinationTableName = "demo";// sql server databse =test table= demo
            bulkCopy.WriteToServer(dr);
        }
    }
}
    }
 
}

Consuming WCF / ASMX / REST service using JQuery

http://www.c-sharpcorner.com/UploadFile/sridhar_subra/116/

Friday, March 11, 2011

javascript function link in buliding table at code(.cs)

onclick='javascript:radiofun(\"" + dr.GetString(1) + "\",\"" + dr.GetValue(7).ToString() + "\" );'


\"------------->means ""(doublecode)

Wednesday, March 9, 2011

Thursday, March 3, 2011

Accordian control

http://www.portalzine.de/Horizontal_Accordion_Plugin_2/index.html