Hi,
Is it possible to return a single value and an enumerable collection using LINQ to SQL?
The problem is, I'm trying to do paging across a large recordset. I only want to return 10 rows at a time so I'm using .Skip(20).Take(10) approach.
However I need to know the total number of records so I can show an appropriate page x of y.
Trying to avoid two separate queries.
Thanks
i am trying to create a statement in sql (for a table which holds stock symbols and price on specified date) with avg of 5 day price and avg of 15 days price for each symbol.
table description:
symbol
open
high
close
date
the average price is calculated from last 5 days and last 15 days. i tried this for getting 1 symbol:
SELECT avg(close),
avg(`trd_qty`)
FROM (select *
from cashmarket
WHERE symbol = \'hdil\'
order by `M_day` desc
limit 0,15 ) s
...but I couldn't get the desired the list for showing avg values for all symbols.
So this my first question here, let's look how it works.
I'm working on a project, which has to to provide a "Native XML WebService" on a SQL Server 2005. The web service and the WSDL generation works fine. But there are troubles with the authentication.
Is it possible to turn the authentication off (The tests and the documentation by Microsoft say no.)?
And if so how?
While there's lots to like about DataObjects.NET, I've found help resources to be a lean, and can't find a solit example of using DataObjects.NET with RDBMS generated primary keys. It would seem as though D4O won't do inserts against SQL Server unless it's in controll of the key.
Has anyone solved this in the wild?
I'm writing java application that is using both SQLite and MySQL using JDBC.
Are there any differences in SQL for those databases? Can I use same queries for both SQLite and MySQL, or is there any db specific stuff, that doesn't work on the other one?
As far I've worked only with MySQL, so I don't really know much about SQLite.
I have an sql table with data like this:
| theDate (datetime) | theValue (int) |
----------------------------------------
| 2010-05-17 02:21:10 | 5 |
| 2009-03-12 04:11:35 | 23 |
| 2010-02-19 18:16:53 | 52 |
| 2008-07-07 22:54:11 | 30 |
The dates are stored in UTC format in a datetime column, how can I convert them to local time (Norway)? Remember that the UTC-offset is not the same all year because of winter/summer-time.
Hello.
I have a short question. Im my current project I'm using LINQ-to-SQl. That is the best way to determine if table has record with specific ID?
Thanks in advance.
hello,
i am developing wpf application..
i need your suggestions.
i have to make reports in my application...
so which one is best, by crystal report or by using sql server reporting service..
friends what you say ? give ur suggestion which one is best and why ???
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
Hi,
I have a StreamReader object that I initialized with a stream, now I want to save this stream to disk (the stream may be a gif or jpg or pdf etc).
SO my code so far is:
StreamReader sr = new StreamReader(myOtherObject.InputStream);
I need to save this to disk (I have the filename).
In the future I may want to store this to sqlserver
I have the encoding type also, which I will need if I store it to sql server right?
I have a sql statement I am using a simple sort such as the following
Select numbers
From theTable
Order By numbers
What I get in return is the following
1
11
12
14
2
21
22
23
3
35
37
etc...
I want it to be ordered in normal order
1
2
3
4
5
6
etc...
I had a table (Some_Table) with two columns:
A B
-------------------
1 test
2 test
3 test1
4 test1
i would like to return DISTINCT values for column B and it's associated value in column A (first in distinct set), so something like this:
A B
-----------
1 test
3 test1
What is the sql?
I am created a website using visual studio 2010. On the time of the development of website I am able to access the database.. but after publishing the site using IIS7..i was unable to access the database..the exception occured during that time was "the connection is in the closed state".in IIS7 When I changed the application pool identity to localsystem, it worked.
Data base is installed in the same machine. and server is SQL SERVER 2008 R2
What is the most standard encryption technique used in sql server for asp.net c# enterprise level application? . i am talking with respect to standards like md5 or sh1 etc, hashing
Should I invest a lot of time trying to figure out an ORM style implementation, or is it still common to just stick with standard SQL queries in python/pylons/sqlalchemy?
Hi,
Is there any way, to save formatted in database from richtextbox?
I've got richtextbox and some parts of text in this are bold.
string s=richtextbox.Text obviously doesn't work.
And If I can get this formatted text how to save it in Ms Sql Server 2005 ?
I need to compare tables with the same names in different databases ( Sql Server 2008 ). How using C# code and ADO.Net to identify additions, deletions, updates. Is DataReader going to work in this scenario without stored procedures ? DataReader seems to be suitable for single database connection, or am I missing something ?
I have been searching for a while about how EF utilizes connections to SQL Server DB, and whether it is using Connection pools under the hood, but I couldn't find any details about that.
I have the following SQL query which returns the correct results:
SELECT *
FROM `tags`
WHERE tag_name = '???\\\"?-???????'
If I change it to
SELECT *
FROM `tags`
WHERE tag_name LIKE '???\\\"?-???????'
or to
SELECT *
FROM `tags`
WHERE tag_name LIKE '???\\\"?-???????%'
It doesn't work. It will work if I remove all the backslashes and " from the query.
I need to Pass some data to a text file and save that text file in a SQL Server 2005 database.
Then I'll need to be able to load that textfile into a C# WinForms DataGrid.
How do I do that in C#?
Hi,
I know that there are few open sourced / Free BI projects and I am looking recommendations.
I have a growing Mysql database that i got tired from writing sql queries + gui + filtering over and over again.
if i am not able to find a free one than my budget will be: (1$ - 2500$ )
My needs are:
Mysql 5 Connection.
user permissions
export options
Basic Dashboard
--
nice to have:
Web Based GUI
Development framework integration in PHP
I need to use C# to get data from database(sql) and the data in database is updated every few seconds. So do I have to make a loop or there is a better way to do that? Is it possible that when database is updating, the program can wait until it finishes updating? thx!
I have a web service that I just coded up that drops an image (png) into my SQL Server 2008 database as a varbinary.
Is there a easy tool out there that can let me see that image?
I could code up a client, but I would rather just use a tool if one exists.
I have test_scores table with following fields:
Table schema:
id (number)
score1 (number)
score2 (number)
score3 (number)
score4 (number)
Sample data:
id score1 score2 score3 score4
1 10 05 30 50
2 05 15 10 00
3 25 10 05 15
Expected result set:
id col_name col_value
1 score4 50
2 score2 15
3 score1 25
What is a good SQL for this?(I am using MySQL.)