This is my Technical area of troubleshooting and learning new Programming skills and many more. Here you will find answers for many new technologies like asp.net 2.0/3.5,4.0 C# access, mysql, Amazon Webservice ,Sql-server, JD Edwards, SAS, Salesforce, APIs, MVC and many more. please visit & discuss.
Tuesday, November 30, 2010
Submitting a Windows Phone 7 Application to the Market - CodeProjec
Monday, November 29, 2010
Twitter new api C# :- continuous posting twitter
using
System.Data;using
System.Configuration;using
System.Collections;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls;using
oAuthExample;using
System.Threading;public
partial class Default6 : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
string url = ""; string xml = ""; oAuthTwitter oAuth = new oAuthTwitter(); if (Request["oauth_token"] == null){
oAuth.CallBackUrl =
"http://localhost/twitterpost/default6.aspx";Response.Redirect(oAuth.AuthorizationLinkGet());
}
else{
Response.Write(oAuth.TokenSecret.Length);
if (oAuth.TokenSecret.Length <= 0){
oAuth.AccessTokenGet(Request[
"oauth_token"], Request["oauth_verifier"]);}
if (oAuth.TokenSecret.Length > 0){
url =
"http://twitter.com/account/verify_credentials.xml";xml = oAuth.oAuthWebRequest(
oAuthTwitter.Method.GET, url, String.Empty);apiResponse.InnerHtml = Server.HtmlEncode(xml);
url =
"http://twitter.com/statuses/update.xml";xml = oAuth.oAuthWebRequest(
oAuthTwitter.Method.POST, url, "status=" + oAuth.UrlEncode("#Cybermonday deals on Football Products http://visli.com/mainsearch/Football/All/1.aspx"));apiResponse.InnerHtml = Server.HtmlEncode(xml);
Response.Write(
"time 1 =>" +DateTime.Now.ToLongTimeString());System.Threading.
Thread.Sleep(120000);Response.Write(
"<br>time 2 =>" + DateTime.Now.ToLongTimeString()); // url = "http://twitter.com/statuses/update.xml"; Trousersxml = oAuth.oAuthWebRequest(
oAuthTwitter.Method.POST, url, "status=" + oAuth.UrlEncode("#Cybermonday deals on basketball... http://visli.com/mainsearch/basketball/All/1.aspx"));apiResponse.InnerHtml = Server.HtmlEncode(xml);
}
}
}
}
JD Edwards: How to Remove a RB batch from System
my batch# was 70242
--delete from proddta.f03b13 where ryicu=70242
--delete from proddta.f03b11 where rpicu=70242
--delete from proddta.f0911 where glicu=70242
Sunday, November 28, 2010
10 Essential Tools for Building ASP.NET Websites
Creating a ASP.NET MVC HTML Helper for Silverlight
Friday, November 26, 2010
Routing in ASP.NET
http://haacked.com/archive/2010/11/21/named-routes-to-the-rescue.aspx
Wednesday, November 24, 2010
Maximum request length exceeded. asp.net
Maximum request length exceeded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Maximum request length exceeded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Maximum request length exceeded.] System.Web.HttpRequest.GetEntireRawContent() +11141623 System.Web.HttpRequest.FillInFormCollection() +129 System.Web.HttpRequest.get_Form() +119 System.Web.HttpRequest.get_HasForm() +11072695 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +124 System.Web.UI.Page.DeterminePostBackMode() +83 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +270
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[HttpException (0x80004005): Maximum request length exceeded.] System.Web.HttpRequest.GetEntireRawContent() +11141623 System.Web.HttpRequest.FillInFormCollection() +129 System.Web.HttpRequest.get_Form() +119 System.Web.HttpRequest.get_HasForm() +11072695 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +124 System.Web.UI.Page.DeterminePostBackMode() +83 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +270
Tuesday, November 23, 2010
Accessing Server-Side Data from Client Script: Using WCF Services with jQuery and the ASP.NET Ajax Library
Today's websites commonly exchange information between the browser and the web server using Ajax techniques - the browser executes JavaScript code typically in response to the page loading or some user action. This JavaScript makes an asynchronous HTTP request to the server. which then processes the request and, perhaps, returns data that the browser can then seamlessly integrate into the web page. Two earlier articles - Accessing JSON Data From an ASP.NET Page Using jQuery and Using Ajax Web Services, Script References, and jQuery, looked at using both jQuery and the ASP.NET Ajax Library on the browser to initiate an Ajax request and both ASP.NET pages and Ajax Web Services..more...
http://www.4guysfromrolla.com/articles/111710-1.aspx
C# Twitter auto post error
Message: Sys.WebForms.PageRequestManagerServerErrorException: The remote server returned an error: (401) Unauthorized.
Line: 868
Char: 13
Code: 0
URI: http://localhost/twitterpost/ScriptResource.axd?d=xx5DcacSwVVveclpzpHq2-LXWURIUfynVz7pWaz73heKi6nCrTVxg5HtpwrjU7BOloH-k8h0BVS-wYBpVV-156MzkfrUqR9pOcJxUOB35X5rSsvuR97HR16wGYIDHMP8YE8SkccccL8iujeA5OmyhtO2XUbN6-VETwaajPuOmuysRn17A9FbpPaAyuMN0&t=2610f696
Monday, November 22, 2010
JD Edwards : Sales count by year/month and search type
datepart(yy,DATEADD(dy, cast(SDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(SDTRDJ as varchar(10)) / 1000,-1)) ),
datepart(mm,DATEADD(dy, cast(SDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(SDTRDJ as varchar(10)) / 1000,-1)) ),
abat1,count(*) from sales_f4211_f42119 --(union f4211/f42119)
left outer join proddta.f0101 on sdshan=aban8
where sddcto='SO' and sdnxtr=999 and sdlttr<>980
group by abat1,
datepart(yy,DATEADD(dy, cast(SDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(SDTRDJ as varchar(10)) / 1000,-1)) ),
datepart(mm,DATEADD(dy, cast(SDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(SDTRDJ as varchar(10)) / 1000,-1)) )
Currency Converter For Windows Phone 7
Phone 7 using Microsoft Visual Studio Express 2010 for the Windows Phone.
http://www.codeproject.com/KB/windows-phone-7/Phone7Programming.aspx
Sunday, November 21, 2010
Formatting Dates, Times in ASP.NET 4.0
Format Description | Code Snippet | Output |
---|---|---|
Short date pattern (d) | DateTime.Now.ToString("d") | 11/8/2010 |
Long date pattern (D) | DateTime.Now.ToString("D") | Monday, November 08, 2010 |
Full date/time pattern - short time (f) | DateTime.Now.ToString("f") | Monday, November 08, 2010 3:39 PM |
Full date/time pattern - long time (F) | DateTime.Now.ToString("F") | Monday, November 08, 2010 3:39:46 PM |
General date/time pattern - short time (g) | DateTime.Now.ToString("g") | 11/8/2010 3:39 PM |
General date/time pattern - long time (G) | DateTime.Now.ToString("G") | 11/8/2010 3:39:46 PM |
Month/day pattern (M) | DateTime.Now.ToString("M") | November 08 |
Round-trip date/time pattern (O) | DateTime.Now.ToString("O") | 2010-11-08T15:39:46.4804000-08:00 |
RFC 1123 pattern (R) | DateTime.Now.ToString("R") | Mon, 08 Nov 2010 15:39:46 GMT |
Sortable date/time pattern (s) | DateTime.Now.ToString("s") | 2010-11-08T15:39:46 |
Short time pattern (t) | DateTime.Now.ToString("t") | 3:39 PM |
Long time pattern (T) | DateTime.Now.ToString("T") | 3:39:46 PM |
Universal sortable date/time pattern (u) | DateTime.Now.ToString("u") | 2010-11-08 15:39:46Z |
Universal full date/time pattern (U) | DateTime.Now.ToString("U") | Monday, November 08, 2010 11:39:46 PM |
Year/month pattern (Y) | DateTime.Now.ToString("Y") | November, 2010 |
Saturday, November 20, 2010
Credit Card Validator Attribute for ASP.NET MVC 3
Friday, November 19, 2010
Thursday, November 18, 2010
JD Edwards EnterpriseOne Year End CENTCHG data dictionary 2010
Dear Valued JD Edwards EnterpriseOne Customer,
According to our records your company is currently using Oracle JD Edwards EnterpriseOne. We want to make you aware of an important update that users should make in the EnterpriseOne CENTCHG data dictionary.
JD Edwards EnterpriseOne stores calendar dates in Julian date format. The system allows two-digit dates to be entered to facilitate data entry. The system uses data dictionary item CENTCHG (CenturyChangeYear) to determine the century to use for populating data tables. The system also uses this data dictionary item when automatically populating the default effective through and expiration dates in some data tables.
In releases Xe and ERP8.0, the default value for CENTCHG was set to 10. Thus dates populated using the CENTCHG default value are created as '12/31/2010'. In release 8.9, the default value was set to 15, creating a date of '12/31/2015'. In releases 8.10 through 9.0, the default value was set to 40, creating a date of '12/31/2040'. Oracle recommends that this value be increased for users in the Xe, ERP8.0, and 8.9 releases as well as users who have upgraded from these releases to 8.10 or higher so that the software will supply new effective through dates further into the future.
The document, linked below, outlines the function of CENTCHG in the software and recommends a change to the CENTCHG data dictionary default as soon as possible. This document also introduces the Date Utility, a tool designed to assist users with identifying and resolving business data with potential date issues. The Date Utility is designed for use with the currently supported tools releases.
Instructions (Knowledge Article 882478.1)
If you have any questions or concerns and we can be of assistance, please contact your Global Customer Support Center
Lyle Ekdahl
Group Vice President. General Manager
Oracle JD Edwards
Wednesday, November 17, 2010
Get a facebook email address
MAC and Xcode in Windows iPod, iPhone and iPad
Tuesday, November 16, 2010
Validation (XHTML 1.0 Transitional): Element 'video' is not supported. html5
Google map api total distance and duration calculation C#
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load("http://maps.googleapis.com/maps/api/directions/xml?origin=92610&destination=92630&sensor=false");
XmlNodeList xnList = xDoc.SelectNodes("DirectionsResponse/route/leg/distance");
foreach (XmlNode xn in xnList)
{
Response.Write("distance-> "+xn["text"].InnerText);
}
XmlNodeList xnList1 = xDoc.SelectNodes("DirectionsResponse/route/leg/duration");
foreach (XmlNode xn in xnList1)
{
Response.Write("<br>duration-> " + xn["text"].InnerText);
}
}
Monday, November 15, 2010
Comma Delimited value in sql-server where condition
DECLARE
@psCSString VARCHAR(1000)set
@psCSString='123,456,789,0123,dsdsd'create
table #otTemp (fld varchar(20)) WHILE LEN(@psCSString) > 0 BEGIN SET @sTemp = LEFT(@psCSString, ISNULL(NULLIF(CHARINDEX(',', @psCSString) - 1, -1), LEN(@psCSString))) SET @psCSString = SUBSTRING(@psCSString,ISNULL(NULLIF(CHARINDEX(',', @psCSString), 0), LEN(@psCSString)) + 1, LEN(@psCSString))INSERT
INTO #otTemp VALUES (@sTemp)--drop table #otTemp
--select @sTemp
END select * from dshsjh in( select * from #otTemp) drop table #otTempParsing string variable in Where clause with commas
string variable in Where clause with commas
DECLARE @sTemp VARCHAR(1000)
DECLARE @psCSString VARCHAR(1000)
set @psCSString='dsdss,dsdd,sddsds,43443,dsdsd'
WHILE LEN(@psCSString) > 0
BEGIN
SET @sTemp = LEFT(@psCSString, ISNULL(NULLIF(CHARINDEX(',', @psCSString) - 1, -1),
LEN(@psCSString)))
SET @psCSString = SUBSTRING(@psCSString,ISNULL(NULLIF(CHARINDEX(',', @psCSString), 0),
LEN(@psCSString)) + 1, LEN(@psCSString))
-- INSERT INTO @otTemp VALUES (@sTemp)
select @sTemp
END
Split parameter string from comma seperator in SQL IN clause
Thursday, November 11, 2010
Wednesday, November 10, 2010
Call Javascript from code behind c# sample
Google map API distance C# javascript calling from code behind
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default10.aspx.cs" Inherits="Default10" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API Example: Extraction of Geocoding Data</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA7j_Q-rshuWkc8HyFI4V2HxQYPm-xtd00hTQOC0OXpAMO40FHAxT29dNBGfxqMPq5zwdeiDSHEPL89A" type="text/javascript"></script>
<!-- According to the Google Maps API Terms of Service you are required display a Google map when using the Google Maps API. see: http://code.google.com/apis/maps/terms.html -->
<script type="text/javascript">
var geocoder, location1, location2;
function showLocation() {
geocoder = new GClientGeocoder();
geocoder.getLocations(document.forms[0].address1.value, function (response) {
if (!response || response.Status.code != 200)
{
alert("Sorry, we were unable to geocode the first address");
}
else
{
location1 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address};
geocoder.getLocations(document.forms[0].address2.value, function (response) {
if (!response || response.Status.code != 200)
{
alert("Sorry, we were unable to geocode the second address");
}
else
{
location2 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address};
calculateDistance();
}
});
}
});
}
function calculateDistance()
{
try
{
var glatlng1 = new GLatLng(location1.lat, location1.lon);
var glatlng2 = new GLatLng(location2.lat, location2.lon);
var miledistance = glatlng1.distanceFrom(glatlng2, 3959).toFixed(1);
var kmdistance = (miledistance * 1.609344).toFixed(1);
//document.getElementById('results').innerHTML = '<strong>Address 1: </strong>' + location1.address + '<br /><strong>Address 2: </strong>' + location2.address + '<br /><strong>Distance: </strong>' + miledistance + ' miles (or ' + kmdistance + ' kilometers)';
document.getElementById("Label1").innerHTML = '<strong>Address 1: </strong>' + location1.address + '<br /><strong>Address 2: </strong>' + location2.address + '<br /><strong>Distance: </strong>' + miledistance + ' miles (or ' + kmdistance + ' kilometers)';
}
catch (error)
{
alert(error);
}
}
</script>
</head>
<body>
<form id="wedkj" runat="server">
<p>
<input type="text" name="address1" value="92610" class="address_input"
size="40" />
<input type="text" name="address2" value="92679" class="address_input"
size="40" />
<input type="submit" name="find" value="Search" />
</p>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default10 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Label1.Text = inpHide.Value;
// Response.Write(Label1.innerHtml);
//Response.Write("dsdsdsd");
// Response.Write(Label2.Text);
}
protected void Button1_Click(object sender, EventArgs e)
{
//Response.Write("1111dssddsddsdssd");
Button1.Attributes.Add("onclick", "showLocation(); return false;");
}
protected void Button2_Click(object sender, EventArgs e)
{
//Response.Write(Label1.Text);
}
}
Friday, November 5, 2010
Yahoo map/geocoding API to get latitude and longitude c# sample
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class yalatilongi : System.Web.UI.Page
{
private GeoAddressAPI geoAPI = new GeoAddressAPI();
protected void Page_Load(object sender, EventArgs e)
{
string strConnection = "server=xxxxx;database=xxxxx;uid=sa;pwd=xxxxxxx;Connect Timeout=60";
SqlConnection myConn = new SqlConnection(strConnection);
string strstate = "CA";
string query = "select aladd1,alcty1,aladds,aladdz,aban8 from jde_rk.dbo.latlongad where lati=0 and aladds='"+strstate+"'";
SqlCommand myCommand = new SqlCommand(query, myConn);
myCommand.Connection.Open();
SqlDataReader myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
Response.Write(myReader.GetString(0));
Response.Write("<br>");
Response.Write(myReader.GetString(1));
Response.Write("<br>");
Response.Write(myReader.GetString(2));
Response.Write("<br>");
Response.Write(myReader.GetString(3));
Response.Write("<br>");
Response.Write(myReader.GetString(4));
Response.Write("<br>");
GeoAddress address = geoAPI.GeoEncodeAddress(myReader.GetString(0), myReader.GetString(1), myReader.GetString(2), myReader.GetString(3));
Response.Write(address.Latitude);
Response.Write("<br>");
Response.Write(address.Longitude);
Response.Write("<br>");
Response.Write(myReader.GetString(4));
// Response.End();
editLeadMaster(myReader.GetString(4), address.Latitude, address.Longitude);
}
myReader.Close();
myConn.Close();
}
void editLeadMaster(string aban8, string Lati, string Longi)
{
SqlConnection myConnection = new SqlConnection(ConnectionString);
string strSQL = "UPDATE jde_rk.dbo.latlongad SET longi=@longi,lati=@lati WHERE aban8 ='" + aban8 + "'";
SqlCommand cmd = new SqlCommand(strSQL, myConnection);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@longi", Longi.ToString());
cmd.Parameters.AddWithValue("@lati", Lati.ToString());
myConnection.Open();
cmd.ExecuteNonQuery();
myConnection.Close();
}
private string ConnectionString
{
get
{
string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString1"].ConnectionString;
return connectionString;
}
}
}
for distance calculation use following:-
private double distanceCal(double Lat1, double Long1, double Lat2, double Long2, char unit)
{
double dDistance = Double.MinValue;
double dLat1InRad = Lat1 * (Math.PI / 180.0);
double dLong1InRad = Long1 * (Math.PI / 180.0);
double dLat2InRad = Lat2 * (Math.PI / 180.0);
double dLong2InRad = Long2 * (Math.PI / 180.0);
double dLongitude = dLong2InRad - dLong1InRad;
double dLatitude = dLat2InRad - dLat1InRad;
// Intermediate result a.
double a = Math.Pow(Math.Sin(dLatitude / 2.0), 2.0) + Math.Cos(dLat1InRad) * Math.Cos(dLat2InRad) * Math.Pow(Math.Sin(dLongitude / 2.0), 2.0);
// Intermediate result c (great circle distance in Radians).
double c = 2.0 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1.0 - a));
// Distance.
// const Double kEarthRadiusMiles = 3956.0;
const Double kEarthRadiusKms = 6376.5;
dDistance = kEarthRadiusKms * c;
return dDistance;
//return (dist);
}
Wednesday, November 3, 2010
Put Double quotes in excel data
2063719971 | "2063719971", | " | ", | |||
2063719997 | "2063719997", | " | ", | |||
2063720425 | "2063720425", | " | ", | |||
2063720466 | "2063720466", | " | ", | |||
2063720789 | "2063720789", | " | ", | |||
2063720797 | "2063720797", | " | ", |