Free Essay

Ead Quiz Solution

In:

Submitted By imranpu
Words 757
Pages 4
EAD Quiz 1
Total Marks: 100 Time: 1:10 Minutes Marks Obtained:
Name: _____________________________________ Roll Number: ____________
Question(1) MCQs
Select one option only.
1. repository of shared assemblies maintained by the .NET runtime is called
a. assembly line
b. Assembly contents
c. Assembly manifest
d. Global Assembly cache
2. Which key is used for step into in debugging
a. F7
b. F12
c. F11
d. F10
3. Which command is used to create exe file using csc command a csc File.cs b csc /out:My.exe File.cs c none d both (a,b)
4. --------namespace is used for ado.net with data adapter a. System.io; b. System.SqlAdapter 3. System.Data 4. System.SqlDb

5. To convert reference type variable into simple type (value) is
a. Unboxing
b. Boxing

Question(2) ( 5 Marks each)
Short Answers: 1. Write differences between CLS and CLR CLS specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross language inheritance and cross language debugging.
.Net Framework provides runtime environment called Common Language Runtime (CLR).It provides an environment to run all the .Net Programs. 2. Write a function that takes any number of strings and an integer. Write only prototype and call this function using named argument
Public void myFunc(int num, params string[] args); myFunc(1,”Ali”,”Ahmad”);
3. What is return type of following methods? ExecuteNonQuery() | int | ExecuteScalar() | object | ExecuteReader | SqlDataReader |

4. fill in the following table for n-tier architecture only write yes or not Scalability | Yes | Better security | Yes | Fault tolerance | Yes | Performance | No | Maintenance | Yes |

5) suppose a data table student(id,name,email) exist in memory. Write code to fetch the student who have name asad and email address is of gmail.
Student.Select(“name=asad and email like %gmail% ”);
6. Consider table as mentioned in above question. Write code to get student with primary key value as 11. Student.Rows.Find(11); Question 03: 10 a) Write output of following code static void Method(ref int i) { . i =5; } static void Main() { int val; Method(ref val); Console.WriteLine(val); }

Answer: Error: when you pass a variable by reference then it must be initialized before calling b) Define object initializer in C#. Write code to initialize an object called sttudentinfo with anonymous type having attributes name, age;
Object initializers let you assign values to any accessible fields or properties of an object at creation time without having to invoke a constructor followed by lines of assignment statements.
Var studentinfo=new {age=11, name=”Ali”};

Question(3) (20)
Suppose You have a file program.cs. You have to write a function that takes name of file as argument and an old string and new string. Replace all occurrences of old string by new strings and display total number of replacements per line
Public static Replace(string filename, string old, string new)
{
StreamReader sr=new StreamReader(filename); String line=sr.ReadLine(); List<string> list=new List<string>(); String newline=””;
While (line!=null) { Count=0; String[] items=line.Splite(‘ ’); for (int index = 0; index < items.Length; index++) { if (items[index] == old) { items[index] = new; count++; } newline+=items[index]+” ”; } List.Add(newline); Console.WriteLine(“Total replacements in line are ”+ count); line=sr.ReadLine(); }
Sr.Close();
StreamWriter sw=new StreamWriter(filename); foreach (var line in list)
{
Sw.WriteLine(line); }
}

Question 04) Suppose you have two tables Student (id, name, rollno, contactid,cgpa) and Contacts(id, email, phone, address)
Write following functions (20) 1) LoadTables() //load data from tables in memory datasets using data adapter and build relations 2) GetStudentName(string email); // return the producer name using parent-child relation 3) Update email of students whose name is ALI 4) Calculate the average cgpa of all students

Public void LoadTable()
{
DataSet ds=new DataSet(); string connectionString = @”whatever"; SqlConnection connection = new SqlConnection(connectionString); string query = "select * from Student;"; SqlCommand cmd = new SqlCommand(query, connection);
SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; da.Fill(ds,”student”); da.SelectCommand.Text=”select * from Contacts ” da.Fill(ds,”Contacts”); DataRelation std = new DataRelation("std", Ds.Tables[1].Columns["Id"],ds.Tables[0].Columns["ContactidId"]); ds.Relations.Add(std); }
Void GetStudentName(string email)
{
Var row=ds.Tables[1].Select(“email=”+email) DataRow[] childRows = row[0].GetChildRows("std"); // write a loop and display names
}
Void UpdateEmail(string name)
{
Var row=ds.Tables[0].Select(“name=”+name) DataRow r = row[0].GetParentRow("std"); r[“Email”]=’abc@yahoo.com’;
}
CalculateCGPA()
{
Var avg=ds.Tables[0].Compute(“Avg(cgpa)”,””);
}

Similar Documents

Free Essay

Culture

...Learning Outcomes By the time you finish this chapter you will be able to LO 5.1 Identify the essential elements of successful reading. LO 5.2 Explain how to improve concentration and read more effectively. LO 5.3 Discuss techniques for memorizing large amounts of information. LO 5.4 Analyze how best to retain what you have read. Page 104 “R ead the next chapter in the textbook by Tuesday.” “Read the first two articles in the course pack by next class.” “The test will cover the first hundred pages in your book, so be sure you've read it.” One day, three different reading assignments, Jeff Knowles thought as the instructor of his last class of the day delivered this last instruction to read. It would be hard enough for Jeff to complete all this reading during an ordinary week. But this week he had to finish painting his garage and had volunteered to help his brother move. On top of that, there was his part-time landscaping job—and, Jeff suddenly remembered, he'd agreed to work overtime on Friday. Still, Jeff figured that even with all his work, family, and household obligations, he could still find time to do all his reading—except Jeff believed he was an unusually slow reader. When he pushed himself to read quicker and absorb more, he actually read and retained less. For Jeff, the problem wasn't just completing the reading—it was remembering it when test time rolled around. LookingAhead For people like Jeff, reading assignments are the biggest challenge...

