Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 22, 2012

( ) problem

hi all,

i have some problem in my web application, am using vb.net

i have a text box and an add button, when the user click on the add button, whatever written in the textbox stores on my sql database

the problem is whenever there is a ( ' ) character in the text, it send me error

i know why this problem occure but i dont know what is the reqired code for it

this is the code:

sql.commandtext = "INSERT INTO myDB (Ques) VALUES ('" & txtQues.text & "')

what is the solution?

The answer is very simple in C# those are literals and in ANSI SQL they are Delimited Identifiers per ANSI SQL 92 and SQL Server is compliant so try the link below on how to enable it and handle it correctly. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms176027.aspx

|||

If you think about it, you are putting together the string before it gets sent to SQL Server. So, if your value has a single quote it, your insert would look something like:

INSERT INTO myDB (Ques) VALUES ('myvalue's')

This is confusing. The string seems to end after the 'e', when you really want it to end after the 's'. As said, SQL Server is taking that literally. If you're going to build the insert statement this way (as opposed to using a stored procedure), you need to replace single quotes with two single quotes (not a double quote - literally two single quotes).

txtQues.Text.Replace("'", "''")

The string passed to the database will be:

INSERT INTO myDB (Ques) VALUES ('myvalue''s')

which the database will interpret correctly.

|||Parameterized queries.|||thanks alot... for your helpBig Smile

Thursday, March 8, 2012

"Named Pipes Provider: Could not open a connection to SQL Server [53]", but only on th

My connection string (to a remote instance of SQL Server Exress 2005) is exactly the same when the web files are located on my local machine or my remote machine, and while it works fine when I use the local web files, I get the following error when I use the remote files:

"Named Pipes Provider: Could not open a connection to SQL Server [53]"

As you can see, since it works from the local version, I've setup SQL to accept remote connections via TCP/IP and Named Pipes. I'm using IIS7 on the local, and IIS6 on the remote, in case that makes a difference. I have other sites setup the same way, which work fine.

Any thoughts?

Open the configuration manager and set SQL Server to allow remote connections.
This is off by default on SQL Server Express Edition.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||Thank you for responding, although as you can see in my question, I point out that this is clearly set up, as I am connecting successfully from my local machine.

However, I should note that I have resolved the problem by replicating the database.
|||

Oops, I didn't read that little sentence, sorry :-)

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

Tuesday, March 6, 2012

"Failed to create web application" error during installation of SQL 2k5b2

I was installing SSRS 2005 Beta 2 and near completion of the installation, i encountered the following error. I don't know what causes this. How can i avoid this? I've installed the rest of the whole SQL 2K5 package.

Machine : xxxxx
Product : Microsoft SQL Server 2005 Reporting Services Beta 2
Product Version : 9.00.852
Install : Failed
Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0017_xxxxxx_RS.log
Last Action : InstallFinalize
Error String : The setup failed to create web application: /LM/W3SVC/1/Root/Reports. The error code is -2146959355.

Ok its working now. the MS DTC was enabled but not all its options were selected. I selected all of them, and reinstalled it worked.

If there's anyone just as blurr as i am, its available in WinXP thru the

Administrative tools > Component Services option.

In the left console, Expand 'Console Root > Component Services > Computers'. You should see My Computer as the next node.

The funny thing is, on my pc, when right-clicking on My Computer, i couldn't see the 'Properties' option. I had to click 'Configure My Computer' button at the toolbar (should be the last button) to enable MS DTC. AFter that , the properties option was visible on the menu.

Hope this helps anyone who might face this problem.

Thursday, February 16, 2012

<DeviceInfo> <DpiX> not working with pdf (sql 2005)

Hello,
I'm trying to set dpi of output pdf using DpiX and DpiY but they seem
to not work.
I call SQL 2005 Reporting Services through web services.
I call the method Render with devInfo = "<DeviceInfo><DpiX>600</DpiX><DpiY>600</DpiY></DeviceInfo>".
Ideas? Thank you.
FabrizioHave you figured this out yet? I am having the same problem.
Thanks!
"fhtino" wrote:
> Hello,
> I'm trying to set dpi of output pdf using DpiX and DpiY but they seem
> to not work.
> I call SQL 2005 Reporting Services through web services.
> I call the method Render with devInfo => "<DeviceInfo><DpiX>600</DpiX><DpiY>600</DpiY></DeviceInfo>".
>
> Ideas? Thank you.
>
> Fabrizio
>|||It looks like this option may have gone away with SQL 2005!
Compare these two pages
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_8bld.asp
http://msdn2.microsoft.com/en-us/library/ms154682(SQL.90).aspx
Can this be true?|||I have found no solution. DpiX and DpiY seem to be not available in
sql2005.
I think it's could be very usefull a response from MS... is there
anyone from MS?
Fabrizio
shelley wrote:
> Have you figured this out yet? I am having the same problem.
> Thanks!

>> Can Google web search index the data in my database?

I have content about projects that I store in a MS SQL database.
People access this information through pages which are dynamically
created in PHP. Since my content is stored in the database, how can I
get google web search (at google.com) to included that content when it
indexes my site? Is it a possibility? Thank you so much!I don't think this is the right group for this question (but I'm not
sure which group is right). Here are some links that might help
(especially the first one):
https://www.google.com/webmasters/s...ocs/en/faq.html
http://desktop.google.com/developerguide.html
http://www.google.com/enterprise/mini/index.html

Razvan|||gene.ellis@.gmail.com wrote:
> Since my content is stored in the database, how can I
> get google web search (at google.com) to included that content when it
> indexes my site? Is it a possibility? Thank you so much!

Google will NOT index your database. However, Google will follow all
the links on your website. If your website is designed so that the
dynamic content is only accessible though, for example form fields,
then google will not be able to find it. On the other hand, any
dynamic content that is accessible through a simple hypertext link will
be found and indexed by google.

> I have content about projects that I store in a MS SQL database.

As an example, let's say that you have a page named projectinfo.php
that accepts as input a variable named ProjectID and looks up and
displays info about that project. On some other page, a user selects
the project that they want to view. The user is then directed to
projectinfo.php. If that other page consists of a form with a
drop-down box, so that the user selects a project from the drop down
and then hit's a submit button, then google probably will not be able
to follow it.

On the other hand, if that other page contains anchors with hrefs like:
projectinfo.php?projectID=1
projectinfo.php?projectID=2
projectinfo.php?projectID=3

Then google absolutely will be able to follow those links and index the
pages.

Hope that helps

Saturday, February 11, 2012

#error deploying a report.

Hello,
I created a report, where one of the fields is using an embedded code:
strReturn = System.Web.HttpUtility.UrlDecode(strURL). I added a
reference to System.Web.dll and it works fine in the RS designer. But
when I deploy it to the report server it shows #Error in the field.
>From the report server config file it seems that all Microsoft signed
assemblies have full trust. I checked the versions and public token
keys of the referenced assembly on my machine and one on the server
where the report server is and they match. What can be wrong?
Thanks,
SteveIt looks like code access permissions problem.
Your expression may call some function that requires special CAS
persmission.
It does not look like System.Web.HttpUtility.UrlDecode() has the
requirement. Do you also call some other function?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<sgelfmann@.yahoo.com> wrote in message
news:1116944339.636538.109880@.z14g2000cwz.googlegroups.com...
> Hello,
> I created a report, where one of the fields is using an embedded code:
> strReturn = System.Web.HttpUtility.UrlDecode(strURL). I added a
> reference to System.Web.dll and it works fine in the RS designer. But
> when I deploy it to the report server it shows #Error in the field.
> >From the report server config file it seems that all Microsoft signed
> assemblies have full trust. I checked the versions and public token
> keys of the referenced assembly on my machine and one on the server
> where the report server is and they match. What can be wrong?
> Thanks,
> Steve
>|||More specifically, you will find the AutoRefresh property in the VS menu:
Report -> Report Properties -> General tab
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Alexandre Mineev" <almineev@.microsoft.com> wrote in message
news:Ozx4JdYYFHA.1868@.TK2MSFTNGP14.phx.gbl...
> It looks like code access permissions problem.
> Your expression may call some function that requires special CAS
> persmission.
> It does not look like System.Web.HttpUtility.UrlDecode() has the
> requirement. Do you also call some other function?
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> <sgelfmann@.yahoo.com> wrote in message
> news:1116944339.636538.109880@.z14g2000cwz.googlegroups.com...
>> Hello,
>> I created a report, where one of the fields is using an embedded code:
>> strReturn = System.Web.HttpUtility.UrlDecode(strURL). I added a
>> reference to System.Web.dll and it works fine in the RS designer. But
>> when I deploy it to the report server it shows #Error in the field.
>> >From the report server config file it seems that all Microsoft signed
>> assemblies have full trust. I checked the versions and public token
>> keys of the referenced assembly on my machine and one on the server
>> where the report server is and they match. What can be wrong?
>> Thanks,
>> Steve
>