Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Sunday, March 25, 2012

connecting to SQL db in an asp.net page

Ok, I'm an experienced asp developer switching to asp.net.

I've used the "Quickstart Tutorials" (http://www.asp.net/Tools/redir.aspx?path=quickstart) and have gotten started that way and built a few things based on that, but they only show XML connection info. Now I need to switch to SQL so I can connect to MS SQL Server for some stored procedures.

Anyone have suggestions?

(I've dug through some articles on msdn, etc, but I've only found so far theory and not code. And let me tell 'ya, I'm big on learning about code from code.)

If this helps, the specific tasks I'm trying to do are:
Have user select a static value from a drop down list, enter a word in a text box, and submit the form (so far so good), which connects to the db and returns the datagrid filled with results (the part I don't have). I already have my sp, just can't connect to it and get results back into the page.The Tutorials on this site have an example of doing just that. Check outPerforming a Parameterized Select

Sound like you have all of the pieces you need, you just need to stitch them together. Viewing the source code of that example should help you do just that. Post back if you are having trouble implementing it.

Terri|||I receive this error:

Server Error in '/Test1' Application.
------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /Test1/VB/datagrid2.aspx|||The problem is probably with the SqlConnection -- specifically, it is trying to read the connection string out of the web.config file. This is a good practice. But, let's try to get the sample running for you first.

Instead of this line:

MyConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("PubsString"))

Try this line (assuming you are using a local SQL Server with Windows authentication)
MyConnection = New SqlClient.SqlConnection("server=(local);database=pubs;Trusted_Connection=yes")

Terri|||Ok, I'm looking at these various example ways to set up and connect to dbs.

I have a local sql server running on my machine.
I can use the sa account.
I have databases, sps, and tables already on it.

I've tried looking at the examples and changing to fit, but either I'm missing something or I've put info in the wrong place.

hum.|||YAY YAY YAY!!!

Thank you! I changed your line:
MyConnection = New SqlClient.SqlConnection("server=(local);database=pubs;Trusted_Connection=yes")

To:
MyConnection = New SqlClient.SqlConnection("server=(local);database=mydbname;uid=sa;pwd=sa;")

and it works in the datagrid2.aspx sample file! 8)

Whew!

Ok, now time to get this working in my files...

Thanks again!

Sunday, March 11, 2012

connecting to data source issue

