Hi all! There is a question. i am facing difficulting in writting a query for selecting record in database.i am explaining whole scenerio of current problem: i have a table StockDelta having attributes as follows: stockDeltaID(primary key), productID(forighn key from product table(productID, productName, totalQuantity etc) ), Delta(the change in quantity of stock of a product, if the quantity increases the value of delta will be positive and if the quantity decreases value of delta will be negative), isStockAdded(bool value indicating if the changed amount was basically the added stock), isSecondarySales(bool value indicating if the changed amount was basically the sencondary sales), isDamages(bool value indicating if the changed amount was basically the damaged amount), isFreeGifts(bool value indicating if the changed amount was basically the amount of freeGift) now i have to generate a Stock report(using crystal reports), the report will take a parameter in case of daily report and two parameters in case of monthly report. the information that we want to show in report is as follows: The columns of report should be "Opening Stock"(representing quantity at start of month/day). we will get this column by Sum(delta) where date < pdate-1 //pdate is parameter date "Stock Added"(representing quantity purchased during month/day), we will get this column by Sum( Delta) where date = pdate and isStockAdded = true "Secondry Sales"(representing the sale out of a produt on a specific month/day), we will get this column by Sum(delta) where date = pdate and isSecondarySales = true "Closing Stock"(representing the net quantity of a product in stock on a specific month/day), we'll get this column by Sum (delta) where date < pdate "Damages"(from 1st of a month till a specific day or in a whole month), we get this column by quering Sum(delta) where date between 1st of month till pdate and isDamages = true "FreeGifts"(representing the quantity of freegifts from 1st till that day of a month or for whole month). we will get this column by quering Sum(quantity of Freegifts) where date between 1st of month till pdate and isFreeGift = true hope you people have grasped what i said.. i have tried my best to figure out query for this report but maybe at this student level i am unable to come with the right solution. i am stuck on it and request you people to please consider the problem if you get some time. Thanks in advance shaz jazz
samtam
Posts
-
databas query question -
menu strip.......I myself was having same problem while selecting a treenode. that if i set its backgrout color or foreground color then its fine and it works but i want that when ever i select the node then the default windows color apear(blue,olive or grey) and i want a different color to apear so how to do so?? its same problem i guess only control is different:) i will try sugestion of menu strip as well! thax in advance! sam tam
-
changing color of the pointed treeView nodehow to change color of the selected or pointed node in a tree view control. i know about the selectecd node property...but in this case i cant use it. Thanks in advance shaz jazz
-
Add Resources for compilationIn an applicatin which programatically compiles a C# project, i am facing a problem in adding Resources like images. i read about EmbeddedResources method of class Compiler Parameter and tried to add the resources using it, but couldnt get the desired result. Can any one tell me how to add resources for ciompiling C# project??? Thanx in advance
-
How to create hyperlink column in datagridDataGridViewLinkColumn This class will help you in creating hyperlink column in datagrid.
-
Sliding Menu Builder for Windows ApplicationHi, I need to know about any Sliding menu builder for Windows Application. i've found alot of Menu builders but for web applications like AspxLab and MenuLab etc. or does anyone know how to make Siliding menu using C# built in Controls???? Thanks in advance
-
Image displaying on a form in treeview....a fileload errori am using a treeView control in which i want to display image against its every node. the images are placed in project directiory's \bin\release folder. now the tree is popupulated when the form is loaded i.e the statements of populating the tree are after calling InitializeComponent(); in the constructor of new form. at first time when i come 2 this form (calling it against the NEXT button of a prevous form) then no problems occur and the images are loaded without any complication but when i go back to a previous form and come back to this form through same path and using same NEXT button then fileNotFound exeception occurs at this line Image img = Image.FromFile("pic1.jpg"); but previously images were displayed successfully...! i am facing same problem when i rightclick and create a contextMenu against a node. images are displayed against each optin of contextMenu successfully at first but when i click some option of contextMenu then work n then rightclick same node then the same exeception fileNotFound occurs(while populating ContextMenu) at same sort of lines... further more if i am debugging the project then these fileNotFoundException occurs even for the first time when i populate the tree.but when i run the project no error comes for the first time and the images are loaded successfully....but only for first time..! i canot understand where the problem lies?? May God help u solv ur problems as well,thx in advance!!
-
Problem abt threading!!its not possible to send u the whole code related to this coz its too long so only sending u chunks from it,i hope it will help u to understand our problem //this method is called after every 10 seconds by timer event public void ConnectDB(Object obj, EventArgs ev) { myTimer.Stop(); String query = "/////////////some selection from DB"; aReader = DB.ExecuteReader(query); projectDB.Clear(); while (aReader.Read()) { //structure is a Struct containing a string and an int variable //after gettings latest values from db in structure v add it // in projectDB arraylist structure.proj_name = aReader.GetString(0); structure.compl_status = aReader.GetInt32(1); //to lock the projectDB array list here Monitor.Enter(projectDB); projectDB.Add(structure); //to unlock the projectDB arraylist here Monitor.Exit(projectDB); } DB.Close(); if (!list_status.Contains(s))//some check i think u dnt need to understand it { exit_flag = true;//to disable timer } else { myTimer.Enabled = true;//to enable timer } } another method of the same class that is using value of this arraylist ///////////////code where v r reading values from projectDB if (Monitor.TryEnter(projectDB)) { //projectDB is an arraylist filled with info from database temp_projDB = (compile_status)projectDB[index]; } else continue; ////////////////// Thanks
-
Problem abt threading!!Ofcourse we are locking the same object and using it both reading and writing times. we used Monitor.TryEnter at the time of reading that object. which provides exclusive lock.
-
Problem abt threading!!Thanks, But we have already used Monitor.Enter and Monitor.Exit methods for locking mechanism, but it doesnt work. So now??????????? Urgent Reply is needed urgently!!!!!!!!!!!
-
Problem abt threading!!Salam we have a public static variable lets say temp in a class lets say A and another class lets say B creates a thread that will update temp's value after every 10 seconds by getting values from Data base.And another thread of the same class uses updated values of temp.Now the problem is this that , we are not getting updated values of temp in the second thread of the classB.can any body figure out the problem in this scenario. plz I need an urgent reply. thanks
-
why is thread not working with graphic object?? [modified]Thanks , but how can this be achieved. i need to do both the things in parallel,,what do u suggest?
-
why is thread not working with graphic object?? [modified]Can anyone tell me why is this scenario not working? A tabcontrol's paint event draws a rectangle and simultaneously a thread should update a label on that tabcontrol. Thread is created when the form is loaded. but its not working..... Label is not shown untill the drawing is completed. i cant figure out, what did i miss??? Any suggestions Thanks in advance -- modified at 2:37 Tuesday 17th October, 2006
-
icodecompilerAssalam-o-Alaikum, i've compiled a classLibrary to generate a DLL. as you know classLibrary doesnt have a main method, i used a switch "/target:library". parameters.CompilerOptions="/target:library"; there is also a method named MainClass in CompilerParameters class, i didnt use that but i think u can specify ur main class in it. I hope this will help you Allah Hafiz -- modified at 4:29 Tuesday 3rd October, 2006
-
How to find available RAMyou can find available RAM of local system using PerformanceCounter ram=new PerformanceCounter("Memory","Available MBytes"); float availableram=ram.NextValue(); Hope this will help you
-
Left Function in C#Thanks alot i was only confused coz of the term 'LEFT', otherwise i know how to use this method.
-
Left Function in C#Fellows i didnt get it. why is it called "Left", further clarify me thanks in advance
-
list of computers in a networkhttp://www.codeproject.com/cs/internet/host\_info\_within\_network.asp This will help u.
-
Error in .net remoting!!I am developing server and client application using .net remoting in c#. When I run both client and server applications from the same machine, things work fine. But when I host the server on a different machine, exceptions dont get thrown across, rather I get the remoting error with the message "Server has encountered an internal error,for more information turn off custom Errors in servser's.config file". I'm using .NET Framework 1.1. on both server and client. The server is hosted in a windows service. I've read that this can be avoided by setting "off" in the server configuration file. But I am not using config file to configure my windows service.As I configure it programmatically.Can any body tell me how to avoid this error and what is the reason of this?? Thanks Sam
-
How to make client serverThere is more than one way to make client server applications in C#, u can go for .net remoting technology. u can easily find helping material on net. this article will help u www.c-sharpcorner.com/Network/RemotingInNETM.asp