Skip to main content

Posts

Showing posts from August, 2012

C sharp donet code to Get Single query Data

C sharp donet code to Get Single query Data . Use following code in common class . static public string getSingleQueryData(string _Querystr) { string Connstr= ""; OleDbConnection connection = null; OleDbDataAdapter adp = null; OleDbCommandBuilder oleDbCommandBuilder = null; DataTable dataTable = null; string _strReturn = ""; Connstr= ConfigurationSettings.AppSettings["strconnection"]; connection = new OleDbConnection(strconnection); connection.Open(); adp = new OleDbDataAdapter(_Querystr, connection); oleDbCommandBuilder = new OleDbCommandBuilder(adp); dataTable = new DataTable(); adp.Fill(dataTable); connection.Close(); if (dataTable.Rows.Count > 0) { _strReturn = dataTable.Rows[0][0].ToString(); } return _strReturn; }

System monitoring or tooling for SQL

System monitoring or tooling for SQL •SQL Server Pro-filer •System monitoring / Perform/ PAL tool •Activity Monitor (SQL Server Management Studio) •Event logs, SQL logs •Dynamic Management Views (DMVs) / standard reports •SQL trace (sp_traceTSQL) •System Stored Procedures (sp_who, sp_lock…) •DBCC statements •Built-in functions (@@CPU_BUSY, @@CONNECTIONS…) •Trace Flags •Database Engine Tuning Advisers

Examples of Sql complex select queries

Examples of Sql complex select queries select count(MGR),count(sal) from salesmans; select ename,(sal+nvl(comm,0)) as totalsal from salesmans; select * from salesmans where sal> any(select sal from salesmans where sal<3000); select * from salesmans where sal> all(select sal from salesmans where sal<3000); select ename,deptno,sal from salesmans order by deptno,sal desc; Create table salesmans1 as select * from salesmans where 1=2; Select * from salesmans where sal>=1000 And sal<2000; select * from salesmans where rowid in (select decode(mod(rownum,2),0,rowid, null) from salesmans); select * from salesmans where rowid in (select decode(mod(rownum,2),0,null ,rowid) from salesmans); select * from dept where deptno not in (select deptno from salesmans); select * from dept a where not exists (select * from salesmans b where a.deptno = b.deptno); select salesmansno,ename,b.deptno,dname from salesmans a, dept b where a.deptno(+) = b.deptno...

How to pass value to query string in asp dot net

Query string is used to Pass the values or information form one page to another page. //First page of aspx Partial Class Test1 Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 'bind the textbox values to querystring Response.Redirect("Test2.aspx?ValuefromTxtbox1=" & TxtBoxControl1.Text) End Sub End Class //Second page of aspx Partial Class Test2 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Get the values from Query string TxtBoxControl1.Text = Request.QueryString("ValuefromTxtbox1") End Sub End Class

Get number of days in a month by passing date in sql function

Get number of days in a month by passing date in sql function CREATE FUNCTION [dbo].[GetNoOfDaysInMonthfromdate] ( @DateParm DATETIME ) RETURNS INT AS BEGIN RETURN CASE WHEN MONTH(@DateParm) IN (1, 3, 5, 7, 8, 10, 12) THEN 31 WHEN MONTH(@upDate) IN (4, 6, 9, 11) THEN 30 ELSE CASE WHEN (YEAR(@DateParm) % 4 = 0 AND YEAR(@DateParm) % 100 != 0) OR (YEAR(@DateParm) % 400 = 0) THEN 29 ELSE 28 END END END GO

Macro That Automatica​lly Updates Data Itself,Clear Content of selected range In Excel

