473,699 Members | 2,600 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write Sql Query in LinqtoSql?

2 New Member
I have a Query for getting the Sum of Stockvalue

Expand|Select|Wrap|Line Numbers
  1. select sum(Itm_Prc*Itm_CrntStk) as Stckvalue from dbo.Ptr_ItemHdr
how to write this Query in lingtosql?
help me.
Aug 6 '13 #1
1 1198
vijay6
158 New Member
Hey vmkrishna534, try this code...

Expand|Select|Wrap|Line Numbers
  1. myEntity.Table_Name.Sum(a => a.field1 * a.field2);
Aug 7 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3827
by: Tanamon | last post by:
Hello All, I am a MySQL newbie trying to write a query that selects file_name records possessing the highest numbered version for that unique file_name. I show sample data and two trial queries below. Logically I want to use max(version) as a constraint in a Where Clause. However, the max() function is not allowed directly in a where clause. I have contemplated a second table to track the max version for each file name. I would like...
3
14017
by: Simon Gare | last post by:
Hi All, having a problem with the error "Either BOF or EOF is True, or the current record has been deleted. " found a workaround that allows the non existent data to be bypassed and insert a 0 value into the textfield and inserted into the table, however if the record does exist it still shows the 0 value? I want it to Response.Write the recordset value entry. At present <input name="BroughtForward" type="hidden" id="BroughtForward"...
5
11113
by: GreggaR0und | last post by:
Hello; I am trying to use Access VBA to write each record in a query to its own individual XML file. That is, each record represents one XML file which will then be sent to a SharePoint Form Library. I am unsure how to tackle this problem. I tried to send my QueryResults to InfoPath, but all the records appear as repeating sections in a single XML file. Therefore, that choice doesn't seem to work. So now I'm wondering if I can bypass...
2
3433
by: Himmel | last post by:
Hello! The reference database I currently use runs queries that pull data from hundreds of tables in order to create user-friendly form view. The problem is that these queries can take upwards of 30 seconds to return. The solution that I've devised is to create an admin function to cache all these query results and then dump that data into a new, consolidated table, and then have the users search through those new tables. Since our...
0
946
by: sachjn | last post by:
Hi, I have three tables with columns as: Person_sys1 Id(pk) name telephoneNum userid ----- -------- ---------------------- --------- Person_sys2 Id(pk) name telephoneNum userid
0
1407
by: sara | last post by:
Hi - I have a table keeping track of employees' jobs in a location. So, Store #1 Manager #353, AsstMgr #556 Store #2 Manager #776, AsstMgr #132 etc. The table is Date StoreNum MgrNum AsstMgrNum ... Each time a "line up" is recorded, we put in the new date (as people
0
1648
by: harik82 | last post by:
Hi All, In one of my UDF i have writen the query as shown below, but it is throwing sme errors. Can any one help me to solve this problem.....very urgent.... IF ((select enrole.ADAccount.erparent from enrole.ADAccount) = PersonDN) THEN SET AD = (SELECT enrole.process.completed FROM enrole.process where ((enrole.process.type='AA') and (enrole.process.requestee=PersonDN))); END IF; IF ((select enrole.NotesAccount.erparent...
0
2730
by: xwebmaster | last post by:
Hi Please help me solving this query.. I have 3 tables.. comm_propDB ID | User_ID | mls_num -----|---------------|--------------------- 2 | 2 | 5004 3 | 2 | 8920 8 | 2 | 5540
4
1858
by: micropos | last post by:
hi everyone,who can help me solve the problem?this is my code: <?php include 'C:/wamp/www/micropos/condb1.php'; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error());
0
1124
by: Neven Huynh | last post by:
Hi Everyone, Here i my LINQ query to get record in Table Menu with condition are parentID == 0(get root menu) and ID != (parentID list) (which is parent ID list is are id of menu record that have child), i just want to load all record includes root menu that have no children record and children record : List<Menu> menus = MenuDAO.Instance.GetAll(); // Get All Record in Menu Table var parentID = (from p in menus where p.ParentID != 0...
0
8705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8941
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8897
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.