Monday, August 16, 2010

Not able to open Server Explorer in VS2008

if you not able to open server Explorer in vs2008 you can perform below step to make it open:
Go to visual studio command prompt
run below command:
devenv /setup

and its done....

you can use "devenv /resetsettings" command to reset all settings of visual studio
Read More

Thursday, August 12, 2010

Truncate Database/ Delete data from all tables of database

-- disable all constraints
EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'

-- delete data in all tables
EXEC sp_MSForEachTable 'DELETE FROM ?'

-- enable all constraints
exec sp_msforeachtable 'ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all'
Read More

Friday, August 6, 2010

Adding or Removing values from Array using javascript

We can add or remove values from an array using splice() function.

the splice() function returns the removed element(s).
syntex: arrayName.splice(Startindex,HowManyElements,element1,.....,elementX)

eg.
< script type="text/javascript" >

var employes = ["Rolen", "Pankaj", "JS", "Bhupendra"];
document.write("Removed: " + employes.splice(2,1,"Pankaj") + "< br / >");
document.write(employes);

< /script >

Solution By: Rajesh Rolen
Read More

Thursday, August 5, 2010

Disable Autocomplete in Textbox / form in asp.net

to disable auto complete in textbox you will have to set autocomplete="off" for textbox. this is not in its property so you will have to write it in aspx page by own.

or in code behind write : Textbox1.Attributes.Add("autocomplete", "off");

To turn off auto-complete for your entire form, all you need to do is add an attribute to your form tag, like this:

< form id="Form1" method="post" runat="server" autocomplete="off" >
Read More

Wednesday, August 4, 2010

Show Text Vertical in Crystal Reports in Asp.Net

sometimes we need to show our text or we can say header text in vertical. and we try using rotate property but it not works.. so to do so we have got a perfect solution to make browser fool.

we can do be using below steps:
1. take a label/text.
2. set your font size as required
3. now set make its height large and set width in such a manner so only one character can be displayed.
4. go to format font->spacing->character spacing exactly: and enter something like 20/25

and done....

solution by: Rajesh Rolen
Read More

Crystal Report in asp.net

To create crystal report in asp.net follow below steps
1. take a crystal report viewer on page (i have given name "crv" to it)
then write below code in code behind file.

using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

private void showreport()
{
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("MyReportName.rpt"));
report.SetDataSource(objrep.ReportDataSource);
SetTableLocation(report.Database.Tables);
crv.ReportSource = report; //crv is your Crystal report viewer's name.
}


private void SetTableLocation(Tables tables)
{
ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = @"DBSERVER2\SQL2005";
connectionInfo.DatabaseName = "dbMEAVer5web";
connectionInfo.UserID = "sa";
connectionInfo.Password = "admin55";

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}
}



Solution by: Rajesh Rolen
Read More
Powered By Blogger · Designed By Seo Blogger Templates