Problem Accessing Database Via .asmx Webservice
May 12, 2008
I just added a .asmx webservice to my project.
When i try to retrieve some information of the database using the webservice, despite using the same code as in a code behind .aspx file, it doesn't work.SqlConnection conn =
new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);DataTable dt = new DataTable();
conn.Open();
String sql = "SELECT * FROM aspnet_Users";
//But i would suggest you to use parameterize queries or SP for security reasonsSqlCommand cmd = new SqlCommand(sql, conn);cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();SqlDataAdapter ad = new SqlDataAdapter(cmd);
ad.Fill(dt);
conn.Close();
Using this code in .aspx.cs it works, but in my .asmx it doesn't. The 'cmd.ExecuteNonQuery()' returns '-1' in the .asmx.
I have to use the webservice because i have a Silverlight client in my application, whichs has to retrieve data from the database.
Any ideas why it works for the .aspx.cs and not for the .asmx file?
View 4 Replies
ADVERTISEMENT
Jun 11, 2008
Geekz,
My problem is that , I had setup blog on server say, blog.xyz.com [I am using blogengine.net, which is in ASP.Net]. It is using sql server2005 as a backend for storing its blog's posts. After settingup blog, i tried to access its database through my windows application. But while development I was getting error that
"An error has occured while establishing a onnection to the server. When connecting to SQL server 2005, this failure may be caused by the fact that under the defaukt settings SQL server doesnot allow remote connections.(Provider Named Pipes, error :40 - Could not open a connection to SQL Server)"
I am using [String ConnectionString = "Data Source=sql-v123.mesa11.1Server.net; Initial Catalog=abc; User ID=xyz; Password=xyz123";]
Then I decided to created a webservice that will access the data from databse blog and store it somewhere in datatable and using windows application i will retrieve those data for end user. So I want to to know that whether i can access the datatable of webservice holding the blog data from windows application or not. if answer is Yes, then please provide me with source or some great links. Or if There is any other option so that I can access my database directly from windows application, then it would be better. Looking for your answers.
Thanks and regards
View 3 Replies
View Related
Jan 16, 2008
Hi,
I am using PHP5 and SSRS 2005 to execute a report via ReportExecution2005.asmx?wsdl (using PHP's SOAP functions). I keep getting the error:
"Microsoft.ReportingServices.Diagnostics.Utilities.MissingSessionIdException: The session identifier is missing. A session identifier is required for this operation."
I know what the SessionID after successfully calling the LoadReport method (ExecutionID in the ExecutionHeader) but cannot seem to pass this along to the Render method. Does anyone know how to pass that along?
This is similiar in issue to the post at http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2643092&SiteID=17 but for PHP instead of Java.
Thanks!
View 3 Replies
View Related
May 14, 2007
Dear SQL Server Reporting Services gurus,
Before I begin describing our problem, let me first start off with a description of our environment and current configuration.
Background/Configuration Specs
We have SQL Server Reporting Services running on a Microsoft Windows Server 2003, Standard Edition, Service Pack 1 server. It is configured so that the Reports and ReportServer virtual directories run under a sql server domain account.
The datasets for our reports are xml datasets returned from calling a web service on a second IIS server, Microsoft Windows Server 2003, Standard Edition, Service Pack 1. The web service runs under a service account and is not set to impersonate the user. The web service contacts a database located on the same server as reporting services to retrieve the data. So, it should receive the request, login to the database it is trying to access using the service account, and return the dataset.
We are programatically accessing reports via a client application, specifying the virtual directory via the reportserver url (e.g. http:\hostname\reportserver\virtual directory path\report name).
Kerberos is enabled on both the sql box and the iis box with constrained delegation allow the sql account access to the iis box.
Problem
When I try to browse to the report from Report Manager in IE, (http:\hostname\Reports\...etc) I am able to successfully view the report.
When I try to view the report in the client app, (http:\hostname\reportserver\...etc.) the report fails.
Looking at the iis logs, it appears that in the first case, the web service is receiving the request from the sql server domain account. In the second case, it appears that the web service is receiving the request from an anonymous login.
Questions
What exactly is the difference between rendering/viewing a report via ReportManager versus programatically via ReportServer?
Is there any configuration we need to be aware of when configuring ReportServer?
Any help you can provide would be very much appreciated.
Thanks,
prettybrneyes81
View 1 Replies
View Related
Sep 22, 2006
Is it possible to access a webservice from within SQL 2005?What I am looking to do is place a trigger on a specific table, and detect if a specific column is being updated. If it is, I want to launch a robust process that does x, y and z. Something like this:1) record is updated indicating that an account is closed.2) SQL launched a webservice/ aspx page that builds an HTML email template and then mail it.thanks!
View 2 Replies
View Related
Feb 21, 2007
I'm running rs2005 sp2, and the dll was made with .net 1.1. Before, there were no issues with this version crossing of .net 1.1 and 2.0.
In the RS IDE, the webservice call works fine. I've read that this execution is done with full trust - so I've tried to tackle the CAS issue.
When I try to call the webservice from the dll, I catch the exception, and it's:
Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Now what confuses me is, why is the version of WebPermission 2.0 when the dll is 1.1? Maybe there is translation done and the dll is really run w/ the 2.0 framework?
Anyways, this I've done are:
* Added this right before my webservice call. Is something missing?
// We need to ensure that this library is permitted to access the webservice url
// http://support.microsoft.com/default.aspx?scid=kb;en-us;842419
System.Text.RegularExpressions.Regex urlRegEx = new System.Text.RegularExpressions.Regex(@"http://server/.*");
System.Net.WebPermission p = new System.Net.WebPermission(NetworkAccess.Connect, urlRegEx);
p.Assert();
* Gave the 'All_Code' group permission of full trust in both .net 1.1 and 2.0 configurations to see if it helped - it did not, and I checked the report after I did an iisreset. This should have done it!!
* I also tried changing: rsmgrpolicy.config and rssrvpolicy.config
and updated these lines to have version 2.0.0.0:
<SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<SecurityClass Name="WebPermission" Description="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
iisreset was done, and the code executed was still complaining about the permission request failing for WebPermission.
* These blocks were added to rsmgrpolicy.config and rssrvpolicy.config, in respective sections:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="CompanyPermissionSet"
Name="CompanyRS"
Description="">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program Files/Microsoft SQL Server/MSSQL.3/Reporting Services/ReportServer/bin/Company.RS.dll"/>
</CodeGroup>
<PermissionSet class="NamedPermissionSet"
version="1"
Name="CompanyPermissionSet">
<IPermission class="SecurityPermission"
version="1"
Flags="Assertion, Execution"/>
<IPermission class="WebPermission"
version="1">
<ConnectAccess>
<URI uri="http://server/"/>
<URI uri="http://*.Company.com"/>
</ConnectAccess>
<AcceptAccess>
<URI uri="http://server/"/>
<URI uri="http://*.Company.com"/>
</AcceptAccess>
</IPermission>
</PermissionSet>
View 1 Replies
View Related
Apr 28, 2008
I am desperate to retrieve lists from SharePoint using Reporting Services to consolidate with other data
I got stopped before I ever started. Defined a data source using the following syntax....but then I search for vti_bin or lista.asmx if find none.
http://<server>/<path>/_vti_bin/lists.asmx.
sharepoint/SQL 2005 running in intergated mode on single machine for proof of concept.
after formulating the dataset query I receive an error that
the XmlDP query is invalid.(Microsoft.ReportingServices.DataExtensions)
Any ideas how I screwed things up?
.
View 2 Replies
View Related
Jul 23, 2007
Hi,
I am getting below error message while uploading reports using RS.EXE command or MS Management Studio. There is no problem if I use IE and connect to https://localhost/Reports and then upload the .rdl file.
Could not connect to server: https://localhost/ReportServer/ReportService2005.asmx
Any idea what is the problem? I have SecureConnectionLevel=2 and UrlRoot as https://FQDN_SERVERNAME/reportserver in rsreportserver.config file. FQDN_SERVERNAME matches exactly with my web site certificate name.
Thanks
View 1 Replies
View Related
Mar 9, 2006
I have a report server set up to use SSL and Basic authentication. I am trying to create an application that uses the ReportService2005 web service. I can add the web reference ok, but when I try to use it to list reports, I get the "The request failed with HTTP status 401: Unauthorized." error.
What steps do I need to take to get the authentication to work correctly? I have kerberos configured for the server, although I don't think that would matter here.
pjp
View 7 Replies
View Related
Apr 20, 2007
Hi all,
I am trying to build a reportviewer so that I could use reporting services (due to company's security policy).
I am getting a VERY weird error here.
Before I get on ahead, here is the scenario.
I had created a rdl that will give a certain report based on two parameters. At the moment, I didn't assign the parameters to any default values since i don't want the report to start running. These two parameters are run based on stored procedures to get the starting date and an ending date.
I had tried to view this report on Report Manager and it works.
I had set the parameters this way. NOTE: ReportingServer is the disgused name of the reportserver I am using for privacy purposes
Code Snippet
Dim rs As New ReportingServer.ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
'Render arguments
Dim results() As Byte
Dim format As String = "HTML4.0"
Dim historyID As String = Nothing
'PDF Rendering extensions don't have any useful DeviceInfo settings
'the toolbar shown below only affects HTML rendering
Dim devInfo As String = "<DeviceInfo><HTMLFragment>True</HTMLFragment><JavaScript>True</JavaScript><Toolbar>True</Toolbar><Parameters>True</Parameters></DeviceInfo>"
Dim credentials() As ReportingServer.DataSourceCredentials = New ReportingServer.DataSourceCredentials() {}
Dim showHideToggle As String = ""
Dim encoding As String = ""
Dim mimeType As String = ""
Dim warnings() As ReportingServer.Warning = New ReportingServer.Warning(0) {}
Dim reportHistoryParameters() As ReportingServer.ParameterValue = New ReportingServer.ParameterValue() {}
Dim streamIDs() As String = Nothing
Dim sh As ReportingServer.SessionHeader = New ReportingServer.SessionHeader
rs.SessionHeaderValue = sh
But when I started building this reportviewer.aspx, it gives me this error on the following line:-
Code Snippet
results = rs.Render(ReportPath, format, historyID, devInfo, Parameters, credentials, _
showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
with the error
{"This report requires a default or user-defined value for the report parameter 'start_date'. To run or subscribe to this report, you must provide a parameter value. --> This report requires a default or user-defined value for the report parameter 'start_date'. To run or subscribe to this report, you must provide a parameter value. --> This report requires a default or user-defined value for the report parameter 'start_date'. To run or subscribe to this report, you must provide a parameter value."}
this is occuring on the line where it needs to render the report.
As simple as it is, i tried the following:-
NOTE: some variables has been changed to protect some identity.
Code Snippet
Dim ReportRenderer As New RenderSQLReports
Dim Parameters As int.rrd.sqlreporting_test.ParameterValue() = Nothing
ReportRenderer.RenderReport(Parameters, "/Folder/reportname", "pdffilename.pdf")
What I don't get is that i made sure that it doesn't have any default values.
So I went into this scenario and tried teh following:-
Code Snippet
Dim ReportRenderer As New RenderSQLReports
Dim Parameters() As Reportingservices.ParameterValue = New Reportingservices.ParameterValue(1) {}
Parameters(0) = New Reportingservices.ParameterValue
Parameters(0).Label = "start_date"
Parameters(0).Name = "start_date"
Parameters(0).Value = "10/1/1999 12:00:00 AM"
Parameters(1) = New Reportingservices.ParameterValue
Parameters(1).Label = "end_date"
Parameters(1).Name = "end_date"
Parameters(1).Value = "11/1/1999 12:00:00 AM"
ReportRenderer.RenderReport(Parameters, "/Folder/reportname", "pdffilename.pdf")
And this is what happens. It blows up on this line again. with this error.
Code Snippet
results = rs.Render(ReportPath, format, historyID, devInfo, Parameters, credentials, _
showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
With the errors
{"Default value or value provided for the report parameter 'start_date' is not a valid value. --> Default value or value provided for the report parameter 'start_date' is not a valid value. --> Default value or value provided for the report parameter 'start_date' is not a valid value."}
This is probably occuring because the date I had provided is not found in the list of dates. I really don't want to default a date at the moment, to allow the user to select a date.
So I finally gave it a date...... a valid date.
Code Snippet
Dim ReportRenderer As New RenderSQLReports
Dim Parameters() As Reportingservices.ParameterValue = New Reportingservices.ParameterValue(1) {}
Parameters(0) = New Reportingservices.ParameterValue
Parameters(0).Label = "start_date"
Parameters(0).Name = "start_date"
Parameters(0).Value = "10/1/2004 12:00:00 AM"
Parameters(1) = New Reportingservices.ParameterValue
Parameters(1).Label = "end_date"
Parameters(1).Name = "end_date"
Parameters(1).Value = "11/1/2004 12:00:00 AM"
ReportRenderer.RenderReport(Parameters, "/Folder/reportname", "pdffilename.pdf")
LO and behold, it works BUT . now i get this error in the aspx code.
Runtime error has occured.
Microsoft JScript runtime error: 'Report' is undefined
on this weird line:- (that was generated automatically)
</script><script language="javascript" type="text/javascript" src="?rs:Command=Get&rc:GetImage=8.00.1038.00Report.js">
</script><script language="javascript" type="text/javascript">
<!--
function OnLoadReport()
{
var pageHits = null;
var rep = new Report(1, 16, pageHits, false, docMapIds); <-where error is occuring.
if (parent != self) parent.OnLoadReport(rep);
}
//-->
</script>
It did show the report, but I don't understand why it is still getting an error here. Moreover, I didn't even get the HTMLViewer too even when I had assigned the devinfo....
Really need some help here, as this is quite urgent.... I am at a loss at this, and maybe that there is an option that I am not seeing or something I am missing. please help .
Bernard-So close yet so far, How cruel are the software bugs-
View 4 Replies
View Related
Apr 15, 2008
Hi,
In a stored procedure is there a way of accessing a table presend in another database.
Please provide pointers on how i can do this.
Thanks,
Raj
View 4 Replies
View Related
May 25, 2007
Hello,
I just switched to a host that allows database connections so that I can now upload my database to their server.
When I test my site on my personal PC it works great. I upload everything to the server and nothing. I know that I need to load the database to the server. I have Microsoft SQL Server 2005 Express and can make the connection but how do i load my database from my personal PC to the host computer?
I would be greatful if someone was able to walk me thou the steps on how to transfer the database. I am really very new with the database thing and ASP.
Thank You
Chris
View 1 Replies
View Related
Jan 22, 2007
Hello Everyone,
Is it possible to write a query that can access data in differnt database so I have "trainee" and "training" databases. In want to access one training table in trainee database through a query. How can I do this.
Thanks.
View 1 Replies
View Related
Feb 8, 2007
Hi,
I would like to know if there is any way of Accessing database users from frontend and changing their persmissions.
Thanks
Niranjana.
View 10 Replies
View Related
Aug 30, 2007
Hay there,I have an asp.net project website with an sql Database. I need to access this same database from another project (a class library that needs to access this database). In fact i want to be able to use the tableadapters that I have implemented for my database in this new class library.. I guess it has to do something with making my database not part of the website but and independemt entitiy that can be seen by others..... I cannot seem to find a way to do that can anyone help meee ????Thanks for your time!
View 6 Replies
View Related
Oct 24, 2007
Hello friends when I am working in VWD and accessing sql data this error came?I am using asp.net visual web developer edition and sql server 2005 expressedition. plz check it out and help me.The log scan number (588:85:1) passed to log scan in database
'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error may indicate data
corruption or that the log file (.ldf) does not match the data file (.mdf). If
this error occurred during replication, re-create the publication. Otherwise,
restore from backup if the problem results in a failure during startup.
Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'. CREATE DATABASE
is aborted.An attempt to attach an auto-named database for file
D:GCAPApp_DataGRIET_IT.mdf failed. A database with the same name exists, or
specified file cannot be opened, or it is located on UNC share.
Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: The log scan number (588:85:1) passed to
log scan in database 'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error
may indicate data corruption or that the log file (.ldf) does not match the data
file (.mdf). If this error occurred during replication, re-create the
publication. Otherwise, restore from backup if the problem results in a failure
during startup. Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'.
CREATE DATABASE is aborted.An attempt to attach an auto-named database for
file D:GCAPApp_DataGRIET_IT.mdf failed. A database with the same name exists,
or specified file cannot be opened, or it is located on UNC
share.Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): The log scan number (588:85:1) passed to log scan in database 'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'. CREATE DATABASE is aborted.An attempt to attach an auto-named database for file D:GCAPApp_DataGRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89 System.Data.SqlClient.SqlConnection.Open() +159 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +82 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1653 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82 System.Web.UI.WebControls.ListControl.PerformSelect() +18 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.Control.PreRenderRecursiveInternal() +88 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684
Version Information: Microsoft .NET Framework Version:2.0.50727.832;
ASP.NET Version:2.0.50727.832
View 1 Replies
View Related
Oct 14, 2004
Hi There !!
CAn you please help me to solve my probelm and i will appreciate it if you help me. I installed SQL server on my machine and i installed tables in a database called "otters" when i run the application, i got an error message on the browser as shown below although in the application it says that it recognise the source of the dastabase. CAn you please help me to sort out tis problem and please try to look back to this thread after givingf me the soultion as it might not work and i need more assistant. I really, appreciate your help and thank you in advance. Please read the error message below
**************************************************
Server Error in '/Otters' Application.
--------------------------------------------------------------------------------
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 403: Dim conn As New SqlConnection(connStr)
Line 404: cmd.Connection = conn
Line 405: conn.Open()
Line 406:
Line 407: ' Allocate an empty array list to hold the performance objects found
Source File: C:CSE506TheaterPerformance.vb Line: 405
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Theater.Performance.Find(SqlCommand cmd) in C:CSE506TheaterPerformance.vb:405
Theater.Performance.FindByDateRange(DateTime st, DateTime et) in C:CSE506TheaterPerformance.vb:369
Otters.admin.Page_Load(Object sender, EventArgs e) in C:InetpubwwwrootOtterssecureadmin.aspx.vb:67
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
--------------------------------------------------------------------------------
View 7 Replies
View Related
Oct 15, 2004
I'm developing a VB app to manipulate data in a table. I've created an SQL server (local) and have successfully connected to and manipulated data in a database that I created. I would like to be able to run the app on another machine and connect to the same server. I'm having trouble determining what the server name is. Tried a few things but get the "server does not exist" message. Server is set to authenticate SQL server and windows.
Is this happening because my server is (local)? If so how do I change it to permit remote access?
Any assistance would be appreciated.
View 2 Replies
View Related
Jul 20, 2005
hey!Im looking for a db tutoral which covers accessing a Microsoft SQL databaseon windows. I will be using VC++ if it matters. NO details just a basicintroduction!Oracle DB access using C++ is also of interest!Thanks!-- Majk
View 1 Replies
View Related
Jan 23, 2008
I have a MSSQL database from a pre-existing app. The data files do not have an MDF exension, they have a .dat extension. I can however use Microsoft SQL Server Management Studio Express to run queries against the files, but I can not get VB 2005 to connect. When I attemp to add it as a project data source, I get the following error:
"An attempt to attach an auto-named database for file c:dataMSSQL$DATA_SQL....dat* failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
*Database names = company names are omitted to 'protect the innocent'.
Does anyone have any ideas? Since Microsoft SQL Server Management Studio Express worked so cleanly with the database I was expecting to easily get to the same data using VB.
View 5 Replies
View Related
Feb 29, 2008
Hi,
I have an sql express server which contains a single database. Three users access this database using a C# application I have writen. I use Integrated Security for these three users.
The problem is that one of my users wishes to use my application from home.
What are my options in letting this user use my application from home?
Thanks for your help,
Barry.
View 1 Replies
View Related
Sep 5, 2006
Hi,
I'm a hobby C# programmer, and when at university there are a few machines that have SQL Server 2005 installed on them (i think it's standard ed).
From looking around at sql 2005 free edition and DNN (dot net nuke) it's apparently possible to have the database file in the execution directory of your application.
My question is this, if i have a C# win app, is in possible for me to store the database files, in the executable directory of that app, and not in the default sql database store of C:prog filessql server90 data etc...?
Ie, what i want to do, is for the C# win application on start up to "mount" the database, use it normally like any other sql database, and then "unmount" it at the end.
The reason for "mounting" and "unmounting" is that i don't want the database to be accessible or even visible to sql server when the c# app isnt running.
I hope I've explained myself clearly, and thanks a lot in advance.
pro-logic
View 3 Replies
View Related
Aug 10, 2006
Let's assume we have 2 databases db1 & db2
and we have a table named "MyTable" which is located in db2 database
in the db1 database I create a stored procedure by using following code:
<<
use db1
create procedure myproc
as begin
select * from db2.dbo.MyTable
end;
>>
this code does not execute successfuly and I face an error which says << invalid object db2.dbo.MyTable>>
and as you know we are not allowed to use USE database key word in stored procedures
I can's access a table which is located in another database, whithin a stored procedure which is located in different data base but on the same server
thanks
View 3 Replies
View Related
Nov 3, 2006
After I uploaded my web page and my sql database to my server I get the following error: Exception Details: System.Data.SqlClient.SqlException:
Could not open new database
'dsyfa.dnh.sk_0254bfa0-5525-4634-bee7-1b99fd021b34'. CREATE
DATABASE is aborted.Could not attach file
'I:DataWebdnh.skdsyfa_78676f0b-4b12-4502-8792-5141335ef179wwwApp_DataGamesDB.mdf'
as database 'dsyfa_0254bfa0-5525-4634-bee7-1b99fd021b34'.File
activation failure. The physical file name "F:My StuffSoftware
DevelopmentC#ATLASProjectsGameSiteApp_DataGamesDB_log.LDF" may be
incorrect.The log cannot be rebuilt when the primary file is read-only.Why is it referring to F:My StuffSoftware
DevelopmentC#ATLASProjectsGameSiteApp_DataGamesDB_log.LDF?? This location exists in my PC. How do I change it? I uploaded my mdf file using FileZilla FTP client. Where am I going wrong?? I'm using the connection string given me to me by the hosting service. Here's the code:<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|GamesDB.mdf;Integrated Security=True;User Instance=True" SelectCommand="SELECT [GameId], [GameTitle], [Rating], [Genre], [Location] FROM [Games]"></asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="GameId" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="GameId" HeaderText="GameId" InsertVisible="False" ReadOnly="True" SortExpression="GameId" /> <asp:BoundField DataField="GameTitle" HeaderText="GameTitle" SortExpression="GameTitle" /> <asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="Rating" /> <asp:BoundField DataField="Genre" HeaderText="Genre" SortExpression="Genre" /> <asp:BoundField DataField="Location" HeaderText="Location" SortExpression="Location" /> </Columns> </asp:GridView> Any help would be appreciated.
View 3 Replies
View Related
Apr 25, 2007
I have not been able to find a code example anywhere. Someone please post the code to do this. I would be forever grateful.
I would like the code to be in C#. I want to connect to a database and then select all from a table.
thanks
View 12 Replies
View Related
Aug 10, 2007
I'm writing an web app in VS2005.
I've created a product.mdf database through VS2005's Server Explorer (to my knowledge, I'm not using Sql Express). (Side question. The .mdf files are a stand alone xml structure used as a database, correct?).
When I execute locally, everything works great. But when I moved my code to where it is being hosted (remote computer). It's throwing the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
This is my connection string:<add name="MyConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Product.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
What is my problem?
View 3 Replies
View Related
Dec 31, 2007
I was wondering if you guys know of a good site that talks about programmatically accessing and displaying data from a sql server 05 database in ASP.NET 2.0.I want to have a data adapter in a dataset, but I would like to create my own class file and pull the data from the adapter through code into the class. Is this the best way? Im wondering about the best practices while learning this new technology. Any articles provided would be appreciated. Thanks!
View 2 Replies
View Related
Mar 19, 2008
I have written 5 content-management systems and am getting a little bored writing a lot of the same functionality and tweaking it for different datamodels. Is there a way within .NET to have visibility of a database's structure (ie, data type, column names, foreign keys etc)? I'd like to write up a dynamically generated form for any given table, displaying appropriate form controls based on data type and foreign keys.
View 7 Replies
View Related
Apr 24, 2008
I've downloaded a copy of Microsoft SQL Server Management Studio Express from MS. Can this product be used to query an SQL database at a web site.
Conversely, is there a command line utility for running SELECT statement queries on my remote web site database?
View 1 Replies
View Related
Jun 27, 2002
Hi. I have a database online. I have to run some scripts, and check out my database. The ISP i have, has currently changed the IP address for the database, now I can not hook up with it via Enterprise Manager. Can someone help me. I am using Microsoft ME as the platform.
View 1 Replies
View Related
Aug 5, 2004
Hi,
I need a way to automatically generate a daily report of user names, time of access, and type of access (login, select, insert, update, delete, etc.) to a database.
We need to audit all accesses from all accounts to find out who is accessing the payroll system. We have already defined the security to be as tight as possible - however we need to monitor all Administrator accounts to ensure they are not being used to obtain sensitive information.
I have looked for some software to read the live SQL Transaction Logs, but none of the tools I have seen can do exactly what we require. For example, I've tried Lumigent Log Explorer (http://www.lumigent.com/products/le_sql.html), but it's not automated and the report output is just garble to our payroll staff.
I have looked up all Microsoft SQL Server partners but their software is all about data recovery and data reporting. We need Security Reporting.
I have created a general SQL Profiler trace that may suffice if everything else fails, but I still have no way of automating it - it relies on Real-Time monitoring which I can't trust (admin can turn this off, do their stuff, turn it back on). Also this is dependant on someone turning it off, save the log, turn it back on, every day - this person would be the Administrator - what admin would monitor themselves?
- SQL Trace seems like a good idea, how do I read the trace log file? How do I automate a trace?
- Can we automate the SQL Profiler to read the transaction log to find all accesses to a database?
- Does anyone know what we can do to automatically audit accesses to a database? What format can the report come in (pdf, xls, dbf, html etc.)
- Recommended software to try?
- Ideas for alternatives to try?
- Any companies/developers out there who know of a tool or are developing a tool to provide this sort of report?
- Is there a spec somewhere to let us write our own software to query the live transaction log?
Thanks, I appreciate any help.
Kind Regards
James Payne
IT Administrator
View 7 Replies
View Related
Jul 25, 2007
hi guys. can you please provide tutorial/link how to access two database in one view. i was thinking about LINK TABLE like what i do in ms access but i find solution in sql server.
thnx.
View 3 Replies
View Related
Aug 10, 2006
hi
i have stored procedure and i need to access another database in my stored procedure
I'm going to query a table which is located in another database
as you know it is impossible to use the USE database keyword in stored procedures
so what should I do?
thanks.
View 2 Replies
View Related