Skip to main content

Posts

Execute *.sql with .NET

Do you ever want to execute slq statements at once. I mean SQL Script file. Normally we are using like following commands to Execute Single SQL statement. SqlCommand cmd = new SqlCommand(sSQL, conn); cmd.ExecuteNonQuery(); cmd.Dispose(); but this way you can execute one command at a time. We cannot execute SQL script using above command. Normal SQL Script Like this. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK__titleauth__au_id__0519C6AF]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1) ALTER TABLE [dbo].[titleauthor] DROP CONSTRAINT FK__titleauth__au_id__0519C6AF GO CREATE TABLE [dbo].[authors] ( [au_id] [id] NOT NULL , [au_lname] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [au_fname] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [phone] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [address] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [city] [varchar] (20) COLL

Remove comma from a String in Crystal Reports

I have a little problem regarding with following in Crystal Report "Salary Sheet For "+ Monthname (month({PrintPaySlip;1.Salary_Date}))+ " "+ totext(TONumber({@FYear})) Outout will be like follwos. Salary Sheet For January 2,010 What i want is like follows (Without the comma) Salary Sheet For January 2010 So the soultion would be like this. "Salary Sheet For "+ Monthname (month({PrintPaySlip;1.Salary_Date}))+ " "+ totext(TONumber({@FYear}),0,"") Thanks for looking a simple function. but if you dont know.... it'll become Difficult.... Learn everything.... impossible but give a try...

Send Crystal Report DIRECTLY TO PRINTER WITH VB.NET || C#

I think you can understand with following code. SalesInvoice rpt = new SalesInvoice(); rpt.RecordSelectionFormula = SQL; rpt.SetDatabaseLogon("sa", "pwd"); PrintDialog prtdlg = new PrintDialog(); prtdlg.ShowDialog();rpt.PrintOptions.PrinterName = prtdlg.PrinterSettings.PrinterName; rpt.PrintToPrinter(prtdlg.PrinterSettings.Copies, prtdlg.PrinterSettings.Collate, prtdlg.PrinterSettings.FromPage, prtdlg.PrinterSettings.ToPage); Keep Programming.

Customized Page for Printer

Intro How to Create Customized papper (Windows XP) Set the Customized papper as Default paper to the printer. Intro When i was working with several projects; customers are using pre printed invoices for print their bills. For printing invoices i used Crystal Reports. for print particular information on that pre printed invoices i had to waste lots of time with doing alignments. If that pre-printed bill is A4 then its easy for me to set alignments because most of every printer supports A4 papers.(NOT POS PRINTERS) . But if the customer select a Paper which is not supports to the printer then i have to waste lots of time to set the paper alignments. New printers are supporting user to set their own customized paper. But lots of companies still using dot matrix printers for print lots of invoices. It is easy and economical. Most of all Dot matrix printers does not have a feature to customized the paper size. Windows XP has a option to user defined paper on Printer and Faxes in the control

Create RSS with Simple Example

Content What is RSS and Usage How do i subscribe to RSS Creating the XML file Creating the HTML file Testing The Sample What is RSS and Usage RSS - Really Simple Syndication also known as Rich Site Summary. RSS feeds provide Webmasters and content providers to update their site summaries to Readers of the site. example: A blog sites are always updating by new articles daily. If a reader of that blog wanted to read newly posted articles, he or she wanted to go to the site and check whether there are any new posts available. Without going to the blog site if they can check are there any new posts available. If so, readers can check the post's title and description then by selecting particular title and log into that article directly....It'll be easier for that reader. For that owner of the blog site has to do update a xml file with summary of newly posted articles and give a link to that file. Readers have to do subscribe for that link and get that newly posted article's summ

Application Configuration FIle Visual Studio 2005

Through the application configaration file You can easily save values to later usage. you can create a application configuration file from project > Add New Item (Ctrl + Shift + A) example You want to add get string from config file Create a Config file using above step. after that insert following code to the config file. its a XML file. appsettings add key="DatabasePath" value="c:\\projects\data\spider.mdb" add key="SupportEmail" value="webmaster-1@dotnetspider.com" appsettings configuration in the coding add following Dim app As New System.Configuration.AppSettingsReader Dim s As String s = app.GetValue("DatabasePath", Type.GetType("System.String")) MessageBox.Show(s) its very easy when you are handling databases. you can store database connection string in that config for later reusabilty. Please post your comments
How To Disable Export Button In Crystal Report When you are taking crystal report printouts through a program, such as program written using vb6. you might have a problem how to disable Export button in print preview. All you have to change following property to false or Uncheck the Export option in Property Pages. You CR.WindowShowExportBtn = False Crystal Report Object in Visual Basic 6. (CR is refer to Crystal Report Object ) You can go to Property Pages by right click and choose Properties on Crystal Report Object After you done those things you crystal Report print preview will showing like follows. I was face to above problem. We implemented a software program which is written using vb6. Cashier can take daily sale print out. before printing it is showing a preview to the user. So when the time pass user click export button and saved that report as a excel file. Then he modified the values and took printout to the management. That gives Security problem to the program a