I'm having a problem connecting to an access database from
http://localhost/reports. I can connect from the computer I developed the
reports but when I goto another computer it gives me this error message
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'DataSource1'.
(rsErrorOpeningConnection)
I've created the same exact odbc connection in the systems tab as on the
computer I've created the project with. I've looked at there online help
but it didn't have any suggestions.
Is there anything else I need to do on the other computer in order for this
to work?
TIA,
JacksonHi Jackson
I am having the exact same problem. Did you find a solution? Should I find
one I will post it here.
Tina - MSFTE
"Jackson" wrote:
> I'm having a problem connecting to an access database from
> http://localhost/reports. I can connect from the computer I developed the
> reports but when I goto another computer it gives me this error message
> An error has occurred during report processing. (rsProcessingAborted)
> Cannot create a connection to data source 'DataSource1'.
> (rsErrorOpeningConnection)
> I've created the same exact odbc connection in the systems tab as on the
> computer I've created the project with. I've looked at there online help
> but it didn't have any suggestions.
> Is there anything else I need to do on the other computer in order for this
> to work?
>
> TIA,
> Jackson
>
>|||Jackson and Tina
I am having the same problem and have posted everywhere trying to find a
fix. This supposedly works. I have turned it over to the Network Mgr and he
is reviewing it. Hopefully, it will solve the problem. If it works, please
let me know or, if you find another solution I wuld really appreciate hearing
about it.
Roy
1. Kerberos is enabled
2. The servers are trusted for delegation
3. The SPN's are configured
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_2gmm.asp"
4. If you have several domain controllers wait for replication to complete.
If you don't wait you will pull your hair out because nothing you try will
works and all of sudden a few hours latter it starts working and you can't
figure out why.
5. Make sure all users have the option 'Enable Integrated Windows
Authentication' enabled in internet explorer, without it they will still get
the authentication error.
"Jackson" wrote:
> I'm having a problem connecting to an access database from
> http://localhost/reports. I can connect from the computer I developed the
> reports but when I goto another computer it gives me this error message
> An error has occurred during report processing. (rsProcessingAborted)
> Cannot create a connection to data source 'DataSource1'.
> (rsErrorOpeningConnection)
> I've created the same exact odbc connection in the systems tab as on the
> computer I've created the project with. I've looked at there online help
> but it didn't have any suggestions.
> Is there anything else I need to do on the other computer in order for this
> to work?
>
> TIA,
> Jackson
>
>|||It took a while but I finally got a work around.
I'm currently taking daily snapshots of the access reports. So now I don't
even need to create odbc connections on other user computers.
"Tina (MSFTE)" <Tina (MSFTE)@.discussions.microsoft.com> wrote in message
news:212D3E5F-C8D8-412F-9493-EBB9EACADA1A@.microsoft.com...
> Hi Jackson
> I am having the exact same problem. Did you find a solution? Should I find
> one I will post it here.
> Tina - MSFTE
> "Jackson" wrote:
>> I'm having a problem connecting to an access database from
>> http://localhost/reports. I can connect from the computer I developed
>> the
>> reports but when I goto another computer it gives me this error message
>> An error has occurred during report processing. (rsProcessingAborted)
>> Cannot create a connection to data source 'DataSource1'.
>> (rsErrorOpeningConnection)
>> I've created the same exact odbc connection in the systems tab as on the
>> computer I've created the project with. I've looked at there online help
>> but it didn't have any suggestions.
>> Is there anything else I need to do on the other computer in order for
>> this
>> to work?
>>
>> TIA,
>> Jackson
>>|||Roy,
Your post put me on the right track. The IIS server we deployed to is not in
a domain, neither was any of the users. I did not even think of looking for
this scenario, I assumed we were on the domain.
1) I requested a user to be created on the domain.
2) I gave this user Data reader rights on all the SQL and AS servers that
forms part of my solution
3) In RS I used the full username and password to be saved securely in RS
4) Selected "Use as WIS credentials to make the connection"
5) Selected "Impersonate user after connection created"
It works like a charm. Due to the client's unique network configuration -
servers on the network, but not in the domain - this is the only way the
solution will work.
"Roy" wrote:
> Jackson and Tina
> I am having the same problem and have posted everywhere trying to find a
> fix. This supposedly works. I have turned it over to the Network Mgr and he
> is reviewing it. Hopefully, it will solve the problem. If it works, please
> let me know or, if you find another solution I wuld really appreciate hearing
> about it.
> Roy
> 1. Kerberos is enabled
> 2. The servers are trusted for delegation
> 3. The SPN's are configured
> "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_2gmm.asp"
> 4. If you have several domain controllers wait for replication to complete.
> If you don't wait you will pull your hair out because nothing you try will
> works and all of sudden a few hours latter it starts working and you can't
> figure out why.
> 5. Make sure all users have the option 'Enable Integrated Windows
> Authentication' enabled in internet explorer, without it they will still get
> the authentication error.
> "Jackson" wrote:
> > I'm having a problem connecting to an access database from
> > http://localhost/reports. I can connect from the computer I developed the
> > reports but when I goto another computer it gives me this error message
> >
> > An error has occurred during report processing. (rsProcessingAborted)
> >
> > Cannot create a connection to data source 'DataSource1'.
> > (rsErrorOpeningConnection)
> >
> > I've created the same exact odbc connection in the systems tab as on the
> > computer I've created the project with. I've looked at there online help
> > but it didn't have any suggestions.
> >
> > Is there anything else I need to do on the other computer in order for this
> > to work?
> >
> >
> > TIA,
> >
> > Jackson
> >
> >
> >|||I ran into the same issue. I have modified security to report howeve
I noticed that it is using the users credentials who is accessing th
report to initiate Oracle connection. It looks like the use
requires elevated permissions on C:\Program Files\Oracle and possibl
other directories
Still investigating...
Rya|||If you creaye a secure use in RSthat user can have the elevated priviledges
and not your real life users - better from a security point of view - that is
why I selected the options I did. See if that works to Oracle as well.
Cioa
Tina
"rjohnstone" wrote:
> I ran into the same issue. I have modified security to report however
> I noticed that it is using the users credentials who is accessing the
> report to initiate Oracle connection. It looks like the user
> requires elevated permissions on C:\Program Files\Oracle and possibly
> other directories.
> Still investigating...
> Ryan
>

Thursday, March 8, 2012

Connecting to Analysis Services using HTTP

my analysis server is hosted on a win2k server with IIS, the hosting page is
on another machine. I have followed everything as per MS KB article and I
could not connect through the analysis server using http. i have similar
implementation on my dev machine but the main difference is my OLAP is on
top of winxp. i just wanted to know if i am missing any other setting not
specified on the MS KB article on how to implement OLAP cube through HTTP
over win2k operating system.

note: i tried connecting to olap using the MDX sample application using
MSOLAP.2 provider and connecting through a simple office web component. I
think the best way to test the connection is through the MDX sample
application that comes with Analysis Server installation.Check security for IIS and to the C:\Program Files\Microsoft Analaysis
Server\Bin folder and hidden share. Without any error messages there
is little we can help you with.|||Adam,
I am able to access the msolap.asp through the website. that means I
have permission to the file on the IIS side.
I will be checking the permission on the Analysis Server folder.

Whenever I try to connect using the MDX Sample Application to the HTTP
server(with my cubes) the app seem to hang. after waiting
for about 2 minutes it gives me an error "unable to connect..."

"Adam J. Tybor" <adam.tybor@.gmail.com> wrote in message
news:1096106771.514490.178060@.k17g2000odb.googlegr oups.com...
> Check security for IIS and to the C:\Program Files\Microsoft Analaysis
> Server\Bin folder and hidden share. Without any error messages there
> is little we can help you with.