Skip to main content

Posts

Coloring in particular cells using data grid

Coloring in particular cells using data grid foreach (DataGridViewRow dataGridViewRow in dataGridView1.Rows) { DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle(); dataGridViewCellStyle.ForeColor = Color.Red; if (dataGridViewRow.Cells[2].Value != null) { if (dataGridViewRow.Cells[2].Value.ToString().Trim().Equals("M", StringComparison.CurrentCultureIgnoreCase)) { dataGridViewRow.DefaultCellStyle = dataGridViewCellStyle; } } }

code to disable ctrl+alt+del key using .net

code to disable ctrl+alt+del key using .net Use this code in .net for disable A-C-D Dim regkey As Microsoft.Win32.RegistryKey Dim subkey As String subkey = "Software\Microsoft\Windows\CurrentVersion\Policies\System" regkey = My.Computer.Registry.CurrentUser.CreateSubKey(subkey, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree) regkey.SetValue("DisableTaskMgr", 0) To Again enable A-C-D use this subkey = "Software\Microsoft\Windows\CurrentVersion\Policies\System" regkey = My.Computer.Registry.CurrentUser.CreateSubKey(subkey, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree) regkey.SetValue("DisableTaskMgr", 1) after this Restart PC and use this Function Public Sub RestartComputer() Dim t As Single Dim objWMIService, objComputer As Object 'Now get some privileges objWMIService = GetObject("Winmgmts:{impersonationLevel=impersonate,(Debug,Shutdown)}") For Each objC

MCTS 70-562 exam code of ASP.NET for 3.5 framewok

MCTS 70-562 exam code of ASP.NET for 3.5 framewok 1) MCTS 70-536 is the exam based on core framework,you can choose VB or C# any preferred language of your choice. 2) you can take the gap in between exams 3) you can download sample exam questions from net, like ucertify.com , etc. Certification books is also there by ms publications & there is lot of online material for study. 4) you can purchase online voucher from microsoft and give the exam at any prometric center in your city or you can contact your local prometric center nd ask them to purchase a voucher.Voucher cost 50$ (Rs2500/- appx.),

How to use interfaces in dotnet

How to use interfaces in  .Net An interfaces contains only the signatures of methods.The implementation of the methods is done in the class that implements the interface. SYNTAX: interface interface_name { void method1() void method2() } By default all the methods in interfaces are fully "public abstract" Example: ======= interface inter1 { void getdata(); void putdata(); } class sample1:inter1 { int eno; string ename; { public void getdata() { console.writeline("enter employee number"); eno=int.parse(console.readline()); console.writeline("enter employee name"); ename=console.readline(); } public void putdata() { console.writeline("employee number:"+eno); console.writeline("employee name:"+ename); } } class class1 { static void main () { sample1 obj=new sample1(); obj.getdata(); console,.writeline(); obj.putdata(); }

characteristic of Pythagorean

The sum of two numbers is a square. The sum of their squares is also a square. Find a method to get all such numbers. Answer let a + b = x^2 and a^2 + b^2 = y^2. the second equation is the characteristic Pythagorean triplet. so we can write a and b as p^2-1 and 2p where p is a positive integer > 1 . therefore, (p^2-1) + (2p) has to be a square number. [which is not true except for p=1/2] thus there is no base Pythagorean triplet which satisfies this relation, but multiples of them may easily do so. like: 3,4,5. 3+4 = 7 not a square. but for 21,28,35. 21 + 28 =7^2. thus (p^2+2p-1)(p^2-1) and (p^2+2p-1)(2p) or better still, q^2*(p^2+2p-1)(p^2-1) and q^2*(p^2+2p-1)(2p) satisfy the given condition, where p,q are both positive integers.

Properties of Irrational numbers

Properties of Irrational numbers If x be an irrational number then there are infinitely many relatively prime integers p and q such that | p/q - x | < 1/q^2 If x is a rational number then there are finitely many solutions to the above equation. This Theorem was first discovered by Dirichlet Further let {y} be the fractional part of y. x is an irrational number then the sequence {nx} n = 1,2,3, ... is not periodic. If x is a rational then this sequence is periodic. A rational number can be represented only by a a finite continued fraction where as an irrational number can be represented by an infinite continued fraction. Each convergent of the continued fraction representation of a irrational number is a better rational approximation of the given irrational number, than any previous convergent. Eg: The continued fraction representation of Pi is [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, ..] hence the successive rational approximation of Pi are 3, 2

fibonacci numbers in pascal's triangle

Fibonacci numbers in pascal's triangle? The Proof follows from the following identity: Let F(r) be the r-Th Fibonacci number, C(n,r) be the number of combination of n things taken are at a time and [x] be the greatest integer function then Summation C(n-k, k) = F(n+1) where k goes form k=0 to k = [n/2] Now use induction on the variable n.