Alert Box in Android

protected void alertbox(String title, String mymessage) { new AlertDialog.Builder(this) .setMessage(mymessage) .setTitle(title) .setCancelable(true) .setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton){} }) .show(); } For more details see below link… http://huuah.com/dialog-boxes-in-android/

How to parse json string object in Android

First of all you have understand what is jsonObject and jsonObjectArray. ex. of jsonObject { “Validate”: “true” } if string start with “{” then it’s a only a object. [ { “Validate”: “true” } ] if string start with “[” then its array of object. Here I describe both how to parse object or array …

Consume webservice in Android app

First of all give internet permission to app for that below steps. 1. Open “AndroidManifest.xml” file. 2. Copy below code under Now make one function which is consume web service. public String doRequest(String requestURL) { InputStream is = null; String jsonString = “”; HttpClient httpClient = null; HttpGet request = null; try { HttpParams httpParameters …

clear previous history in every textbox

Its a problem recently I am facing in my recent project. So my client told me you should clear previous history in every textbox. So I just write a textbox properties in Page_Prerender event in my page(codebehind). protected void Page_PreRender(Object sender, EventArgs e) { txtPassword.Attributes.Add(“autocomplete”, “off”) txtConfirmPassword.Attributes.Add(“autocomplete”, “off”); } It will solve your problem.

Dynamically Add Header in Crystal Report

string amount = amountTextBox.Text; string titleString = ” Total Sanctions above “; List investmentList = new List(); investmentList = new InvestmentManager().CollectAmountWiseInvestment(amount); expirySanctionCrystalReport reportDocumentObject = new expirySanctionCrystalReport(); //Set Crystal Report Header CrystalDecisions.CrystalReports.Engine.TextObject amountText = (CrystalDecisions.CrystalReports.Engine.TextObject)reportDocumentObject.ReportDefinition.ReportObjects[“dateText”]; amountText.Text = amount; CrystalDecisions.CrystalReports.Engine.TextObject titleText = (CrystalDecisions.CrystalReports.Engine.TextObject)reportDocumentObject.ReportDefinition.ReportObjects[“TextTitle”]; titleText.Text = titleString; reportDocumentObject.SetDataSource(investmentList); amountWiseCrystalReportViewer.ReportSource = reportDocumentObject; amountWiseCrystalReportViewer.RefreshReport(); amountWiseCrystalReportViewer.Visible = true;

Get Last Day Of Month

—-Last Day of Previous Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0)) LastDay_PreviousMonth —-Last Day of Current Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0)) LastDay_CurrentMonth —-Last Day of Next Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0)) LastDay_NextMonth ResultSet: LastDay_PreviousMonth ———————– 2007-07-31 23:59:59.000 LastDay_CurrentMonth ———————– 2007-08-31 23:59:59.000 LastDay_NextMonth ———————– 2007-09-30 23:59:59.000 If you want to find last day of month of any day specified use following …

Email From SQL in HTML format

declare @body1 nvarchar(MAX) set @body1 = N’ :: Report(1-06-2011 To 30-06-2011) :: ‘ + N’ First Name Last Name Email ‘ + N” + CAST ( ( SELECT td = FirstName, ”, td = LastName, ”, td = EmailId, ” from Users ORDER BY FirstName ASC FOR XML PATH(‘tr’), TYPE ) AS NVARCHAR(MAX) ) + …