Thursday, March 29, 2012
Direct Printing
we have a Windows Application in .Net.
Now we want to use Reporting Services. That is no problem.
But how we can print direct on a client pc?Hi sqlhaas,
You can do this by installing a new printer extension for RS. Take a look
at this article (under Yesterday's QOD):
http://www.sqlservercentral.com/newsletter/452004newsletter.htm
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
sqlhaas wrote:
> Hallo,
> we have a Windows Application in .Net.
> Now we want to use Reporting Services. That is no problem.
> But how we can print direct on a client pc?|||Check Bryan's log http://blogs.msdn.com/bryanke/articles/71491.aspx.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Jake Marx" <msnews@.longhead.com> wrote in message
news:u%23nFdEQvEHA.1988@.TK2MSFTNGP12.phx.gbl...
> Hi sqlhaas,
> You can do this by installing a new printer extension for RS. Take a look
> at this article (under Yesterday's QOD):
> http://www.sqlservercentral.com/newsletter/452004newsletter.htm
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>
> sqlhaas wrote:
> > Hallo,
> > we have a Windows Application in .Net.
> > Now we want to use Reporting Services. That is no problem.
> > But how we can print direct on a client pc?
>
Direct connection Windows CE 4.2 + SQL Server 2005
Hello,
I have a problem with SqlClient (WindowsCE 4.2 & .NET CF2.0 SP2). PDA is connects on PC via USB-cradle and ActiveSync 4.0. PC is in the LAN and SQL Server 2005 is in the LAN too. I can't connect to SQL Server 2005 (after connection.Open() I get exception "PlatformNotSupported"). When I use SQL Server 2000, it's O.K.
Can I connect on the SQL Server 2005 from Windows CE 4.2?
Thanks.
See this.Wednesday, March 7, 2012
Different row colors (AlternatingItemStyle in asp.net)
Is it possible to changes the background color for each row? People coding
asp.net would know this as "AlternatingItemStyle" in a datagrid.
Can this be done using the VS IDE or do I have to go behind the code in the
rdl file?
Best Regards
Jesper.Hello Jesper,
you can put the following into the Background-property in VS IDE:
Backgroundcolor
=IIF(RowNumber("<table1>") Mod 2, "<color1>", "<color2>")
That's all.
Stefan
"Jesper Jensen" <jbj@.union.dk> schrieb im Newsbeitrag
news:egG1HdNrHHA.1204@.TK2MSFTNGP04.phx.gbl...
> Hi everyone!
> Is it possible to changes the background color for each row? People coding
> asp.net would know this as "AlternatingItemStyle" in a datagrid.
> Can this be done using the VS IDE or do I have to go behind the code in
> the rdl file?
> Best Regards
> Jesper.
>|||Hello Stefan
So simple and so powerfull.
Thank you very much!!!!!
Best Regards
Jesper
"Stefan" <stefan@.nospam.nospam> wrote in message
news:eqki9NOrHHA.1168@.TK2MSFTNGP03.phx.gbl...
> Hello Jesper,
> you can put the following into the Background-property in VS IDE:
> Backgroundcolor
>
> =IIF(RowNumber("<table1>") Mod 2, "<color1>", "<color2>")
>
> That's all.
>
> Stefan
>
> "Jesper Jensen" <jbj@.union.dk> schrieb im Newsbeitrag
> news:egG1HdNrHHA.1204@.TK2MSFTNGP04.phx.gbl...
>> Hi everyone!
>> Is it possible to changes the background color for each row? People
>> coding asp.net would know this as "AlternatingItemStyle" in a datagrid.
>> Can this be done using the VS IDE or do I have to go behind the code in
>> the rdl file?
>> Best Regards
>> Jesper.
>
Different results when executing from .NET component compare to executing from SQL Managem
Hi all,
I am facing an unusual issue here. I have a stored procedure, that return different set of result when I execute it from .NET component compare to when I execute it from SQL Management Studio. But as soon as I recompile the stored procedure, both will return the same results.
This started to really annoying me, any thoughts or solution?
Thanks very much guys
I'm interested in some more details: what's the meaning of different results? Returning different data (rows)? Or same data (rows) in different orders? Can you post the stored proceudre if it does not contain too many statements?
Since recomplie the stored procedure can solve the issue, it seems SQL optimizer chooses different execution plans, thus may lead to different results. One work around is to call the stored procedure with recomplie:
EXECUTEyourSPName WITH RECOMPILE
However this is not a so good solution, as RECOMPLIE at each execution will impact SQL performance.
|||The result that come back seems to be from the old version of the stored procedure, or could be it's joining differently.
I am suspecting that .NET SQL provider has a seperate query plan cache. The actual select statement is like this, I removed few lines in the where clause and column selections.
SELECT
main.*,fa.*
FROM [NetFare] main
INNER JOIN dbo.Agent fa
ON main.FareId = fa.FareId
LEFT OUTER JOIN travel.dbo.currencies c
ON c.Code = main.FareCurrency
Where
AND (PriceReturnType = @.ReturnType)
And main.PortSetID in (Select Distinct PortSetID
From FarePortSetMember Where PortCode = @.DestinationPort Or PortCode = @.DestinationCity)
And main.OriginPortSetId in (Select Distinct FarePortSetId
From FarePortSetMember Where PortCode = @.OriginPort Or PortCode = @.OriginCity)
AND ((DateFrom <= @.EarliestDepartureDate) AND (DateTo >= @.EarliestDepartureDate))
AND (DATEDIFF(day, TicketDateFrom,GetDate()) >= 0 AND DATEDIFF(day, TicketDateTo, getdate()) <=0)
And status in ('Active','Updating')
Option (KEEPFIXED PLAN)
I just added the OPTION (KEEPFIXED PLAN) and have been monitoring to see if the problem happens again.
So there is no fancy stuff in the query, but it seems to me that the .NET SQL provider are using different query plan.
Could MVP dudes verify this for us, please?
I am using SQL 2000 by the way and .NET 1.1 component called from ASP.NET 2.0
different results in query analyzer and .net
ok the following statement returns the correct results in sql query analyzer but in the .net environment with c# it returns back less 3 records
SELECT SUM(ao.amount),bl.dpc,bl.city from billinglocation bl
inner join shippinglocation sl on bl.billinglocationid = sl.billinglocationid
inner join absorbentorder ao on sl.shippinglocationid = ao.shippinglocationid
group by bl.dpc, bl.city
billinglocation 1 - 1 shippinglocation 1 - many absorbentorder
anybody have any ideas why this might be occuring
thanks!
Friday, February 17, 2012
Different behaviours on different servers
In that database I have a stored procedure where is an import mechaism using
ODBC driver [Microsoft Text Driver (*.txt; *.csv)] and a .csv file.
On my machine everything works fine, but on the other machine import fails
with an exception
Could not execute query against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [Microsoft][ODBC Text Driver] Too few
parameters. Expected 6.]
My query looks like that:
DECLARE @.TSQL varchar(8000)
SET @.TSQL = 'INSERT INTO TABLE ( col1, col2, col3 )
SELECT * FROM OPENROWSET(''MSDASQL'', ''Driver={Microsoft Text Driver
(*.txt; *.csv)};DefaultDir='+@.import_dir_path+';'', ''select COL1, COL2,
COL3 from '+@.filename+''')'
EXEC (@.TSQL)
SELECT @.Err = @.@.ERROR, @.Rct = @.@.ROWCOUNT
Second error I get:
My location is Polish but my national chars do not pass through other ODBC
driver - for dbf s.
Database was simply detached and atached, so collation hasn't changed.
First machine (the good one) works under WinNTWkst4.0 Polish version with
SP6 and ODBC Drivers version 4.00.5303
Second machine (the bad one) works under Win2kServer Eng with MDAC 2.7.
ODBC Drivers version 4.00.4200.
If anyone can help me - please do that! I'm frustrated to the limit
already...
Regards,
Sliver"S" <sliver_1@.poczta.onet.pl> wrote in message
news:capbr5$jj4$1@.nemesis.news.tpi.pl...
> I have a database and an application in .net using it.
> In that database I have a stored procedure where is an import mechaism
using
> ODBC driver [Microsoft Text Driver (*.txt; *.csv)] and a .csv file.
> On my machine everything works fine, but on the other machine import fails
> with an exception
> Could not execute query against OLE DB provider 'MSDASQL'.
> [OLE/DB provider returned message: [Microsoft][ODBC Text Driver] Too few
> parameters. Expected 6.]
> My query looks like that:
> DECLARE @.TSQL varchar(8000)
> SET @.TSQL = 'INSERT INTO TABLE ( col1, col2, col3 )
> SELECT * FROM OPENROWSET(''MSDASQL'', ''Driver={Microsoft Text Driver
> (*.txt; *.csv)};DefaultDir='+@.import_dir_path+';'', ''select COL1, COL2,
> COL3 from '+@.filename+''')'
> EXEC (@.TSQL)
> SELECT @.Err = @.@.ERROR, @.Rct = @.@.ROWCOUNT
>
> Second error I get:
> My location is Polish but my national chars do not pass through other ODBC
> driver - for dbf s.
> Database was simply detached and atached, so collation hasn't changed.
> First machine (the good one) works under WinNTWkst4.0 Polish version with
> SP6 and ODBC Drivers version 4.00.5303
> Second machine (the bad one) works under Win2kServer Eng with MDAC 2.7.
> ODBC Drivers version 4.00.4200.
>
> If anyone can help me - please do that! I'm frustrated to the limit
> already...
> Regards,
> Sliver
I don't really have a good answer, but one possible issue is that the ODBC
drivers are different versions, and the one which doesn't work seems to be
older, so you might want to install the latest MDAC drivers (2.8, I think),
to see if that helps.
As an alternative, you could try using the Jet driver instead:
http://www.users.drew.edu/skass/sql/TextDriver.htm
Simon|||> I don't really have a good answer, but one possible issue is that the ODBC
> drivers are different versions, and the one which doesn't work seems to be
> older, so you might want to install the latest MDAC drivers (2.8, I
think),
> to see if that helps.
Thanks for answer - but it doesn't seams to be because of different vers. of
ODBC drvs - I've been so desperated that I installed on the fresh machine
win2kSrv with a 2kEnt database, set a patch on it and then mdac 2.8 - but
between all changes I'd been verifing if my query works. Laugh if you want
to - it was working even on fresh db - without any upgrade - and hadn't stop
after upgrades had been set up.
ODBC drivers versions are now the same as on the bad one machine ...
So - I have no idea what can be wrong. Is there anything like national
versions of ODBC drivers?
> As an alternative, you could try using the Jet driver instead:
> http://www.users.drew.edu/skass/sql/TextDriver.htm
It is good idea - but remember of the second problem - chars of my national
my charset aren't served properly... and the files are dbf... I have them
done through a linked server - but still the ODBC driver seems to be a
failure...
S.|||Just a hunch, but I would keep looking down the route of MDAC. We had
a problem with insufficient parameters a while back. From what I
remember later versions of MDAC included an additional parameter to
the connection string when opening a database through an ODBC
connection. It would store this depending on the PC which created the
connection. We found this with a DTS package.
We could create a connection within a DTS package and then use in on
another server (ran as scheduled) which had a lower version which
would then not run. You may be able to test by re-creating the
connection on the version with the lower version so it doesn't include
this additional parameter and it may work. If it does, then I would
suggest a version issue which needs addressing.
As I say, it's a hunch as it's a little while since I looked at it,
but it may be of help to you.
We upgraded each PC and server to the same version of MDAC (2.8) to
get rid or the problem.
HTH
Ryan
Different behavior between 2 installs of SQL Server 2000 !
anyone could explain this : I have installed the same asp.net application on 2 distinct hosts, each with its own SQL Server 2000 database.
However, in some SQL queries in Stored Procedures, the results do not come out the same.
For example, on one server the query "select @.value = (select ...)-(select ...)" works and on the other one it returns a null value
Any hint ?
Thanks for your help
Johannoff the top of my head - does one have a different setting for, say, case-sensitivity?
|||
Well, I don't know about this since I am using distant hosting services.
However, the Stored Procedures are identical since I did an automatic install of both databases using one SQL script.
So ...