VBNET

VBNET is an object-oriented programming (OOP) language developed by Microsoft. It is the .NET version of Visual Basic, which supports OOP concepts like aggregation, modularity, abstraction, encapsulation, inheritance and polymorphism.

1,287 Questions
Java Programming
.NET Programming
VBNET

Can a try block have more than one catch block?

It can have as many as you want. It allows you to catch very specific exceptions.

--

Ac352 Answer

Having more than one catch statement is a bad idea. A better approach is to analyze the error and go from their. Here is an example.

Try

My.Computer.FileSystem.DeleteFile("C:\TEST.txt")

Catch ex As Exception

If ex.Message.Tostring="C:\TEST.txt Is An Invalid File Location" Then

'Do what you want to do.

End If

End Try

That is the best way just keep adding ElseIf statements to cover all exceptions that you want to find.

271272273
Visual Basic Programming
VBNET

How do you convert non alphanumeric characters in visual basic?

Try using entities, &, pictureboxes and make a picture. Because any non numeric character can only be as string, because it can't be a number. And remember to use the quotation marks.

--

Real Answer by AC352

You can't do it directly in vb.net. You need to read it from a file,

lines = System.IO.File.ReadAllLines("C:\TEST.txt, System.Text.Encoding.Default)

when you put the System.Text.Encoding.Default you will be able to read the non alphanumeric characters.

249250251
C Programming
Computer Programming
DIY Projects
VBNET

How do you make mobile application with VB.NET?

You would have to use a version of Visual Studio that can target the .Net Compact Framework. Be aware that the Compact Framework is a SUBset of the .Net Framework, so there will be some missing classes and methods.

229230231
.NET Programming
VBNET
ASP.NET

Which is the good language vb net or asp net?

Both VB.NET and ASP.NET use the ".NET" language. The implementation is different, though. VB.NET is a new version of BASIC and is used in Visual Basic programming for designing custom graphical user interfaces for windows applications. ASP.NET is the same language, but designed as a server side language for webpages.

The syntax and keywords of both languages is .NET, the implementation is the difference.

195196197
VBNET
C Sharp

Is System.String a class or a struct?

System.String is a class. However, it is somewhat unique in that it is immutable, meaning that it is readonly. So if you change the contents of a string, behind the scenes it creates a new string object and destroys the old one.

171172173
Computer Programming
Visual Basic Programming
VBNET

How do you restore a form after closing another in VB?

Suppose you have form 1, form 2 and form 3. form1 and form2 are showing. You press a button on form1 and form2 dissapears but form 3 shows. The code to the button would be as simple as this:

Form2.Hide()

Form3.Show()

And when you want to close a form make sure you use Hide() not Close() if you want to be able to restore it later.

if you want to re open form2 but hide form form3 then just reverse it and also you should be able to use me.hide

161162163
Visual Basic Programming
VBNET

Free download visual basic.net 2008?

msdn.com(Express version). Make sure you have a windows live/hotmail account though because you will need it to get the express version free.

159160161
VBNET

What is a collection of unorganized facts?

DATA

131415
VBNET
C++ Programming

What is the difference between a structure and a class?

The struct default access type is public. A struct shouldtypically be used for grouping data.

The class default access type is private, and the default mode for inheritance is private. A class should be used for grouping data and methods that operate on that data.

In short, the convention is to use struct when the purpose is to group data, and use classes when we require data abstraction and, perhaps inheritance.

In C++ structures and classes are passed by value, unless explicitly de-referenced. In other languages classes and structures may have distinct semantics - ie. objects (instances of classes) may be passed by reference and structures may be passed by value.
Technically there are only two differences between classes and structures:

  1. classes are declared using the keyword class while structures are declared using the keyword struct
  2. structures are entirely public, while classes are private by default

Most C++ programmers use structures exclusively for data that doesn't require strict validation while classes are used to encapsulate data and the functions that work exclusively with that data. Although classes and structures can largely achieve the same goals, the lack of encapsulation and data-hiding in a structure make it far less robust than a well-designed class would be, with little or no difference in terms of memory consumption. Encapsulation comes into its own when classes become highly-complex (classes within classes) as each class is responsible only for its own data, not the classes it contains. Structures can be just as complex, but because they don't have the safeguards that can built into classes, it only takes one errant function to unwittingly invalidate data. A well-designed class ensures data validity at all times.

125126127
Ancient History
Economics
Chinese Dynasties
VBNET

What is the first rule in accounting?

The equation must be ALWAYS equal.

109110111
Computer Hardware
VBNET
Windows Registry

What is full form of S.S.D.D.?

Single Sided, Double Density This is a floppy disk format.

113114115
VBNET
C Sharp

Difference between vb net and c sharp?

Both languages use the same .NET Framework, so the functionality available to you is very similar. They are both OOP languages.

The differences are mostly syntactical. VB tends to be more verbose than C#.

In fact, 3rd party programs exist that will convert C# code to VB.NET or vice-versa. So the choice of which to use is personal preference.

107108109
.NET Programming
Visual Basic Programming
VBNET

What is app.helpfile in vbnet?

For providing context-sensitive help to VB5 and Vb6 applications, we can set the property called App.helpfile and hook-up the helpfile with the application.

For VB 5 and above one can use .hlp files as help files. For Vb6 and above one can use .chm files as application help files.

In VB.NET this property is not used for providing F1 help to the applications. Instead a control named - Helpprovider is dropped on the form and configured for associating help topics frm the .chm file to the form controls.

107108109
VBNET

Write a program to generate the Fibonacci Series?

#include

#include

main()

{

int n,i,c,a=0,b=1;

printf("Enter Fibonacci series of nth term : ");

scanf("%d",&n);

printf("%d %d ",a,b);

for(i=0;i<=(n-3);i++)

{

c=a+b;

a=b;

b=c;

printf("%d ",c);

}

getch();

}

Output :

Enter Fibonacci series of nth term : 7

0 1 1 2 3 5 8

Answer 2:/************************************************************************* Fibonacci In a Fibonacci series each number is the sum of the two previous numbers. This program calculates Fibonacci numbers within an 8-bit range, ;************************************************************************/

#include < p18f452.h >

//these memory locations hold the Fibonacci series

unsigned char fib0; //lowest number

//(oldest when going up, newest when reversing down)

unsigned int fib1; //middle number

unsigned float fib2; //highest number

unsigned double fibtemp; //temporary location for newest number

main ()

{

counter 3; //have preloaded the first three numbers, so start at 3

fib0 0;

fib1 1;

fib2 1;

loop: do

{

float test0;

fibtemp fib1 + fib2;

counter counter + 1;

//now shuffle numbers held, discarding the oldest

fib0 fib1; //first move middle number, to overwrite oldest

fib1 fib2;

fib2 fibtemp;

}

while (counter<12):

//when reversing down, we will subtract fib0 from fib1 to form new fib0

do

{

fibtemp fib1 - fib0; //latest number now placed in fibtemp

counter counter - 1;

//now shuffle numbers held, discarding the oldest

fib2 fib1; //first move middle number, to overwrite oldest

fib1 fib0;

fib0 = fibtemp;

}

while (fib0>0);

go to loop

return 10;

}

tell me problem

838485
Jobs & Education
VBNET
C Sharp

What did the delegates do to solve the problem of how many representatives each state can have?

This issue all goes back to the Constitutional Convention, when there was an issue of big states vs. small states. After a heated debate, the Great Compromise was proposed by Roger Sherman, which created a bicameral legislature. Each states would have equal representation in the Senate (satisfied the small states) and the size of the population of each state would determine the state's representation in the House of Representatives (satisfied the big states). There is also a similar case in the state of Alabama in which the state legislature were apportioned and assigned to districts, based on populations. This supreme court case is known as Reynolds v. Sims.

919293
Java Programming
C Programming
VBNET

Write a Java program to find occurrences of given word in a text?

/*this block of code fineds any given string in tree different file

displays the string and prints the number of occurences in these file....thats all:)*/

package useToken;

import java.io.*;

class readFile extends StreamTokenizer {

readFile(InputStream in ){

super(in);

}

public static void main (String argv[]){

try {

int ret;

String string;

BufferedReader in =

new BufferedReader (newInputStreamReader(System.in));

System.out.print("Enter some text: ");

string = in.readLine();

String[] file = {"file1.txt","file2.txt","file3.txt"};

for(int i=0;i<3;i++){

FileInputStream fin = new FileInputStream(file[i]);

readFile rt = new readFile(fin);

int counter =0;

while((ret = rt.nextToken())!= 0 && rt.sval != null){

if(rt.sval.equals(string)){

System.out.println("Found Text :" + rt.sval );

counter++;

}

}

System.out.println("The String Found :" + counter + " " + "times");

System.out.println(file[i] + " " + "Complete");

}

} catch (Exception e ){

System.err.println("Exception :" + e);

}

}

}

Write a program to find the frequency of words in a sentence in java programing?

//program to find occurence of a word in a sentence

import java.io.*;

public class cnt2

{

public static void main(String args[])throws IOException

{

int times=0,count=0,x=0,no=0;

InputStreamReader ir=new InputStreamReader(System.in);

BufferedReader br=new BufferedReader(ir);

String s,w;

System.out.println("Enter the sentence:");

s=br.readLine();

System.out.println("Enter the word:");

w=br.readLine();

try{

for(int i=0;i

{

if(w.charAt(0)==s.charAt(i))

{

for(int j=0;j

{

if(s.charAt(i)==w.charAt(j))

{ count=count+1;}

if(count==w.length())

{no=no+1;count=0;};

}

}

}

catch(Exception e){}

if(no==0)

{

System.out.println("word is not present");

}

else

{

System.out.println("word is present "+no+" times");

}

}

}

878889
Visual Basic Programming
VBNET

What does a class mean in VB.NET?

Imagine a class as some group of information for describing an object in real life, forget about programming. A class is something that does not yet exists. Its something only on paper. A design. A set of information for giving later a real instance to its real content. Class-oriented programming gives to the programmer (and the program itself) the extreme ability to be easy serviced and easy upgraded. Its more likely the easiest way to understand better what the code does, even if that code is very big in size.

a class can be analogous with any real life object like "Table". now if we need to define its properties like length, with , height etc, and calculations like volume, surface area etc. like that while programming if something has few particular properties and methods to be performed upon, those can be consolidated in a class. i.e in a class we can consolidate the properties and methods of something, which can be instantiated later on

899091
Banking
Database Programming
VBNET

Working of ATM with the help of a block diagram?

http://www.cisco.com/en/US/products/hw/switches/ps718/products_implementation_design_guide_chapter09186a00800f0a41.html


check it out



regards: rohit
http://vermazz.blogspot.com/

878889
VBNET

What makes GUI tools to easier to work with when compared to non GUI tools in visual basic?

GUI use full quality of vedio card and make the programming languages easy to draw perfect images and pictures on desktop.

848586
Web Browsers
Visual Basic Programming
VBNET
The Difference Between

What is combo box?

It's an interface element in Microsoft Visual Studio and Borland Builder (Codegear). It's a dropping down list of items which you can choose and edit.

838485
Definitions
VBNET
C Sharp

Full form of net?

What is .net fullform?

Ans- network enabled technologies

474849
.NET Programming
Visual Basic Programming
VBNET

What does Dim means in VB.net?

DIM stands for declaration in memory. the words DIM is used to declare a variable.

Yes Correct, I used to declare variable.

I think it means Dimension, Dimension Of the memory location

The original Basic language did not require or have a type definition. All variables were numeric with no distinction between integer and real/float. Assigning space for a variable was easy, they were all the same type and size.

Some Basic implementations, using variable name modification, later added character variables by a dollar sign appended (varname$) and an integer type with a percent sign (varname%) leaving the unsuffixed version as it originally was. You were allowed to have all three versions of a name in play at the same time so Basic still had no type declarations.

For an array, you needed to tell Basic how much space to allocate for the array. Some of the more used languages at that time (e.g. fortran) used a"Dimension" keyword for this and Basic similarly used a shorter DIM statement.

Being that the designers of VB were implementing a version of Basic and they did need a type declaration, I would guess they decided to use the closest thing available: A DIM statement.

737475
Java Programming
VBNET
C Sharp

What is the difference between actual and formal parameters?

Formal parameters are the parameters as they are known in the function definition. Actual parameters (also known as arguments) are what are passed by the caller. For example, in the following code, a and b are the formal parameters, and x and y are the actual parameters:

int max(int a, int b) {
if (a > b) return a;
else return b;
}

int m = max(x, y);

333435
Computers
Java Programming
VBNET
C++ Programming

Example for Encapsulation?

The term "encapsulation" is usually used to point up the advantage of Object Oriented method in computer programming approach. It means that in Object-Oriented approach, an object is encapsulated from any other object there is. Everything inside an object, cannot be "touched" (accessed) by any other object within the program, unless it is permitted to be.

So whenever we want any property of an object (constants, variables, functions, or procedures) to be revealed to others, we just have to set it as a "Public" property (usually done by typing the word "Public" in the beginning of its declaration). And when we don't want it to be, we set it as "Private".

And encapsulation is an advantage because as the programming goes on, we don't have to worry about the same constant, variable, function, or procedure's name within the whole program. Every object has its own properties, and can only be accessed if it was allowed.

616263
Visual Basic Programming
VBNET
The Difference Between

What is class in VB.NET?

Answers
  • A class means collection of methods/functions. Method/function accepts parameters, process set of codes which you have written in the module/function and returns the output to the caller. Collection of class is called Class Library. When you complie the Class Library it becomes a DLL.
  • A class is simply an abstract model used to define new data types. A class may contain any combination of encapsulated data (fields or member variables), operations that can be performed on the data (methods) and accessors to data (properties). For example, there is a class String in the System namespace of .Net Framework Class Library (FCL). This class contains an array of characters (data) and provide different operations (methods) that can be applied to its data like ToLowerCase(), Trim(), Substring(), etc. It also has some properties like Length (used to find the length of the string).
  • A class in VB.Net is declared using the keyword Class and its members are enclosed with the End Class marker
575859

Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.