Explain how to convert data in legacy code page formats to the Unicode format.

1 Answer

Answer :

You can use the Encoding.Convert method to convert data between encoding types. This method requires instances of both encoding types and an array of bytes that represents the data to be converted. It returns an array of bytes in the target format. You can convert a string or array of chars to an array of bytes with the Encoding.GetBytes method and can convert an array of bytes back to chars with the Encoding.GetChars method.

Related questions

Description : Is string Unicode, ASCII, or something else? 

Last Answer : Unicode

Description : Briefly explain how to convert a string representation of a number to a numeric type, such as an Integer or a Double.

Last Answer : All numeric data types have a Parse method that accepts a string parameter and returns the value represented by that string cast to the appropriate data type. You can use the Parse method of each data type to convert strings to that type.

Description : How do you change the VOB (dvd recorded format) into AVI or other editable formats?

Last Answer : Try Handbrake and convert it to something else. Are they vob files?

Description : What is the "best" lossless compression format for compression+archive formats?

Last Answer : That's a tough question to answer. Different compression schemes are better at compressing different kinds of data. I generally use BZ2 and I've been seeing it steadily increase in usage. BZ2 ... to be compression) so you could always do some benchmarking yourself to answer the question precisely.

Description : How do you convert a value-type to a reference-type?

Last Answer : Use Boxing.

Description : How do you convert a value-type to a reference-type? 

Last Answer : Use Boxing.

Description : Explain the most used alphanumeric code before Unicode. ?

Last Answer : The most used alphanumeric code before Unicode is ASCII code. The American Standard Code for Information Interchange stands for ASCII or ASCII. In 1975, Robert Beamer invented the seven-bit ASCII code. ASCII ... can be used to specify 2 or 256 unique symbols. Currently ASCII-8 refers to ASCII code.

Description : What is the lifespan for items stored in ViewState? Select Answer:  1. Item stored in ViewState exist for the life of the current page  2. Item stored in ViewState exist for the life ... of the current Applicaiton  4. Item stored in ViewState exist for the life of the current configuration

Last Answer : 1. Item stored in ViewState exist for the life of the current page AS any web application works on request and response basis ,so on every post backs, The data in control gets lost. To retain page ... control with data. The life cycle of the view state exist for life of current running page only. 

Description : Is there anything that can convert .pdf into one of the normal Kindle file formats?

Last Answer : Calibre can, or you can just email the PDF to your @kindle.com address and it will convert automatically.

Description : Can I Convert my PDF files in text Formats?

Last Answer : Seriously people, google is your friend, USE IT!

Description : I am looking for a free way to convert an flv file to other formats, do you have any idea where I can find this?(yes I searched)

Last Answer : http://www.zamzar.com/

Description : Briefly highlight the differences between imperative and declarative security as they pertain to code access security.

Last Answer : Imperative security is implemented by calling methods of Permission objects in code at run time. Declarative security is configured by attaching attributes representing permissions to classes ... request assembly-wide permissions using the Assembly (assembly) directive with declarative security.

Description : Describe how to use code to retrieve resources at run time.

Last Answer : You must first create an instance of the ResourceManager class that is associated with the assembly that contains the desired resource. You can then use the GetString method to retrieve string resources or the GetObject method to retrieve object resources.

Description : Describe how to retrieve the ASCII key code from a keystroke. How would you retrieve key combinations for non-ASCII keys?

Last Answer : Keystrokes can be intercepted by handling the KeyPress and KeyDown events. Both of these events relay information to their handling methods in the form of their EventArgs. The KeyPressEventArgs, ... you would handle the KeyDown event and use the properties exposed by the KeyEventArgs instance.

Description : What is unsafe code?

Last Answer : Unsafe code bypasses type safety and memory management.  

Description : Write code to use threading and the lock keyword. 

Last Answer : using System; using System.Threading; namespace ConsoleApplication4 { class Class1 { [STAThread] static void Main(string[] args) { ThreadClass tc1 = new ThreadClass(1); ThreadClass tc2 = new ThreadClass( ... Console.WriteLine(threadNumber + " working"); Thread.Sleep(1000); } } } } }

Description : Write code to define and use your own custom attribute.

Last Answer : (From MSDN) // cs_attributes_retr.cs using System; [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple=true)] public class Author : Attribute { public Author(string name) { this.name ... double version; string name; public string GetName() { return name; } }

Description : Write some code to declare and use properties.

Last Answer : // instance public string InstancePr { get { return a; } set { a = value; } } //read-only static public static int ClassPr { get { return b; } }

Description : Write some code to implement an indexer.

Last Answer : using System; namespace Console1 { class Class1 { static void Main(string[] args) { MyIndexableClass m = new MyIndexableClass(); Console.WriteLine(m[0]); Console.WriteLine(m[1]); Console.WriteLine(m[2]); Console. ... get { return myData[i]; } set { myData[i] = value; } } } }

Description : Write some code that uses an ArrayList.

Last Answer : ArrayList list = new ArrayList(); list.Add("Hello"); list.Add("World");

Description : Write some code to implement a jagged array. 

Last Answer : // Declare the array of two elements: int[][] myArray = new int[2][]; // Initialize the elements: myArray[0] = new int[5] {1,3,5,7,9}; myArray[1] = new int[4] {2,4,6,8};

Description : Write some code to implement a multidimensional array.

Last Answer : int[,] b = {{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}}; 

Description : Write some code for a custom collection class.

