Friday, June 25, 2010

Remove duplicate characters in a string in VB


A simple code to remove duplicate characters in a string. Is there any better solution?

Public Function DuplicateTrim(ByVal Value As String) As String

Dim ASCII As Integer
Dim Temp As String

For ASCII = 33 To 126
' Get first location of the letter
If InStr(1, Value, Chr(ASCII), CompareMethod.Binary) > 0 Then
' letter exists
Temp &= Chr(ASCII)
' Remove all characters matching in original
Value = Value.Replace(Chr(ASCII), "")
End If
Next

Return Temp

End Function

How to show running serial no. in SQL SERVER Select Statement


I am working on a project where the SQL is generated at runtime depending on users selection and i am show the records from database in a Gridview control.
I am to show Running Serial Nos. as Serial No. column as the first column in the grid.

The solution to this requirement is to to genarate SR.No column in SQL as follows

SELECT ROW_NUMBER() OVER (ORDER BY ColumnName1) As Sr_No, ColumnName1, ColumnName2 FROM TableName


Monday, April 5, 2010

Sending Email from ASP.NET (C# or CSharp and VB) webpage using your Gmail email account.

C#/CShapr CODE
using System.Net.Mail;


MailMessage mail = new MailMessage();
mail.To.Add("toEmail@gmail.com");
mail.From = new MailAddress("fromEmail@gmail.com");
mail.Subject = "Subject of Email" ;

string Body = "This is a body of Email";
mail.Body = Body ;
mail.IsBodyHtml = true ;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("fromEmail@gmail.com", "yourPassword");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
try
{
smtp.Send(mail);
Label1.Text = "eMail Send OK... ";
}
catch (Exception ex)
{
Label1.Text = "Error Sending eMail: " + ex.Message.ToString();
}

--------------------
VB Code

Imports System.Net.Mail

Dim mail As New MailMessage
mail.To.Add("toEmail@gmail.com")
mail.From = New MailAddress("fromEmail@gmail.com")
mail.Subject = "Subject of Email"
Dim body As String
body = "This is a body of Email"
mail.Body = body
mail.IsBodyHtml = True
Dim smtp As New SmtpClient
smtp.Host = "smtp.gmail.com" ' //Or Your SMTP Server Address
smtp.Credentials = New System.Net.NetworkCredential _
("yourEmail@gmail.com", "yourPassword")
'Or your Smtp Email ID and Password
smtp.EnableSsl = True
Try
smtp.Send(mail)
Label1.Text = "eMail Send OK... "
Catch ex As Exception
Label1.Text = "Error Sending eMail: " + ex.Message
End Try

Wednesday, March 31, 2010

COMPUTER BASED OBJECTIVE QUESTIONS (solved)



1. The————shows all the websites and pages that you have visited over a period of time.
(A) status bar
(B) task bar
(C) history list
(D) tool bar
(E) None of these
Ans : (C)

2. A proxy server is used for the which of the following?
(A) To provide security against unauthorized users
(B) To process client requests for web pages
(C) To process client requests for database access
(D) To provide TCP/IP
(E) None of these
Ans : (A)

3. A repair for a known software bug,usually available at no charge on the internet, is called a(n)—
(A) version
(B) Patch
(C) Tutorial
(D) FAQ
(E) None of these
Ans : (B)

4. In the URL http://www.prenhall.com, the portion lebelled http is the—
(A) host
(B) domain name
(C) protocol
(D) top-level domain
(E) None of these
Ans : (C)

5. Which of the following organizations has recently given a US$ 600 million loan to Power Grid Corporation of India,a Govt. run organization?
(A) Asian Development Bank
(B) World Bank
(C) International Monetary Fund
(D) Bank of America
(E) None of these
Ans : (B)

6. The ability to easily add additional users meAns : that a network is—
(A) Scalable
(B) dedicated
(C) Decentralized
(D) Secure
(E) None of these
Ans : (A)

7. In a database, a field is a—
(A) lable
(B) table of information
(C) group of related records
(D) category of information
(E) None of these
Ans : (C)

8. The number of pixels displayed on a screen is known as the screen—
(A) resolution
(B) colour depth
(C) refresh rate
(D) viewing size
(E) None of these
Ans : (A)

9. Wor processing , spreadsheet , and phoyo-editing are example of—
(A) application software
(B) system software
(C) operating system software
(D) platform software
(E) None of these
Ans : (A)

10. If you wish to extend the length of the network without having the signal degrade, you would use a—
(A) repeater
(B) router
(C) gateway
(D) switch
(E) None of these
Ans : (A)

11. A————is approximately a million bytes.
(A) gigabyte
(B) kilobyte
(C) megabyte
(D) terabyte
(E) None of these
Ans : (C)

12. The time it takes a device to locate data and instructions and make them available to CPU is known as—
(A) clock speed
(B) a processing cycle
(C) CPU speed
(D) access time
(E) None of these
Ans : (D)

13. ——————controls the way in which the computer system functions and provides a means : by which users are interact with the computer.
(A) The platform
(B) The operating system
(C) Application software
(D) The motherboard
(E) None of these
Ans : (B)

14. ——————meAns : that the data contained in a database is accurate and reliable.
(A) Data redundancy
(B) Data integrity
(C) Data reliability
(D) Data consistency
(E) None of these
Ans : (B)

15. A(n) —————— is aprivate corporate network,used exclusively by company employees.
(A) Internet
(B) local area network
(C) peer-to-peer
(D) intranet
(E) None of these
Ans : (B)

16. A characteristic of a file server is which of the following?
(A) Manages file operations and is shared on a network
(B) Manages file operations and is limited to one PC
(C) Acts as fat client and is shared on a network
(D) Acts as fat client and is limited to one PC
(E) None of these
Ans : (A)


(Disclaimer, I Found them on internet (while searching) and publishing them on my blog also to help the world)

OBJECTIVE OR MULTIPLE CHOICE SOLVED QUESTIONS ON COMPUTER

OBJECTIVE OR MULTIPLE CHOICE SOLVED QUESTIONS ON COMPUTER


1. What is the name of the series of Laptop computers manufactured by IBM called?
1.LapPad
2.ThinkPad
3.Aptiva
4.Notepaq
Ans : 2
2. What is the name of the 64-bit Microprocessor developed by AMD?
1.Opteron
2.ISC-9000
3.iMac
4.Athlon
Ans : 1
3. Which computer periperal manufacturer quotes - Empowering your PC
1.Canon
2.Epson
3.Mercury
4.Samsung
Ans : 3
4. Nortel is a company into manufactures
1.Software
2.Processors
3.Cables
4.Network equiptment
Ans : 4
5. Who among the following is a Personal Computer manufacturer from Taiwan
1.Sony
2.IBM
3.Samsung
4.Acer
Ans : 4
6. SCSI is a term related with
1.Storage
2.Network Data Transfer
3.Keystroke Rate
4.Picture resolution
Ans : 1
7. Which company did SCO sue for using code UNIX in its Operating System?
1.RedHat
2.SuSE
3.IBM
4.Microsoft
Ans : 4
8. What are the units used to count the speed of a printer?
1.CPM
2.DPI
3.PPM
4.BIT
Ans : 4
9. Which of the following organizations looks at standards for representation of data on the Internet ?
1.ISOC
2.W3C
3.IEEE
4.IETE
Ans : 2
10. What is the other name for a LAN Card?
1.NIC
2.Network Connector
3.MODEM
4.Internet Card
Ans : 1
11. Which of the following cables can transmit data at high speeds
1.Coaxial Cable
2.Optic Fibre Cable
3.Twistedpair Cable
4.UTP Cable
Ans : 2
12. What is the name of the latest Server Operating System developed by Microsoft?
1.Windows NT
2.Windows 2000
3.Windows XP
4.Windows 2003
Ans : 4
13. Which of the following is a term related with scanners?
1.Laser
2.TWAIN
3.Catridge
4.Media
Ans : 2
14. Who is the founder of BSD Unix?
1.Bill Gates
2.Dennis Ritche
3.Bill Joy
4.Linux Torvalds
Ans : 3
15. Who is the founder of Oracle Corporation?
1.Bill Gates
2.Lars Ellison
3.Andrew S Grove
4.Marc Andreeson
Ans : 2
16. What is the name of the software that allows us to browse through web pages called?
1.Browser
2.Mail Client
3.FTP Client
4.Messenger
Ans : 1
17. Macromedia is a name of a company related with
1.Hardware
2.Software
3.Periperals
4.Services
Ans : 2
18. What is the address given to a computer connected to a network called?
1.System Address
2.SYSID
3.Process ID
4.IP Address
Ans : 4
19. Direct X is a _____
1.Computer Part
2.Software that drives Graphic hardware
3.A User Interface
4.None of these
Ans : 2
20. When you purchase a product over a Mobile Phone, the transaction is called ___
1.Web Commerce
2.e-Commerce
3.m-Commerce
4.Mobile Purchases
Ans : 3


(Disclaimer, I Found them on internet (while searching) and publishing them on my blog also to help the world)

OBJECTIVE/MULTIPLE CHOICE SOLVED QUESTIONS ON COMPUTER FOR VARIOUS COMPETITION EXAMS.


181. How many options does a binary choice offer ?
(A) None
(B) One
(C) Two
(D) It depends on the amount of memory in the computer
(E) It depends on the speed of the computer’s processor
182. Data going into the computer is called—
(A) Output
(B) Algorithm
(C) Input
(D) Calculations
(E) Flowchart
183. How many values can be represented by a single byte ?
(A) 4
(B) 16
(C) 64
(D) 256
(E) 512
184. Transformation of input into output is performed by—
(A) Peripherals
(B) Memory
(C) Storage
(D) The Input-Output unit
(E) The CPU
185. Device drivers are—
(A) Tiny power cords for external storage devices
(B) Experts who know how to maximize the performance of devices
(C) Small, special-purpose programs
(D) The innermost part of the operating system
(E) Substitutes for operating system
186. A collection of programs that controls how your computer system runs and processes information is called—
(A) Operating system
(B) Computer
(C) Office
(D) Compiler
(E) Interpreter
187. Which of the following refers to a small, single-site network ?
(A) LAN
(B) DSL
(C) RAM
(D) USB
(E) CPU
188. A set of instructions telling the computer what to do is called—
(A) Mentor(B) Instructor
(C) Compiler(D) Program
(E) Debugger
189. If you receive an e-mail from someone you don’t know, what should you do ?
(A) Forward it to the police immediately
(B) Delete it without opening it
(C) Open it and respond to them saying you don’t know them
(D) Reply and ask them for their personal information
(E) Reply and tell them you want to keep in touch with them
190. Which of the following can handle most system functions that aren’t handled directly by the operating system ?
(A) Vertical-market applications
(B) Utilities
(C) Algorithms
(D) Integrated software
(E) Compilers
191. Microsoft Office is—
(A) Shareware
(B) Public-domain software
(C) Open-source software
(D) A vertical-market application
(E) An application suite
192. Computers connected to a LAN (Local Area Network) can—
(A) Run faster
(B) Go on line
(C) Share information and/or share peripheral equipment
(D) E-mail
(E) None of these
193. Which of the following refers to the memory in your computer ?
(A) RAM
(B) DSL
(C) USB
(D) LAN
(E) CPU
194. Information travels between components on the motherboard through—
(A) Flash memory (B) CMOS
(C) Bays (D) Buses
(E) Peripherals
195. One megabyte equals approximately—
(A) 1,000 bits
(B) 1,000 bytes
(C) 1 million bytes
(D) 1 million bits
(E) 2,000 bytes
196. When you are working on a document on a PC, where is the document temporarily stored ?
(A) RAM
(B) ROM
(C) The CPU
(D) Flash memory
(E) The CD-ROM
197. How are data organized in a spreadsheet ?
(A) Lines and spaces
(B) Layers and planes
(C) Height and width
(D) Rows and columns
(E) None of these
198. Magnetic tape is not practical for applications where data must be quickly recalled because tape is—
(A) A random-access medium
(B) A sequential-access medium
(C) A read-only medium
(D) Fragile and easily damaged
(E) An expensive storage medium
199. The blinking symbol on the computer screen is called the—
(A) Mouse
(B) Logo
(C) Hand
(D) Palm
(E) Cursor
200. When cutting and pasting, the item cut is temporarily stored in—
(A) ROM
(B) Hard drive
(C) Diskette
(D) Dashboard
(E) Clipboard

Answers

181.(C) 182. (C) 183. (E) 184. (E)
185.(D) 186. (B) 187. (A) 188. (D)189.(B) 190. (A) 191. (E) 192. (C)
193.(A) 194. (D) 195. (C) 196. (A)197.(D) 198. (E) 199. (E) 200. (E)

(Disclaimer, I Found them on internet (while searching) and publishing them on my blog also to help the world)


SBI clerk Computer knowledge solved Paper

1. A Compiler is ____
(A) A combination of computer hardware
(B) A program which translates from one high-level language to another
(C) A program which translates from one high-level to a machine level
(D)None of these
Ans : C
2. When a key is pressed on the keyboard, which standard is used for converting the keystroke into the corresponding bits
(A)ANSI
(B) ASCII
(C) EBCDIC
() ISO
Ans : A
3. A Pixel is -
(A) A computer program that draws picture
(B) A picture stored in secondary memory
(C) The smallest resolvable part of a picture
(D) None of these
Ans : C
4. Which device is used as the standard pointing device in a Graphical User Environment
(A) Keyboard
(B) Mouse
(C) Joystick
(D) Track ball
Ans : B
5. Which number system is usually followed in a typical 32-bit computer?
(A) 2
(B) 10
(C) 16
(D) 32
Ans : A
6. Which of the following is not an output device?
(A)Scanner
(B) Printer
(C) Flat Screen
(D) Touch Screen
Ans : D
7. Which of the following devices have a limitation that we can only information to it but cannot erase or modify it
(A) Floppy Disk
(B) Hard Disk
(C) Tape Drive
(D) CDROM
Ans : D
8. Which technology is used in Compact disks?
(A) Mechanical
(B) Electrical
(C) Electro Magnetic
(D) Laser
Ans : D
9. Which of the following storage devices can store maximum amount of data?
(A) Floppy Disk
(B) Hard Disk
(C) Compact Disk
(D) Magneto Optic Disk
Ans : B
10. Which of the following is the largest manufacturer of Hard Disk Drives?
(A) IBM
(B) Segate
(C) Microsoft
(D) 3M
Ans : B
11. The memory location address are limited to
(A) 00000 to 9ffff(16)
(B) 00001 to 9ffff(16)
(C) 00010 to 9ffff(16)
(D) 10000 to 9ffff(16)
Ans : A
12. The programs which are as permanent as hardware and stored in ROM is known as
(A) Hardware
(B) Software
(C) Firmware
(D) ROMware
Ans : C
13. Memory is made up of
(A) Set of wires
(B) Set of circuits
(C) Large number of cells
(D) All of these
Ans : C
14. Primary memory stores
(A) Data alone
(B) Programs alone
(C) Results alone
(D) All of these
Ans : D
15. EPROM can be used for
(A) Erasing the contents of ROM
(B) Reconstructing the contents of ROM
(C) Erasing and reconstructing the contents of ROM
(DS) Duplicating ROM
Ans : C
16. Which device can understand difference between data & programs?
(A)Input device
(B) Output device
(C) Memory
(D) Microprocessor
Ans : D
17. The contents of information are stored in
(A) Memory data register
(B) Memory address register
(C) Memory access register
(D) Memory arithmetic register
Ans : A
18. Memory unit is one part of
(A) Input device
(B) Control unit
(C) Output device
(D) Central Processing Unit
Ans : D
19. Algorithm and Flow chart help us to
(A) Know the memory capacity
(B) Identify the base of a number system
(C) Direct the output to a printer
(D) Specify the problem completely and clearly
Ans : D
20. Which of the following is not a valid size of a Floppy Disk?
(A) 8″
(B) 5 1/4″
(C) 3 1/2″
(D) 5 1/2″
Ans : B

(Disclaimer, I Found them on internet (while searching) and publishing them on my blog also to help the world)