Macro That Automatica​lly Updates Data Itself In Excel If you need to have a database that automatically updates itself.  In fact, if you have a folder with different excel files, say folder Y (all the same form/template), and the first X cells of these files need to be extracted to another excel workbook (file Z). Every file represents 1 row in workbook  Z. But this should be done automatically. So if I copy a new excel file in folder Y, the first X of this new excel file should automatically (can be with a ‘button demand’)  be copied into workbook Y. Option Explicit Const cstFolder = "C:\Users\ATC0155\Documents\Toolbox\Excel\1208 20 selfupdate" Const cstCols = 5 Sub DoUpdate() Dim wks As Worksheet Dim strFile As String Dim appExcel As Excel.Application Dim lngRow As Long ' Prepare the sheet to receive the data Set wks = Sheet1 wks.Cells.ClearContents ' Run through each file in the folder strFile = Dir(cstFolder ...

ASP.Net Tips-Create object for delegate ,Paste data using code,Delete lines in dataTable

namespace Akadia.BasicDelegate { // Declaration public delegate void SimpleDelegate(); class TestDelegate { public static void MyFunc() { Console.WriteLine("I was called by delegate ..."); } public static void Main() { // Instantiation SimpleDelegate simpleDelegate = new SimpleDelegate(MyFunc); // Invocation simpleDelegate(); it's the object of delegate. } } } objectname.Eventname += new objectname.delegatename(functionname()); in this we are calling events by creating an object of that particular class providing events but when we attaching delegates we are not using the object name or we cannot use object name, instead we are using class name of that particular delegate provided . Delegate is neither meant to do any action nor to persist a value. so there is no need to access the delegate by an object. And we can even declare the delegate outside of the class. There is no significant in declaring the dele...

How to use where and group by clause in same query in Axapta

Following is example of using group by clause in select query using axapta. Group by clause will display data as per mentioned fields after group by clause. SELECT D.DNO ,D.DNAME ,D.DLOCATION , Max(E.salary) FROM Emp E, Dept D                                                       where E.Dno = D.Dno                                                      Group by E.Dno, D.Dno, D.DNAME ,D.DLOCATION ; when you use group by clause then you will get distinct records ...

Concept of Networks and its types

Concept of etworks Consist of two or more computer connected to each other. Share resources (such as disks, files,directories, printers, CD-ROMs etc.) Exchange files, data and allow electronic communication between them. Types of Networks Local Area Network (LAN) Metropolitan Area Network (MAN) Wide Area Network (WAN) Local Area Network Confined to a relatively small area. Generally limited to a geographical area such as a school, building or an office. Rarely are LAN computers more than a mile apart. Metropolitan Area Network (MAN) Covers larger geographical areas, such as cities. Wide Area Network Connects larger geographical areas, such as the whole of India or the world. Dedicated transoceanic cabling or satellite communication may be used to connect this type of network. Peer-to-peer operations Peer-to-peer operations All computers are considered equal. Designed primarily for small to medium local area networks. Advantages Less initial expense ...

Go to statement,Run a Dos command in c++

Go to statement in c++ #include // The main() function. int main() { for (int dept = 1; dept < 10; dept++) { std::cout << "Department " << dept << std::endl; int empl; do { std::cout << "Enter Empl # " "(0 to quit, 99 for next dept) "; std::cin >> empl; if (empl == 0) goto done; if (empl != 99) std::cout << "Dept: " << dept << ", " << "Empl: " << empl << std::endl; } while (empl != 99); } done: std::cout << "Entry complete" << std::endl; return 0; } Use of  system function to run a dos command  #include"stdlib.h" #include"stdio.h" void main() { char get_ip[50]; int x; char command[50]; printf("enter the ip to be pinged : "); gets(get_ip); printf("%s",get_ip); strcpy(command,"ping ")...

Chalte Chalte song notation using keyboard

Song : Chalte Chalte Movie : Mohabbatein Notes used : Western - C D E F F# G A B Song I : Chalte Chalte Yuheen, Ruk Jaata Hoon Main.. C+..B...G ...A... A. A.., C+....B..G..B..A...A... Baithay Baithay Kahin......, Kho Jaata Hoon Main B...A...F#....G...G..G....., B..A..F#...A...G..G.... Kahtey Kahtey Hi Chup...., Ho Jaata Hoon Main A...G...E...F# F# F#........, C+.B...D+..B...A..A.. Kya Yahi Pyar hai..., Kya Yahi Pyar hai.... C+....B..G..A A.A.., C+....B..G..B..A..A.. Haan Yahi Pyar hai..., Haan Yahi pyar hai... B...A...F#..G.G..G..., C+.B...D+..B...A..A.. Song II: Tum Pe Marte Hain Kyun........, Hum nahin Jaantein.... A..C+..E+..G+G+...F+F+........., G...G..G..C+.G A... Tum Pe Marte Hain Kyun........, Hum nahin Jaantein.. A....A.. A A.....E.....F............, G....A.B...A...G...A.. Aisaa Karte......Hain Kyun....., Hum Nahin Jaantein... A..B.C+C+BB.. F#...G.........., B...D+ B..B..A..G..A.. Ban..nd.....Galiy.o.o.on....Se......Chup.Chup..Kar.., Hu..u..m Guj..ar.ne....

Restoring Sun with No Configuration Information

You can still get some information from your dump tapes, and with a couple of educated guesses, you can get the system up and running. There are a couple of ways to proceed. If you have another system, and you have some spare disk space, you can start to gather some information while the hardware guy is replacing the disk drive. On the second system, create a directory on a file system that has at least 15 MB free. You probably won't use that much, but a little extra space never hurts. In a crunch, you could probably get by with 5 MB or less. Let's call the directory /hope (because we hope we can get some information out of this). We are going to use the interactive option to ufsrestore (this option is also in restore under Sun OS, but I will use the Solaris versions here) to extract the vfstab from the dump tape. Use the following commands: # cd /hope # ufsrestore -ivf /dev/rmt/0 Verify volume and initialize maps More messages concerning block size, date of the dump, ...

Restoring Solaris steps using boot prompt commands

From the boot prompt (the 'OK' prompt) type: OK boot cdrom -s When the system has booted up, you should be at a shell prompt. You'll need to partition the disk using format. # format c0t0d0 You will see the format menu. It is usually not necessary to actually format the disk, since almost all SCSI disks are preformatted at the factory. We simply need to repartition the disk. Select the partition option: format> partition You will see the partitioning menu. Enter the following commands, using the printout of your previous partition layout in that machine's logbook as a guide. (See comments about partition sizes later in this article if you don't have such a record.) partition> 0 Enter partition id tag[root]: Enter partition permission flags[wm]: Enter new starting cyl[0]: Enter partition size[??b, ??c, ??mb, ??gb]: Repeat this process for all the other slices on the disk. Be sure to zero out any unused slices on the disk to avoid problems later....

Collection of Kings of Jamnagar

Collection of Kings of Jamnagar

What is BERMUDA TRIANGLE?

1. Disasters  Its statistics are almost similar to any other parts of the ocean. various authors just exaggerate things based on their beliefs in the myths. There are also errors in the data . for example a ship reported missing may be taken into account but it may show up two days later .and this will not be recorded. 2. Things Dissolve  I don't know what this means .but i would not be very surprised if sugar dissolves in the Bermuda triangle. 3. Magnetism ... there is no evidence of extreme magnetic force . but the compass readings do vary over the triangle area ... and not just the there but everywhere on earth. The compass reading usually varies over a particular geographic region. I think the Bermuda triangle hides a warm hole or a singularity in it "nature abhors naked singularity" i mean if u say its due to magnetic field , how do u explain the reappearance of ships or old things that were experienced by the people magnetic field doesn't play hide...

Interview Tips for all job seekers and My Second Interview Experience

Here are a few interview tips to help you make a great impression on the person who interviews you. 1 . Market your skills and related experience in the field that you are applying for. Be sure to do it in a way that is positive, but not cocky or aggressive. 2 . Research the company before your interview. It's a great way to know where you would fit into the organization. It also lets the employer know that you really want to be a part of the company. 3 . Prepare answers to common interview questions ahead of time, and practice saying them, so you aren't stumped during the interview. 4 . Dress for success, in the manner you would dress for the position you're seeking. 5 . Bring a list of your own questions with you in a folder with the company's name on it, so that you don't forget them. You should keep your extra resumes in there too. 6 . Be a good listener and focus. Some job seekers talk too much during interviews. 7 . Be prepared to describe y...

Acting Schools,New Delhi,Mumbai

1.R. K. Films & Media Academy in New Delhi RKFMA is equipped with latest gadgets, unmatched quality infrastructure, best available faculty & latest learning methodology. The Academy emphasizes on grooming, aspiring students, supporting & cultivating their talent for making a better & more fertile media industry. The platform & infrastructure provided in the Academy is designed, engineered & implemented with utmost care to produce high quality trained manpower. We provide, 1. Editing studios equipped with latest machines, audio & video equipment & software like Avid Liquid, Premier, FCP & many more. 2. In-campus stage-cum-movie hall. 3. Faculties comprising of big shots from Indian Cine Industry ever willing to share their experiences 4. Latest & the best Cameras in the Photography Studio 5. Sound proof & up-to-date Recording & Dubbing Studio 2.LIVEWIRES - THE MEDIA INSTITUTE Basement, Shoppers Point,  Opp. Andheri Stati...

Asp Dot net question with Answer

Asp dot net question with Answer 1. Tell me about yourself Ans. • I am Santosh .I have finished my M.C.A at IGNOU from L.J. college Ahmedabad, with an aggregate of 60%. I did my U.G. and schooling in Shahjahanpur UP .I’m having an aggregate of 51% in my B.Sc. science. My native place is Bahraiech UP. • My interests are playing cricket, reading books, and listening music 2. How the find the N the maximum salary of an employee? Ans. SELECT MIN (SALARY ) FROM UEXAMPLE1 WHERE SALARY IN (SELECT DISTINCT TOP 4 SALARY FROM UEXAMPLE1 ORDER BY SALARY DESC) 3. What is @@connection? 4. What is String Builder? Ans. Strings are integral to most app dev projects, so it is imperative that they don't impair performance. The .NET StringBuilder class streamlines string values processing. It's hard to find an application that doesn’t deal with text in some way. As a result, developers are faced with a variety of string-related tasks every day. The .NET Framework include...