Last Answer : using System; using System.Collections; public class Items : IEnumerable { private string[] contents; public Items(string[] contents) { this.contents = contents; } public IEnumerator GetEnumerator() { ... (string item in items) { Console.WriteLine(item); } Console.ReadLine(); } }

Description : Write some code that declares an array on ints, assigns the values: 0,1,2,5,7,8,11 to that array and use a foreach to do something with those values.

Last Answer : int x = 0, y = 0; int[] arr = new int [] {0,1,2}; foreach (int i in arr) { if (i%2 == 0) x++; else y++; }

Description : Write some code for do… while.

Last Answer : int x; int y = 0; do { x = y++; Console.WriteLine(x); } while(y < 5);

Description : Write some code for a while loop. 

Last Answer : int n = 1; while (n < 6) { Console.WriteLine("Current value of n is {0}", n); n++; }

Description : Write some code for a for loop 

Last Answer : for (int i = 1; i <= 5; i++) Console.WriteLine(i);

Description : Write some if… else if… code.

Last Answer : int n=4; if (n==1)  Console.WriteLine("n=1"); else if (n==2) Console.WriteLine("n=2"); else if (n==3) Console.WriteLine("n=3"); else Console.WriteLine("n>3");

Description : Write some try…catch…finally code.

Last Answer : // try-catch-finally using System; public class TCFClass { public static void Main () { try { throw new NullReferenceException(); } catch(NullReferenceException e) { Console.WriteLine("{0} exception 1 ... ("exception 2."); } finally { Console.WriteLine("finally block."); } } }

Description : Write some code to overload an operator. 

Last Answer : class TempleCompare { public int templeCompareID; public int templeValue; public static bool operator == (TempleCompare x, TempleCompare y) { return (x.templeValue == y.templeValue); } ... templeValue); } public override int GetHashCode() { return templeCompareID; } }

Description : Write code for a case statement. 

Last Answer : switch (n) { case 1: x=1; break; case 2: x=2; break; default: goto case 1; }

Description : Write code for an enumeration. 

Last Answer : public enum animals {Dog=1,Cat,Bear}; 

Description : Write some code to box and unbox a value type. 

Last Answer : // Boxing int i = 4; object o = i; // Unboxing i = (int) o;

Description : Write some code to use a delegate. 

Last Answer : Member function with a parameter using System; namespace Console1 { class Class1 { delegate void myDelegate(int parameter1); static void Main(string[] args) { MyClass myInstance = new ... void AMethod(int param1) { Console.WriteLine(param1); } } }

Description : Write code to show how a method can accept a varying number of parameters.

Last Answer : using System; namespace Console1 { class Class1 { static void Main(string[] args) { ParamsMethod(1,"example"); ParamsMethod(1,2,3,4); Console.ReadLine(); } static void ... o in list) { Console.WriteLine(o.ToString()); } } } }

Description : Write some code using interfaces, virtual methods, and an abstract class.

Last Answer : using System; public interface Iexample1 { int MyMethod1(); } public interface Iexample2 { int MyMethod2(); } public abstract class ABSExample : Iexample1, Iexample2 { public ABSExample( ... override void VIRTMethod2() { System.Console.WriteLine("VIRTMethod2 has been overridden"); } }

Description : Why is the virtual keyword used in code?

Last Answer : The Virtual keyword is used in code to define methods and the properties that can be overridden in derived classes.

Description : Define what is a code group?

Last Answer : A code group is a set of assemblies that share a security context.

Description : Explain how properties differ from fields. Why would you expose public data through properties instead of fields?

Last Answer : Properties allow validation code to execute when values are accessed or changed. This allows you to impose some measure of control over when and how values are read or changed. Fields cannot perform validation when being read or set.

Description : Describe how to use a DataView to filter or sort data.

Last Answer : You can apply sort criteria to a DataView by setting the Sort property to the name of a column or columns to be sorted by. The data represented in a DataView object can be filtered by setting the RowFilter property to a valid filter expression.

Description : How can you manage data currency on a form with several bound controls?

Last Answer : Every data source on a form has an associated CurrencyManager object that keeps that of the current record with respect to bound controls. For convenience, all of the CurrencyManager objects ... property. The Position of the CurrencyManager can be changed, allowing navigation through the records. 

Description : Briefly contrast connected and disconnected data access in ADO.NET.

Last Answer : In ADO.NET, connected data access is available through the DataReader, which is a lightweight class designed to provide very fast and efficient data access. It is severely limited, however, in ... to update the database and keeping the connection open just long enough to execute those commands.

Description : What are the major components of a Data Provider, and what function does each fulfill?

Last Answer : An ADO.NET Data Provider is a suite of components designed to facilitate data access. Every Data Provider minimally includes a Connection object that provides the actual connection to the data ... only, read-only access to a database, and a DataAdapter that facilitates disconnected data access.

Description : Can you store multiple data types in System.Array?

Last Answer : No. 

Description : What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

Last Answer : SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. ... on top of the OLE layer, so it's not as fastest and efficient as SqlServer.NET.

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

Last Answer : SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. ... on top of the OLE layer, so it's not as fastest and efficient as SqlServer.NET.

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : Define what is meant by data encapsulation?

Last Answer : Data encapsulation also referred to as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user. The user can only perform a restricted set of operations on the hidden members of the class by executing special functions called methods.

Description : Define what are the two data types available in C#?

Last Answer : Value type Reference type