Hi,
I have stored some records in to database using ADO.NET Entity Framework. I want to know total record count in particular table using ADO.NET Entity Framework in C#.Net .
Thanks
Hi All,
Consider this command, as written here:
Command.CommandText = "SELECT COUNT(ASSET) AS POSEXISTS FROM POSITIONS WHERE ASSET = @ASSET";
Command.Parameters.Add("@ASSET",DbType.String).Value = Symbol;
So here, how should I execute this query so that, I can receive the POSEXISTS variable in the C# environment.
Soham
Hi iExperts
I am little bit confus about the iPhone developer program.
I know its One year subscription program after that we have to re-new it
Q : From which time the count down of iPhone developer program starts ?
from the Enrolment time or
from the application submission time
is anyone have idea then pls tell me frnds...
Thanks in advaced...
Supposing we have the following records in an SQL Server table.
Date
19/5/2009 12:00:00 pm
19/5/2009 12:15:22 pm
20/5/2009 11:38:00 am
What is the SQL syntax for getting something like this one?
Date Count
19/5/2009 2
20/5/2009 1
I have a table for image gallery with four columns like:
foid | uid | pic1 | pic2 | pic3 | date |
-----------------------------------------------
104 | 5 | 1.jpg | 2.jpg | 3.jpg | 2010-01-01
105 | 14 | 8.jpg | | | 2009-04-08
106 | 48 | x.jpg | y.jpg | | 2010-08-09
Mysql query for the user's galleries looks like:
SELECT * FROM foto WHERE uid = $id order by foid DESC
The thing that I want to do is count the number of images (PIC1, PIC2, PIC3) in every of the listed galleries.
What is the best way for doing that?
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting result 3, because there're only 3 objects inside: mother, father, brother?!
I have a file that is tab delimited. I would like a powershell script that counts the number of tabs in each line. I came up with this:
${C:\tabfile.txt} |% {$_} | Select-String \t | Measure-Object | fl count
it yields 3, Which is the number of lines in the file.
any pointers to what I'm doing wrong? I would like it to print a single number for each line in the file.
Hi, i have a query that returns something like this.
ID | Company| Total_Money | no_items | count_Total_Money_For_Company
-----------------------------------------------------------
1 | A | 1000 | 1 | 2001
2 | A | 1001 | 0 | 2001
3 | B | 1001 | 1 | 5010
4 | B | 1002 | 1 | 5010
5 | B | 1003 | 1 | 5010
6 | B | 1004 | 1 | 5010
7 | B | 1000 | 1 | 5010
How can i add that column with the count for that company?
Hi,
I am developing a iPhone application that uses Facebook APIs.
Which API should I use for incrementing the like count of a Facebook page?
Thanks and regards,
Deepa
hi i created project using asp.net and sql server 2005.I created table and inserted datainto sqlserver 2005. but i dont how to find the(count) number of records stored in the table.how to find this?
I have a table with the below structure.
ID VALUE
1 3.2
2 NULL
4 NULL
5 NULL
7 NULL
10 1.8
11 NULL
12 3.2
15 4.7
17 NULL
22 NULL
24 NULL
25 NULL
27 NULL
28 7
I would like to get the max count of consecutive null values in the table.
Any help would be greatly appreciated.
THanks
Ashutosh
Hello Guys!
I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories.
Category
Id : bigint (PK)
Name : nvarchar(255)
AcceptQuestions : bit
IdParent : bigint (FK)
Question
Id : bigint (PK)
Title : nvarchar(255)
...
IdCategory : bigint (FK)
How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(
Well,I m trying to list the number of files created today and the count the number of lines in those files.I have to do it in unix.Please suggest how to write script for this.
this is follow up of this question. count number of foreign keys
i am using doctrine 1.2 and i want to count the number of business that belongs to subcategory.
following are the mysql tables.
1.fi_category
+----+-----------------+-----------------+
| id | name | slug |
+----+-----------------+-----------------+
2.fi_subcategory
+----+-----------------+-----------------+-------------+
| id | name | slug | category_id |
+----+-----------------+-----------------+-------------+
3.fi_business_subcategory
+----+-------------+----------------+
| id | business_id | subcategory_id |
+----+-------------+----------------+
i am using this DQL.
$q = Doctrine_Query::create()
->select('c.name, c.slug, sc.name, sc.slug')
->from('Model_Category c')
->leftJoin('c.Subcategory sc')
->leftJoin('sc.BusinessSubcategory bsc');
which gives me something like this.
Array
(
[0] => Array
(
[id] => 1
[name] => Entertainment & Lifestyle
[slug] => entertainment-lifestyle
[Subcategory] => Array
(
[0] => Array
(
[id] => 1
[name] => Arts and Crafts
[slug] => arts-and-crafts
)
[1] => Array
(
[id] => 2
[name] => Family
[slug] => family
)
[2] => Array
(
[id] => 3
[name] => Fashion
[slug] => fashion
)
)
)
)
i am looking to fetch the number of business, i.e the returned result should be something like this depending on the business it belongs.
Array
(
[0] => Array
(
[id] => 1
[name] => Entertainment & Lifestyle
[slug] => entertainment-lifestyle
[Subcategory] => Array
(
[0] => Array
(
[id] => 1
[name] => Arts and Crafts
[slug] => arts-and-crafts
[business_count] => 35
)
[1] => Array
(
[id] => 2
[name] => Family
[slug] => family
[business_count] => 10
)
[2] => Array
(
[id] => 3
[name] => Fashion
[slug] => fashion
[business_count] => 27
)
)
)
)
tried various ways using DQL, but nothing seems to work out. any idea how should i go with what i want?
Hi there .
I have a A=set of strings and a B=seperate string. I want to count the number of occurences in from B in A.
Example :
A:
10001
10011
11000
10010
10101
B:
10001
result would be 3.(10001 is a subset of 10001,10011,10101)
So i need a function that takes a set and string and returns an int.
int myfunc(set<string> , string){
int result;
// My Brain is melting
return result ;
}
Are there any ways to get count of current unfinished tasks at Google Appengine development server? I need it for making my integration test.
I found a way to get this when running it local (just in mem), as described at appengine docs.
But when i'm running it as a standalone server, from maven, this doesn't work. Just because library appengine-testing conflicts with Appengine SDK classes, and i can't use those classes together, when running sdk dev server.
Im tring to make something like a textbox for a console application,
how to limit the Console.Out to only write a defined count of characters from user inputs ?
Hello Guys!
I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories.
Category
Id : bigint (PK)
Name : nvarchar(255)
AcceptQuestions : bit
IdParent : bigint (FK)
Question
Id : bigint (PK)
Title : nvarchar(255)
...
IdCategory : bigint (FK)
How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(
I have two tables, one called calendars and one called events. There can be multiple calendars, and multiple events in a calendar. I want to select every calendar, also getting the number of events in the calendar.
Right now I have :
SELECT C.*, COUNT(*) AS events FROM `calendars` AS C
LEFT JOIN `events` E ON C.ID=E.calendar
GROUP BY C.ID
But that doesn't work. Items with no events still return 1. Any ideas?
I am trying to figure out how to create a timer for my C8051F020 MCU. The following code uses the value passed to init_Timer2() with the following formula:
65535-(0.1 / (12/2000000)=48868.
I set up the timer to count every time it executes and for every 10 counts, count one second. This is based on the above formula. 48868 when passed to init_Timer2 will produce a 0.1 second delay. It would take ten of them per second. However, when I test the timer it is a little fast. At ten seconds the timer reports 11 seconds, at 20 seconds the timer reports 22 seconds. I would like to get as close to a perfect second as I can.
Here is my code:
#include <compiler_defs.h>
#include <C8051F020_defs.h>
void init_Clock(void);
void init_Watchdog(void);
void init_Ports(void);
void init_Timer2(unsigned int counts);
void start_Timer2(void);
void timer2_ISR(void);
unsigned int timer2_Count;
unsigned int seconds;
unsigned int minutes;
int main(void)
{
init_Clock();
init_Watchdog();
init_Ports();
start_Timer2();
P5 &= 0xFF;
while (1);
}
//=============================================================
//Functions
//=============================================================
void init_Clock(void)
{
OSCICN = 0x04; //2Mhz
//OSCICN = 0x07; //16Mhz
}
void init_Watchdog(void)
{
//Disable watchdog timer
WDTCN = 0xDE;
WDTCN = 0xAD;
}
void init_Ports(void)
{
XBR0 = 0x00;
XBR1 = 0x00;
XBR2 = 0x40;
P0 = 0x00;
P0MDOUT = 0x00;
P5 = 0x00; //Set P5 to 1111
P74OUT = 0x08; //Set P5 4 - 7 (LEDs) to push pull (Output)
}
void init_Timer2(unsigned int counts)
{
CKCON = 0x00; //Set all timers to system clock divided by 12
T2CON = 0x00; //Set timer 2 to timer mode
RCAP2 = counts;
T2 = 0xFFFF; //655535
IE |= 0x20; //Enable timer 2
T2CON |= 0x04; //Start timer 2
}
void start_Timer2(void)
{
EA = 0;
init_Timer2(48868);
EA = 1;
}
void timer2_ISR(void) interrupt 5
{
T2CON &= ~(0x80);
P5 ^= 0xF0;
timer2_Count++;
if(timer2_Count % 10 == 0)
{
seconds++;
}
if(seconds % 60 == 0 && seconds != 0)
{
minutes++;
}
}
I'm struggling with an interview question. 3 dimension tables (Product, Store and Date) and 1 fact table (Sales). The question asks for a T-SQL solution that will return the count of products not sold, per store, per day over the past month.
At this point, my answer is futile but I've spent significant time trying to back into a solution, to no avail, and would like to close the loop. Any guidance is greatly appreciated.
I have stored resumes in my database and i have retrive it from asp.net web page by creating linkbutton...i can view ,download the resumes which i stored in my database.My issuse is when i view one resume example (domnic resume)then no of visitor for domnic resume should be count .if again i view that resume no of visitor should be 2...how can i do that in asp.net?
I'm trying to make something like a textbox for a console application,
how to limit the Console.In to only read a defined count of characters from user inputs ?
Approach #1:
DECLARE @count int
SET @count = 2000
DECLARE @rowcount int
SET @rowcount = @count
WHILE @rowcount = @count BEGIN
DELETE TOP (@count) FROM ProductOrderInfo
WHERE ProductId = @product_id
AND bCopied = 1 AND FileNameCRC = @localNameCrc
SELECT @rowcount = @@ROWCOUNT
WAITFOR DELAY '000:00:00.400'
Approach #2:
DECLARE @count int
SET @count = 2000
DECLARE @rowcount int
SET @rowcount = @count
WHILE @rowcount = @count BEGIN
DELETE FROM ProductOrderInfo
WHERE ProductId = @product_id AND FileNameCRC IN
(
SELECT TOP(@count) FileNameCRC
FROM ProductOrderInfo WITH (NOLOCK)
WHERE bCopied = 1 AND FileNameCRC = @localNameCrc
)
SELECT @rowcount = @@ROWCOUNT
WAITFOR DELAY '000:00:00.400'
END