Words: 10456 - Pages: 42

Premium Essay

Sociology in Our Times

...Licensed to: CengageBrain User Licensed to: CengageBrain User This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for materials in your areas of interest. Copyright 2011 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. Licensed to: CengageBrain User Sociology in Our Times: Ninth Edition Diana Kendall Sponsoring Editor: Erin Mitchell Developmental Editor: Renee Deljon/Kristin Makarewycz Freelance Development Editor: Tricia Louvar Assistant Editor: Linda Stewart Editorial Assistant: Mallory Ortberg Media Editor: Mary Noel Marketing Manager: Andrew Keay ...

Words: 24544 - Pages: 99

Premium Essay

Cataolog

...ork2012 - 2013 Catalog A Message from the President “Sullivan University is truly a unique and student success focused institution.” I have shared that statement with numerous groups and it simply summarizes my basic philosophy of what Sullivan is all about. When I say that Sullivan is “student success focused,” I feel as President that I owe a definition of this statement to all who are considering Sullivan University. First, Sullivan is unique among institutions of higher education with its innovative, career-first curriculum. You can earn a career diploma or certificate in a year or less and then accept employment while still being able to complete your associate, bachelor’s, master’s or doctoral degree by attending during the day, evenings, weekends, or online. Business and industry do not expand or hire new employees only in May or June each year. Yet most institutions of higher education operate on a nine-month school year with almost everyone graduating in May. We remained focused on your success and education, and continue to offer our students the opportunity to begin classes or to graduate four times a year with our flexible, year-round full-time schedule of classes. If you really want to attend a school where your needs (your real needs) come first, consider Sullivan University. I believe we can help you exceed your expectations. Since words cannot fully describe the atmosphere at Sullivan University, please accept my personal invitation to visit and experience...

Words: 103133 - Pages: 413

Premium Essay

Organizational Behavior

...ORGANIZATIONAL BEHAVIOR CONCEPTS CONTROVERSIES APPLICATIONS Seventh Edition Stephen P. Robbins 1996 Contents Part One • Introduction Chapter 1 What Is Organizational Behavior? 2 Chapter 2 Responding to Global and Cultural Diversity 42 Part Two • The Individual Chapter 3 Foundations of Individual Behavior 80 Chapter 4 Perception and Individual Decision Making 130 Chapter 5 Values, Attitudes, and Job Satisfaction 172 Chapter 6 Basic Motivation Concepts 210 Chapter 7 Motivation: From Concepts to Applications 250 Part Three • The Group Chapter 8 Foundations of Group Behavior 292 Chapter 9 Understanding Work Teams 344 Chapter 10 Communication 374 Chapter 11 Leadership 410 Chapter 12 Power and Politics 460 Chapter 13 Conflict, Negotiation, and Intergroup Behavior 502 Part Four - The Organization System Chapter 14 Foundations of Organization Structure 548 Chapter 15 Technology, Work Design, and Stress 588 Chapter 16 Human Resource Policies and Practices 634 Chapter 17 Organizational Culture 678 Part Five - Organizational Dynamics Chapter 18 Organizational Change and Development 714 CHAPTER I • WHAT IS ORGANIZATIONAL BEHAVIOR? What Managers Do Let’s begin by briefly defining the terms manager and the place where managers work—the organization. Then let’s look at the manager’s job; specifically, what do managers do? Managers get things done through other people. They make decisions, allocate resources, and direct the activities of others to attain goals. Managers do...

Words: 146017 - Pages: 585

Free Essay

Bush

...FAMILY OF SECRETS The Bush Dynasty, America’s Invisible Government, and the Hidden History of the Last Fifty Years RUSS BAKER Contents Foreword by James Moore 1. How Did Bush Happen? 2. Poppy’s Secret 3. Viva Zapata 4. Where Was Poppy? 5. Oswald’s Friend 6. The Hit 7. After Camelot 8. Wings for W. 9. The Nixonian Bushes 10. Downing Nixon, Part I: The Setup 11. Downing Nixon, Part II: The Execution 12. In from the Cold 13. Poppy’s Proxy and the Saudis 14. Poppy’s Web 15. The Handoff 16. The Quacking Duck 17. Playing Hardball 18. Meet the Help 19. The Conversion 20. The Skeleton in W.’s Closet 21. Shock and . . . Oil? 22. Deflection for Reelection 23. Domestic Disturbance 24. Conclusion Afterword Author’s Note Acknowledgments Notes Foreword When a governor or any state official seeks elective national office, his (or her) reputation and what the country knows about the candidate’s background is initially determined by the work of local and regional media. Generally, those journalists do a competent job of reporting on the prospect’s record. In the case of Governor George W. Bush, Texas reporters had written numerous stories about his failed businesses in the oil patch, the dubious land grab and questionable funding behind a new stadium for Bush’s baseball team, the Texas Rangers, and his various political contradictions and hypocrisies while serving in Austin. I was one of those Texas journalists. I spent about a decade...

Words: 249168 - Pages: 997