I am using the web blog at http://weblogs.asp.net/scottgu/archive/2007/01/11/tip-trick-how-to-upload-a-sql-file-to-a-hoster-and-execute-it-to-deploy-a-sql-database.aspx
to deploy an SQL script on my database. The sql script is named aspnetdb.sql and is placed in my main directory.
Now using the file RunSQL.aspx which is also placed in the main directory (www.genealogy-prototype.com/RunSQL.aspx) I have changed the parts in the file which need changing:
// Url of the T-SQL file you want to run
string fileUrl = "http://genealogy-prototype.com/aspnetdb.SQL";
// Connection string to the server you want to execute against
string connectionString = @"Server=genealogy-prototype.com;User ID=marko;Password=</span>
<span lang=EN>123;Initial Catalog=aspnetdb";
but when I go to my page genealogy-prototype.com/RunSQL.aspx I am getting an error. However I'm not sure what this error is as it says I need to change custom errors to off in web.config, i have done this but it still says i have it on...
I'm guessing it must be something to do with the connection string i have given or the file url. My hosting company is freezone.co.uk, my database name is aspnetdb my username for this database it marko and there is no password. Is the connection string i have given wrong?
I have been trying this for over a week, any help would be great!!
Thank you, Mark
Hello, I am using the web blog at http://weblogs.asp.net/scottgu/archive/2007/01/11/tip-trick-how-to-upload-a-sql-file-to-a-hoster-and-execute-it-to-deploy-a-sql-database.aspx to deploy an SQL script on my database. The sql script is named aspnetdb.sql and is placed in my main directory. Now using the file RunSQL.aspx which is also placed in the main directory (www.genealogy-prototype.com/RunSQL.aspx) I have changed the parts in the file which need changing:// Url of the T-SQL file you want to run string fileUrl = "http://genealogy-prototype.com/aspnetdb.SQL";
// Connection string to the server you want to execute against string connectionString = @"Server=genealogy-prototype.com;User ID=marko;Password= 123;Initial Catalog=aspnetdb";but when I go to my page genealogy-prototype.com/RunSQL.aspx I am getting an error. However I'm not sure what this error is as it says I need to change custom errors to off in web.config, i have done this but it still says i have it on... I'm guessing it must be something to do with the connection string i have given or the file url. My hosting company is freezone.co.uk, my ms sql database name is aspnetdb my username for this database it marko and there is no password. Is the connection string i have given wrong? I have been trying this for over a week, any help would be great!!Thank you, Mark
Dear i am using visual studio.net.......... when i connect database (in sqlserver) using sqldataAdapter with datagrid in visual basic.net every thing work properly........... but when i use the same in asp.net then i get an error message on the resultant explorer page give below.
Server Error in '/studentData' Application. --------------------------------------------------------------------------------
Login failed for user 'RAMIZSARDARASPNET'. 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: Login failed for user 'RAMIZSARDARASPNET'.
Source Error:
Line 85: 'Put user code to initialize the page here Line 86: Dim ds As New DataSet() Line 87: SqlDataAdapter1.Fill(ds) Line 88: DataGrid1.DataSource = ds.Tables(0) Line 89: DataGrid1.DataBind()
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Plz solve my problem and Reply me on ramiz_ch@hotmail.com Plz solve my problem and Reply me on ramiz_ch@hotmail.com Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Hi,I have a form page with an insert like this:<asp:SqlDataSource ID="addProductDataSource" runat="server" InsertCommand="INSERT INTO test( title1, firstName1, lastName1, dateOfBirth ) VALUES ( @title1, @firstName1, @lastName1 @dateOfBirth )" ConnectionString="<%$ ConnectionStrings:yourQuoteCentreConnectionString %>"> <InsertParameters> <asp:ControlParameter ControlID="dateOfBirth" Name="dateOfBirth" Type="DateTime" /> <asp:ControlParameter ControlID="title1" Name="title1" PropertyName="Text" /> <asp:ControlParameter ControlID="firstName1" Name="firstName1" PropertyName="Text" /> <asp:ControlParameter ControlID="lastName1" Name="lastName1" PropertyName="Text" /> </InsertParameters></asp:SqlDataSource> In default.aspx.vb I have:Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick 'CREATE DATETIME FROM USERS BIRTH DATE Dim dateOfBirth As New System.DateTime(applicantYear.SelectedValue, applicantMonth.SelectedValue, applicantMonth.SelectedValue, 0, 0, 0) 'INSERT TO DATABASE addProductDataSource.Insert()End SubI would like to reference the variable dateOfBirth created in default.aspx.vb in the insert query on the page, or ideally move the insert query into the aspx.vb page. Would this make more sense to do?Thanks,Paul
I'm trying to use a Select statement on Full-Text-Indexed field in SQL Server.The .aspx page does not like the " " inside my SQL statement. How do I get around this?Select parts.ProductNumber, T1.Description FROM T1, T2 WHERE T2.Ground='1' and T1.ProductNumber=T2.System and CONTAINS(T1.Description, ' "5001*" ')It does not like the " around the 5001* how do I escape them or whatever to make it work?- Rex
Hi!Im building a site for internal use for a company i work at.And im having hard to decide what to do. The alternatives arecomma separated lists vs separate tables. For example.. I will use a number of different type of objekt that all will hold 1 or more document links, phone numbers, emails etcAs far as i can i i have 2 possibilitys. One is to add textfields for each of these subojects in each objects tables. Then i add all info as commaseparrated lists in 2-3 layers wich i then save in the respecive objects fields. (Look like something below for example ),comment'emailadress,comment'emailadress,Or i add 1 table for each subobject type wich manage the subobjects or link between different objectsfor example:table layout for email:id | parent_type | parent_id | comment | emailOr for example contacts a mediator table:id | parent_type | parent_id | contact_id Hope you understand what i mean, would really appriechiate suggestions, comments regarding what can be considered as "best practise" in these cases. Putting it in separate tables should make searches easier, and coding easier in my book. But again im thinking if perhaps commalists is a faster and more recource conservative way of doing it + to me it feels like (perhaps i have no reason to think this?) making tables for items like feels like a timebomb if you exhaust your idfields identity count. Though this app will be used by perhaps 100ppl at most so perhaps not an extremely utilized webapp.Anyway glad if you could give me some input!
I am trying to deploy an aspx application which talks to sql 2005. The application files are on a w2003 web server with asp.net 2.0 and the sql server is a 2003 server with sp1. when i attempt to browse this application i am prompted with "Unable to get records. Unable to connect to database. Login failed for user 'NT Authorityanonymous Logon'". The application is set to use windows authentication. However if i create the "anonymous" login in sql and make it a sysadmin, it works, of course. In my dev enviroment i have sql2005 and iis on same w2003 server and the same application WILL run and there is NO anonymous account, just using AD accounts.
I have a stored procedure that is used to create a DataDictionary for the database. Basically, the sproc generates HTML and you can then run it from Query Analyzer by Saving to a file.
What I want to do is to run this from an aspx page.
Hello, Can someone kindly point out what is wrong with the following code file. I'm trying to: - fill a dropdown from a db on page load (this works!) - when user selects from the list and hits a button, pass the dropdown value to a second query - use the second query to make another call to the db and fill a data grid
In the code below, if I swap an actual value (eg '1005') into the command and comment out the .Parameter.Add statements, the dategrid is filled sucessfully. Otherwise, when the button is pressed, nothing is displayed.
Thanks
PS comments about my coding approach are welcome - I'm new to aspx...
<%@ Language="VBScript" Debug="true"%> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.data.SqlClient" %> <html> <head> <script language="vb" runat="server"> Dim dbConnection As SqlConnection Dim ds_Teams,ds_Agents As DataSet Dim sqlCmd_Teams,sqlCmd_Agents As SqlDataAdapter
Dim dbConn = "server=csacd01;uid=mpierce;pwd=cabledog;database=clearviewacd"
Dim sql_select_agents = "" & _ "SELECT last_name + ', ' + first_name AS name, agent_no " & _ "FROM dbo.users " & _ "WHERE (team_no = @Team) AND (NOT (agent_no = '1029')) " & _ " AND (NOT (last_name IS NULL)) " & _ " AND (NOT (first_name IS NULL)) " & _ " AND (NOT (first_name = 'FirstName')) " & _ "ORDER BY last_name"
Dim teamList = "teamList" Dim agentList = "agentList"
Sub Page_Load(Sender As Object, E As EventArgs) if not (IsPostBack) ds_Teams = new DataSet() dbConnection = New SqlConnection(dbConn) sqlCmd_Teams = New SqlDataAdapter(sql_select_teams, dbConnection) sqlCmd_Teams.Fill(ds_Teams, teamList) dbConnection.close()
dropdownlist_Teams.DataSource=ds_Teams.Tables(teamList).DefaultView dropdownlist_Teams.DataBind() end if End Sub
sub Get_Agents(Sender As Object, E As EventArgs) ds_Agents = new DataSet() dbConnection = New SqlConnection(dbConn) sqlCmd_Agents = new SqlDataAdapter(sql_select_agents, dbConnection)
Hi! i'm dani, from spain. I´m looking for sombody to help me. The trouble is as i have indicated. I get the next error when my page aspx needs to acced to the SQL Bd: "Error of beginning of session of the user '(null)'. Reason: it is not associate to a connection of confidence SQL Server." I hope a reply. Thanks and greethings.
Hi All,I am trying to run aspx website on IIS version 6. It works locally with WEb Matrix but when I put the site into the IIS server, it cannot connect to the database. THe IIS is sonfigured and all users have full permissions but the error that is returned is:Login failed for user '(null)'. Reason: Not associated with a treusted SQL Server connection.SQL Server 2000 is installed and a connection is open to the database in question. Would be very greatfull for ANY help on this, being tryin to get this workin for days!!Collette.
Hi, i am trying to retrive some datetime set from the database (2 posts in this table), senastposted is a datetime field.when i run:SELECT senastposted FROM ftp WHERE senastposted <= 2005-10-28i get this result:
senastposted 0 record(s) affected.and when i run: SELECT senastposted FROM ftp WHERE senastposted >= 2005-10-28i get this result:
senastposted 25-10-2005 29-10-2005 2 record(s) affected.what i want is to retrive the first value based on the date:25-10-2005any idea why SELECT senastposted FROM ftp WHERE senastposted <= 2005-10-28 dosent work?( i have tried to change the dates to 28-10-2005 and 28/10-2005)
Hi can someone help me? I'm using Access database and Microsoft VS2005 (VB) I need to take data from 2 different tables in 1 database. But i can't seems to get it right! I have: - dbWarehouse.mdb- tblReadDetails and tblStock I need to use "Barcode" from tblReadDetails, compare it with "Barcode" in tblStock then retrieve all the column in tblStock and put it in a webpage.aspx list box. I tried the following code...cn.ConnectionString = strConncn.Open()cmd = New OleDbCommand("SELECT tblStock.Barcode, tblStock.Item, tblStock.Dept, tblReadDetails.Barcode FROM tblStock JOIN tblReadDetils WHERE tblReadDetails.Barcode = tblStock.Barcode", cn)dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)While dr.Read()lstBarcode.Items.Add(dr2.Item("tblStock.Barcode"))lstItem.Items.Add(dr2.Item("tblStock.Item"))lstDept.Items.Add(dr2.Item("tblStock.Dept"))End While but it prompt me the following error... OleDbException was unhandled by user codeSyntax error in FROM clause What's wrong with this code? Regards and thanks!
Hi, I have the problem in accessing data from MS-SQL server by using Dreamwearver MX 's VB.NET page. Although it works well, in the date format, it also display time. Please see the following code. SELECT student_ID, Material_ID, Borrow_Date, Due_Date, Renew_Date, Status, include_withFROM dbo.RecordWHERE student_ID = @student_ID To remove time, I added the following code as follows. After that, I can preview and works well without having time. SELECT student_ID, Material_ID, convert(varchar(10),Borrow_Date,103), convert(varchar(10),Due_Date,103), convert(varchar(10),Renew_Date,103), Status, include_withFROM dbo.RecordWHERE student_ID = @student_ID But, when I browse, I get the runtime error. When I look more details in server, the error said " Parser Error Message: The server tag is not well formed." and error in <MM:DataSet" Please help me. Jon
Hello All, I am just getting started on aspx, coming from an asp background. I created the following connectionString in my web.config file:<connectionStrings> <add name="OuWebDB" connectionString="server=OurServer;database=OurDatabase;uid=TheUser;pwd=ThePassword"providerName="System.Data.SqlClient" /> </connectionStrings>
when I run this aspx file, from a machine, I get 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Help!!
Hi all, I am excuting DTS package from code behind and the table is created in the SQL database. However, the data in my excel sheet is not transferred over and Im not sure where the problem lies. Below is my code: pkgLocation = @"C:/Program Files/test.dtsx"; app = new Application(); pkg = app.LoadPackage(pkgLocation,null); pkgResults = pkg.Execute(); Any advice is much appreciated.
hi , I would appreicate your help, I have created a store procedure in MS sql server 2000 to be called from aspx page. The store procedure will have multiple functions: checking if a file exist in c:data if file exist, it will use zip file command line to unzip the file and then run DTS package to upload the database.
The issue I am having is when I run the store procedure from MS query analyzer,I get a confirmation that the whole procedure ran successfully, but when I call the same procedure from aspx, althought the store procedure ran successfully, but I did not get any confirmation to the user in the aspx page to notify the user that the process successed.... here is my code in where I think is not working, CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest @id int , @msg_output varchar(28) output as declare @varcmd varchar(255),@FileExist int select @varcmd = null select @varcmd ='dir :Data_on_demandsales_option_price_report.csv' -- check if file exist EXEC @FileExist = master..xp_cmdshell @varcmd set @msg_output = 'The file exists' Return 44
+++ The above store procedure use command line to check if the csv file exist, its suppose will return a output parameter and a return # BUT it did not. To my surprise, when I modify the above store procedure like this, it work ----- CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest @id int , @msg_output varchar(28) output as set @msg_output = 'The file exists' Return 44
The second procedure does not do anything, except take input parameter and return a message output and return, this work.
since the second procedure works, it means that the code in aspx is correct, but I have no clue why it does not return output parameter and return # in the first procedure.
I would really appreciate anyone who could help. thanks
Being new to ASP.NET, I may be asking something that is dead simple, but please bear with me!
How would I go about listing all the tables, stored procedures and views from a SQL database within an aspx page? I understand how to connect and return a dataset etc, but that's about as far as I can get. I want to be able to list all of these objects from a given db - any ideas?
Additionally (this may not be possible) - is there a way I can list all of the objects within a visual studio.net solution, again within an aspx page?
I have searched for what I think is a simple solution. In my aspx.vb code page, I need to make a connection to SQL Server (my connection strings are in the web.config file) and then make a simple SQL Select to return one or 2 values. For example, the user will select a customer on the ASP form, then I need to read a couple of default values from that user's record and display them back onto the form. Can someone provide the sample code or direct me to this? I'm thinking that this is rather simple, but I can't seem to make it work. If I see a sample of exactly what I need to do, such as reading a value using the Northwind sample DB, then I can modify it to fit my table structure, etc. Thank you.
I am trying to use session in my asp.net in moss but i got the error below, eventhough i have set web.config file to enableSessionState="true" and include €œSystem.Web.SessionState.SessionStateModule". Have i miss anything? thanks
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \ section in the application configuration.
I am trying to use the Report Viewer Control in an ASPX page but getting the following error "For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method". This is with September CTP of SQL Server 2005. I am not trying to set any DTD, the same report works if displayed using the WinForm viewer control...so I am not sure why this is happening. is there any samples available for using the Report Web viewer control in an aspx page? Thanks Krishna
The report seems to render just fine if a parameter has just 1 value. However, when I try to pass multi values(comma seperated) to the report from aspx - the report viewer is unable to check the selected values. I have set ShowParameterPrompts to true - for multivalues the parameter selection is blank and hence unless the values are reselected the report wont render.
I tried to loop thru the multi values by dumping it in a array and adding the individual value while iterating thru the RDL's parameter collection. In that case the error message that I get is parameter xyz has been specifed multiple times.
Is it possible to call up the SubscriptionProperties.aspx page by URL for a specific report, and *specify* the parameter(s) values directly in the URL? I have a scenario where I don't want the user to have to do it.
I am using Sql server reporting services.When i have create a report .rdl file and deploy it on Report server and than display that report on my application's .aspx page in pdf format using web services , every thing is perfactly working in my senario at the starting time but now i faced a problem with that. When record goes more than 2000 (in my senario a single record disply in a one report pdf page means for 2000 record in table that means its display in 2000 pdf page as with next forward option of pdf view),So in that cas it doesn't work, did now show any report and give the error as ex.Message"Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Server Unavailable </title> </head> <body> <h1><span style="font-family:Verdana;color: #ff3300">Server Application Unavailable </span></h1> <p> <span style="font-family:Verdana;"> The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. </span></p> <p> <b>Administrator Note: </b> An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. </p> </body> </html>
--."string
Any body have any idea please help me as soon as possible. urgently--- any help will be appriciate. thanks in advance. arvind
My problem, I have the aspx, .cs and ascx files but I don t have a project or solution that came with the files (since that was done by front page). So I need to add all those files in a solution or a project so that I can maintain the site that was created by front page using Visula Studio.
Do you know how i Can put all those files in a new project or new solution.
2/Also, when we modify the the pages, how can i put them beck in the site, will I have to compile the files again, or not. thank you.
Hi How to bring Report builder in the Ui of .net aspx pages? I tryed withe the .exe but it is comming with a new process and come up with new IDE of Report builder, i donot required this, I want it should come up within the Aspx page itself.
I created a report with a parameter. The parameter was created using a dataset in the report designer. This works fine. I deployed the report (webhost4life) and the report runs fine in the report manager. I am able to select my casenumber click on the default view report button and it works.
Problem: I embedd the report into an aspx page frmReports1.aspx. I call this page from another page (form). the frmReports.aspx page comes up and displays the default drop down list box with the casenumbers (fine). I select the casenumber and click on the view report button and NOTHING. I here the postbacks taking place but all that happens is the default value appears in the drop down list box and the toolbar shows. I checked permissions and everything is fine. I searched the forum and thought i found the solution with the inLine HTML and Async (still nothing) I can only think that something is not going right with the parameter. Here is my html, and code behind code. any help would be greatly apprcieated.
Public Function GetFormsCredentials(ByRef authCookie As System.Net.Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean Implements Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials
End Function
End Class
Public Function GetFormsCredentials(ByRef authCookie As Cookie, _
ByRef userName As String, _
ByRef password As String, _
ByRef authority As String) _
As Boolean
authCookie = Nothing
userName = Nothing
password = Nothing
authority = Nothing
'Not using form credentials
Return False
End Function
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
'ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
'rvTest.ServerReport.Refresh()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
rvTest.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
Hello - we are using the custom security extension and SSL on our reporting site. Everything works great except for the logon.aspx page. It functions fine but it won't display the embedded styles or images on the page. Any clue why that would be? We get a white page with broken image links.
Our uilogin.aspx page shows styles and images. We've cut and pasted this code directly into logon.aspx but it still doesn't work. I have verified that the files are in the ReportServer folder.