Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Wednesday, March 21, 2012

Image handling with SQL

I am using SQL Express and I do not know how to add images to my database. I've created a dataset and linked it to datalists so everything is perking along except I'm just clueless on the image handling. I create a resx file thinking that work except I don't know how to coordinate it with the data. In Access it is an easy thing to add an image OLE object to my database which gives me a load of options in reports so you would think that it would handle similarly here, but I'm not making any progress and after a week an half of hunting around I'm hoping someone here will clue me in.

Thanks

Have a look at this
http://www.dotnetspider.com/Question117.aspx

HTH

Image does not display

Hi post,
I have created a simple report using VS.net with an embeded image.
when I open the report from my PC the image displays well not a problem.Also
for any users this works fine.
My PC name is "Personal1"
Report server exists on Server: "Server1"
url used to access this Report is http://Server1.gar.abc.com/Reports
BUT the problem is
When I access this report from other servers(Personal2,Personal3 etc)
it does not display image(Or it display missing image icon).
Can someone suggest the cause and problem.
thanks
-aslamSolved this problem from the link
http://www.codeproject.com/useritems/RenderStreamImages.asp
-aslam
"replyaslam" wrote:
> Hi post,
> I have created a simple report using VS.net with an embeded image.
> when I open the report from my PC the image displays well not a problem.Also
> for any users this works fine.
> My PC name is "Personal1"
> Report server exists on Server: "Server1"
> url used to access this Report is http://Server1.gar.abc.com/Reports
> BUT the problem is
> When I access this report from other servers(Personal2,Personal3 etc)
> it does not display image(Or it display missing image icon).
> Can someone suggest the cause and problem.
> thanks
> -aslamsql

Monday, March 19, 2012

Image background problem

Hai,

I hope anybody can help me with the following problem.

I've created a report on which there is a single image (using: Insert->Picture) with a white background. If I export this report to pdf or word or html the background of this image is blueish...

I have tried using transparent gif, transparent png but nothing seems to work.

Does anybody have any idea how i can solve this?

Thanx in advance,

BertStrange problem
Are you able to chage that color in Word or Pdf?

Image datatype

Hi,

I created a table with one column being that of an 'image' data type. The problem is I don't know how to insert an image into that column. Pleas Help.

Hello aniait,

Here is a step-by-step example of storing and retrieving image files in sqlserver 2005 express!

http://chiragrdarji.wordpress.com/2007/03/05/storing-and-retrieving-image-in-sql-server/

Hope this helps!

Monday, March 12, 2012

im beginner with sql.please help

hi
i work with sql server and created a transitory querry , result of which is the set of payable accounts order by Customer i stored in #tableindex1 and that looks like this:

customer invoice date of payment(A) value difference (03.10 -"A") AS B
--- --- ------- -- ----------
201100 174 2003-09-19 600 13 days
201100 230 2003-09-24 500 9 days
201100 270 2003-09-26 300 7 days
301000 100 2003-09-26 200 7 days

Now i want to create a final querry that stores the data in the following way.
IF #tableindex.B < 0
THEN SUM invoices' value is stored in the column " C"
IF #tableindex.B > 0 AND < 8
THEN SUM invoices' value is stored in the column " D"
IF #tableindex.B> 8 AND < 14
THEN SUM invoices' value is stored in the column " E"

Finally result should look like this:

Customer sum of CDE C D E
---- ---- -- -- --
201100 1400 - 300 1100
301000 200 - 200

Thanks in advance for every helpthat value inside of the SUM command is evaluated for every record returned, and then SUMed up afterwards. So you can put IF statements inside the SUM function to include or not include certain values.

Like this

insert into table values
( select customer, sum(invoice), sum(if(tableindex.B<0,invoice,0)),
sum(if((tableindex.B >0) and (tableindex.B < 8),invoice,0)),
sum(if((tableindex.B > 8) and (tableindex.B<14),invoice,0)))

-Chris
Make sure to visit my BiteSize SQL Tutorial (http://www.bitesizeinc.net/index.php/sql.html)|||Originally posted by christodd
that value inside of the SUM command is evaluated for every record returned, and then SUMed up afterwards. So you can put IF statements inside the SUM function to include or not include certain values.

Like this

insert into table values
( select customer, sum(invoice), sum(if(tableindex.B<0,invoice,0)),
sum(if((tableindex.B >0) and (tableindex.B < 8),invoice,0)),
sum(if((tableindex.B > 8) and (tableindex.B<14),invoice,0)))

-Chris
Make sure to visit my BiteSize SQL Tutorial (http://www.bitesizeinc.net/index.php/sql.html)

Hello Chris ,Your solution would be really great for my problem, but whenever i want to run this querry i receive a message like this:
Server: Msg 156, Level 15, State 1, Procedure nalezn2, Line 30
Incorrect syntax near the keyword 'if'.
Server: Msg 170, Level 15, State 1, Procedure nalezn2, Line 30
Line 30: Incorrect syntax near ','.
i remeind you that i work with sql server200 querry analyzer.maybe syntax:sum(if....) doesn't work at this environment.|||Try using CASE

insert into table values
(
select customer,
sum(invoice),
sum(case when tableindex.B<0 then invoice else 0 end),
sum(case when tableindex.B >0 and tableindex.B < 8 then invoice else 0 end),
sum(case when tableindex.B > 8 and tableindex.B<14 then invoice else 0 end)

FROM...

)|||Originally posted by cvandemaele
Try using CASE

insert into table values
(
select customer,
sum(invoice),
sum(case when tableindex.B<0 then invoice else 0 end),
sum(case when tableindex.B >0 and tableindex.B < 8 then invoice else 0 end),
sum(case when tableindex.B > 8 and tableindex.B<14 then invoice else 0 end)

FROM...

)

Hello Guys
Im really greatfull for your help.It really works with "case" but...
while using querry as above i received the following messageServer: Msg 156, Level 15, State 1, Procedure nalezn2, Line 37
Incorrect syntax near the keyword 'select'.
Server: Msg 170, Level 15, State 1, Procedure nalezn2, Line 42
Line 42: Incorrect syntax near ')'.
I got rid: the word "values" in the "insert into" syntax,parenthesises in front of the "select" and at the end of querry.
After that i got a message:
Server: Msg 8118, Level 16, State 1, Procedure nalezn2, Line 36
Column '#Tableindex4.costumer' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.
So I added GROUP BY 'konto' to my querry that finally looks like that:

insert into #table
select customer,
sum(invoice),
sum(case when #tableindex.B<0 then invoice else 0 end),
sum(case when #tableindex.B >0 and tableindex.B < 8 then invoice else 0 end),
sum(case when #tableindex.B > 8 and tableindex.B<14 then invoice else 0 end)
FROM #tableindex GROUP BY Konto

This time my querry runs. i checked some top rows.It seems to be really good.But only by curiosity i'd like to know why it didn't want to go with the syntax that you proposed.I mean the syntax with "Insert into table VALUES... Isnt't it the same??
Could be the reason the table tableindex is temporary and a table i insert into is also temporary??|||Originally posted by aseban
Hello Guys
Im really greatfull for your help.It really works with "case" but...
while using querry as above i received the following messageServer: Msg 156, Level 15, State 1, Procedure nalezn2, Line 37
Incorrect syntax near the keyword 'select'.
Server: Msg 170, Level 15, State 1, Procedure nalezn2, Line 42
Line 42: Incorrect syntax near ')'.
I got rid: the word "values" in the "insert into" syntax,parenthesises in front of the "select" and at the end of querry.
After that i got a message:
Server: Msg 8118, Level 16, State 1, Procedure nalezn2, Line 36
Column '#Tableindex4.costumer' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.
So I added GROUP BY 'konto' to my querry that finally looks like that:

insert into #table
select customer,
sum(invoice),
sum(case when #tableindex.B<0 then invoice else 0 end),
sum(case when #tableindex.B >0 and tableindex.B < 8 then invoice else 0 end),
sum(case when #tableindex.B > 8 and tableindex.B<14 then invoice else 0 end)
FROM #tableindex GROUP BY Konto

This time my querry runs. i checked some top rows.It seems to be really good.But only by curiosity i'd like to know why it didn't want to go with the syntax that you proposed.I mean the syntax with "Insert into table VALUES... Isnt't it the same??
Could be the reason the table tableindex is temporary and a table i insert into is also temporary??

i was wrong.It doesnt work good|||Whenever you are using an aggregate function like SUM, COUNT, or AVG you must group by the remaining columns that are not inside the SUM, COUNT, or AVG.

I've been using mySQL too long, and it adds them automatically if you don't list them, so I didn't mention it.|||Originally posted by christodd
Whenever you are using an aggregate function like SUM, COUNT, or AVG you must group by the remaining columns that are not inside the SUM, COUNT, or AVG.

I've been using mySQL too long, and it adds them automatically if you don't list them, so I didn't mention it.

Thank you guys.You really helped me to find the solution.Im really gratefull.

Im a noob and i need to make cell editable in studio

I have created a table in sql studio and i need to make cell editable and be able to update them to the server. I have looked around here but all i can find is code for the site side, i need a way to do it in studio if possible. BTW im very new to this so im sorry in advance

Hi,

Do you want to edit your data in the tools such like sql management studio? If so, first you should connect to your remote sql server, and click on your database node, open your datatable, edit your data. If you are familiar with sql statement, you can connect to you database server by Query Analyzer and execute your sql command, it also can help you edit the data in your remote database.

Here are some HowTo articles which might be helpful to you .http://support.microsoft.com/ph/2855/en-us/?aid=1&GSA_AC_More1

Hope that helps. Thanks.

|||

OK, thanks i got it working in studio now. How can i make only a part of a row editable and now the rest? I didnt see a way to do that

|||

Hi,

"only a part of a row..."Do you want to make some of the columns editable? Well, it has related to the role problem. In SQL92, you can use GRANT syntax to set the specific authority against those columns or fields in a table and grant a user the authority. About GRANT, see:http://msdn2.microsoft.com/en-us/library/ms178569.aspx .

The second way is just set the authority against a table. The table contains those columns or fields which should be editable or uneditable and make a View with other tables. In this way, you also can achieve your goal.

Thanks.

Wednesday, March 7, 2012

IIS Basic authentication problem - 401 Unauthorized error

Hello all,
I have users attempting to view reports (created in Reporting Services 2000)
over the web and they're receiving a "401 - Unauthorized" error due to
invalid credentials. Here is the VB.NET code that's being used to
authenticate the user:
Dim strURL as String = "http://mydomain.mywebsite.com/ReportServer?MyFolder/MyReport?arg1=1&arg2=2&rs:Command=Render&rs:Format=PDF"
Dim ReportWebRequest As HttpWebRequest = CType(WebRequest.Create(strReportURL), HttpWebRequest)
ReportWebRequest.Timeout = 1000000
ReportWebRequest.MaximumAutomaticRedirections = 50
ReportWebRequest.Headers.Add("Authorization", "Basic " +
Convert.ToBase64String(Encoding.ASCII.GetBytes("userid:password")))
ReportWebRequest.PreAuthenticate = True
Dim ReportWebResponse As HttpWebResponse = CType(ReportWebRequest.GetResponse(), HttpWebResponse)
We would prefer not to turn on anonymous access. We are running IIS vers.6
on a Win 2003 Server. Any ideas?
Thanks in advance,
BruceBruce,
Try replacing the following lines of code...
ReportWebRequest.Headers.Add("Authorization", "Basic " +
Convert.ToBase64String(Encoding.ASCII.GetBytes("userid:password")))
ReportWebRequest.PreAuthenticate = True
...with these lines:
Dim cCache = New CredentialCache
cCache.Add(New Uri(strReportURL), "Basic", New NetworkCredential("userid",
"password", "domain"))
ReportWebRequest.Credentials = cCache
Hope this helps,
Steve
"Bruce A" wrote:
> Hello all,
> I have users attempting to view reports (created in Reporting Services 2000)
> over the web and they're receiving a "401 - Unauthorized" error due to
> invalid credentials. Here is the VB.NET code that's being used to
> authenticate the user:
> Dim strURL as String => "http://mydomain.mywebsite.com/ReportServer?MyFolder/MyReport?arg1=1&arg2=2&rs:Command=Render&rs:Format=PDF"
> Dim ReportWebRequest As HttpWebRequest => CType(WebRequest.Create(strReportURL), HttpWebRequest)
> ReportWebRequest.Timeout = 1000000
> ReportWebRequest.MaximumAutomaticRedirections = 50
> ReportWebRequest.Headers.Add("Authorization", "Basic " +
> Convert.ToBase64String(Encoding.ASCII.GetBytes("userid:password")))
> ReportWebRequest.PreAuthenticate = True
> Dim ReportWebResponse As HttpWebResponse => CType(ReportWebRequest.GetResponse(), HttpWebResponse)
> We would prefer not to turn on anonymous access. We are running IIS vers.6
> on a Win 2003 Server. Any ideas?
> Thanks in advance,
> Bruce

Sunday, February 19, 2012

Ignoring time stamp in my date parameter

Hi,

I'm pretty new at this, writing SQL and reporting services. I created a report with a date parameter. I need the report to ignore the timestamp. My @.Startdate is fine because the timestamps is at 12:00:00AM but my @.EndDate also has this timestamp. I need to pull all the data up to the end date the user enters without taking the timestamp into consideration.

If someone can help me out with, I would greatly appreciate it.

Thanks,

Hello,

If I understand correctly, you want to include the date that your user selects in your results. The problem is that when a parameter is used, it assumes midnight, so any values that are on that day but have a time other than midnight will not be included. In order to fix this, just add one day to your EndDate parameter.

In your SQL query, add this:

... where DateField >= @.StartDate and DateField < dateadd(d, 1, @.EndDate)

Hope this helps.

Jarret

|||

You got it! I've been adding one day when I enter the dates when I test the report. I don't know why I did not think of just adding one day in the code. I guess I was thinking too hard trying to completely ignore the timestamp.

Anyways, I think this will work with the users. THey will definitely be happy that they do not have to type in the timestamp when they run their reports.

Thank you so much!!

|||

Glad I could help!

Jarret