Manage Reports Using Report Manager But Do Not Allow Upload File

Mar 21, 2007

Hello, I need to be able to view and save reports using Report Manager. However, I do not want some users the ability to upload files (need to prevent virus or bad files). It appears I need to select manage reports from the role definition in order for a user to save reports. but then i get the upload file link as well. Is there a way to manage reports but prevent upload file link?

View 2 Replies


ADVERTISEMENT

Report Manager Upload Html-page With &&<img&&>

Apr 14, 2008

Hi!

I have uploaded a html-page to the Report Manager, the html-page has a img-tag with a src="Picture1.png" in it. The image is then uploaded to the same folder as the html-page. When I browse the html-page the image is not found, red cross, does anyone know why this happens?

Regards,
Tommi

View 1 Replies View Related

Reports In Report Manager-drilldown

May 9, 2007

When runing a report in Report Manager I can click on an item and SQL Server provides the logic to drill down into the underlying tables. I can find no button to go back. The only way I've found to go back is to click a different tab at the top of the screen (History or something) then click View again and you get the original report. In designer there's a back button. Is there not such a button when running a saved report????



Thanks.

View 1 Replies View Related

Moving Reports In Report Manager

Mar 28, 2007

When we move reports from one folder to another in Report Manager we have to delete the report in the destination folder first before moving it over if a version is already there. If not we get the error that an item with that name already exists. Is there a way around this? Is there a setting which will allow over-write of a report?

View 1 Replies View Related

Error While Executing Reports From Report Manager

Feb 1, 2007

Hi..

I have deployed reports on to the report server. When I try to open the reports from report server, I get the error," Value does not fall within the expected range." This error message appears as soon as I click on any report on the report manager.

I am not able to find the cause of the error.

Does anybody have any suggestions?

Thanks ,

Viva

View 4 Replies View Related

Printing SSRS Reports Using Report Manager

Apr 28, 2008

Hello all,
When I print the reports ( or export to PDF) in Report Manager, my every alternate page is blank? If the report is just one page report, I get second page as blank when I print or export. The report prints in Landscape format( which should be fine given 8.5 inch height and 11 inch width).
I have played with the interactive Height and other height parameters but with no luck.
My current settings in the rdl file is:
<BottomMargin>0.5in</BottomMargin>
<RightMargin>0.5in</RightMargin>
<PageWidth>11in</PageWidth>
...
<Width>11in</Width>
<InteractiveHeight>1.5in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>0.5in</TopMargin>
<PageHeight>8.5in</PageHeight>

I would highly appreciate any suggestions.
Thanks
Phewa Taal

View 1 Replies View Related

Report Manager - Blank Reports Page

May 21, 2006

Hi,



I'm getting blank page when I open the Report Manager: I've got a header - "...Reporting... HOME", and then just empty space.



I had it working fine a week ago. Any ideas?



The RS runs on Win2003 Std, SQL 2005 Std.





Thanks

View 26 Replies View Related

Make Reports In Report Manager Stop Paginating?

Apr 4, 2008



IS there a way to do this?

I want everything on one page, no matter how long it is.

View 1 Replies View Related

Restrict Users To View Reports And Also Folders In Report Manager

May 6, 2008



Hi,

I would like to restrict users to allow to view related reports only...
like i have 2 users..with 4 reports

1 user can see only two reports
2 user can see only another two reports

how can i do this by SSRS???
Can i do by using Configure item-level role definitions in seetings link..
or is thr any another way to do this?

Pls reply back

Regards,
Maruthi..


View 4 Replies View Related

Why Did MS Give Access To Reports Thru Both Reporting Manager And Report Server?

Dec 20, 2007

what is MS's strategy for having two off the shelf ways of getting at reports? In a typical company, is the average non administrator type user getting at his reports via one, the other, both?

View 1 Replies View Related

Viewing Reports Via Report Manager Fails (while Other Methods Succeed)

May 14, 2008

I'm having a strange problem with SSRS 2005 that I'm hoping someone might be able to help with. I've reinstalled SSRS (multiple times) and even reinstalled IIS hoping to resolve the problem, but it still exists.

The problem is that trying to view a report via Report Manager is failing. All other operations within Report Manager work fine (browsing folders and report lists, viewing folder and report properties, changing properties, setting permissions, etc.) Only trying to view reports fails. Whenever I try to view a report, I get the following error:

The request failed with HTTP status 401: Access Denied.


I can view reports via other methods just fine. For example, if I browse to the http://localhost/reportserver URL directly, I can view any report just fine. And if I connect to SSRS via SSMS, I can view reports there as well. I believe that both of those methods use a direct reportserver URL versus using the http://localhost/Reports/Pages/Report.aspx page within the Report Manager virtual directory.

Here's a bit of configuration information that may or may not be helpful to someone:

1. This is on a laptop running Windows XP SP2 (32-bit). SSRS (and all SQL Server components) are installed as default instances and SQL Server SP2 has been applied to everything.

2. All of the latest updates and fixes for Windows, SQL Server, Office, etc. have been installed via Windows Update.

3. This laptop is a member of a domain, but I am typically not connected to the domain (not in the office very often). I am, however, logging into the laptop using a domain account (with cached credentials). Local user accounts are frowned on by the domain and IT administrators involved (except for running local services). My domain account has full admin permissions within Windows and within SQL everywhere.

4. As far as I can tell, everything with regards to IIS, asp.net, and SSRS are configured correctly (ASPNET account seems to be set up correctly, all SQL services including the SSRS service are running under a local account with admin permissions, the Reports and ReportServer virtual directories in IIS are set to use Integrated Security, etc.)

I'm not an expert on SSRS, so this one has me stumped. I've reviewed all of the config files that I can think of looking at for SSRS and I've looked at the SSRS logs. Nothing really jumps out at me in terms of changes that might be required (and the SSRS logs don't really say much other than repeating the error). For example, I see the following lines in the ReportServerWebApp__xxx.log file:

aspnet_wp!ui!8!5/14/2008-13:00:17:: e ERROR: The request failed with HTTP status 401: Access Denied.
aspnet_wp!ui!8!5/14/2008-13:00:17:: e ERROR: HTTP status code --> 500
-------Details--------
System.Net.WebException: The request failed with HTTP status 401: Access Denied.

Anyone have any ideas? I've searched Google for quite a while trying to find something that would help me figure this out, but thus far I've not been able to come up with anything. Any help (or pointers to something on teh web somewhere that I might have missed) would be appreciated!!

Dave Fackler

View 5 Replies View Related

Hi, I Also Have Similar Problem When Trying Launch Report Manager By Typing Http://localhost/reports

Apr 25, 2007

Hi,



I am new at using Report Service and after successful install the SQL SERVER EXPRESS ADVANCE SP2 and configured the ReportIing Services Configuration. I try to launch the report manager by typing http://localhost/Reports I get the following error:



The report server is not responding. Verify that the report server is running and can be accessed from this computer.



I've read many forums but I couldn't resolve my problem. Any help would be greatly appreciated.



By the way, I am running IIS 7 on Window Vista Business Ed. & SQL Server Express Ed. I am not sure if this make any differences.

View 5 Replies View Related

Change Default Zoom Setting For Reports Viewed On Report Manager Web Site

Sep 14, 2007

I've tried changing the default zoom setting by editing the RSReportServer.config file to include

<Configuration>

<DeviceInfo>

<Zoom>Page Width</Zoom>
</DeviceInfo>
</Configuration>
under the

<Render>

<Extension Name = "HTML4.0" etc.
However, all reports still show up with the zoom setting at 100% on the toolbar.
I stop and restart the Report Server Service and it comes up OK so I know my XML syntax is cool. What am I doing wrong?

This is on a 2005 Report Server. Reports are built in VS2005 Report Designer and deployed to the Report Server directly. Reports are accessed via IE7 browser.

View 2 Replies View Related

History Of Report Definition File For Published Reports...

Jun 26, 2007

I would like to know if there is a way to maintain the history of changes to the reports that have been published to the report server?

I know that the report definitions get saved onto ReportServer database. But let's say a user makes a change to the published report and then saves it back to the server. And that the latest change was incorrect and I have to revert back to the previous version of the published report. Is there a way to do that? Does the report server maintain a history of previous versions.

There is a history for each report and I think that corresponds to the history of report executions (output data). But I am talking about the history of actual report definition.

Thanks for you help.

View 2 Replies View Related

Reporting Services :: Unable To Run Scheduled Reports From SharePoint In Manage Shared Schedules

Jul 16, 2015

We are running into an issue where we are unable to run scheduled reports from SharePoint in the "Manage Shared Schedules" sections of any given site in our site collection (<site url>/_layouts/15/ReportServer/ScheduleList.aspx).  Reports are able to be generated manually, but never run when scheduled from SharePoint.We are encountering the following error in the SharePoint logs for our server.  

 Microsoft.ReportingServices.Library.InvalidReportServerDatabaseException: , Microsoft.ReportingServices.Library.InvalidReportServerDatabaseException:

The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is 'Unknown'. The expected version is '162'.;     Here is the background in our environment:

SharePoint App Server  - Server 2012 R2 running SharePoint 2013 Application server - running SSRS SharePoint Integrated configured through Central Admin.SharePoint SQL Server - Server 2012 R2 running SQL 2012 SP1 for the SharePoint farm - hosts the Reporting Services databases.I have run the script within the Central Admin > Provision Subscriptions and Alerts to give appropriate permissions the the account in use.  Also the reporting services databases were created new as part of the install, so they were not migrated from a previous version.

View 3 Replies View Related

Using FTP Connection Manager In SSIS To Upload Files

May 12, 2015

I am using FTP Connection manager in SSIS to upload files. Does it close session after it completes the task?

View 2 Replies View Related

SQL CONNECTION - INSERT - RETRIEVE ID - Rename File - UPLOAD FILE

Sep 15, 2007

Hi there,
I have inherited a databse and am building a new website to go wiht it.
There is a file upload page which will upload images to a directory.  I need to insert into the database retrieve the id just added then upload the image renaming it in the format locID(QueryString)_ImageID(retrieved from database).jpg
The page has a file upload control and a button.
I am trying to write my code behind so that when the button is clicked it inserts location id into the images table retrieves Image id. Renames the file and uploads it to the images folder.
II think i need to call the routine from another routine for the button click but the signatures are different, where am i going wrong? or for that matter have i been pissing into the wind for the last 4 hours?
CODE BEHIND

Imports System.Data
Imports System.Data.SqlClientPartial Class admin_Add_Images
Inherits System.Web.UI.PageProtected Sub UploadImage(ByVal Sender As Object, ByVal e As SqlDataSourceStatusEventArgs)
Dim LocationId As String = Request.QueryString(ID)

' create a new SqlConnectionDim NewConn As New SqlConnection
NewConn = New SqlConnection("server=desktopsqlexpress;uid=xxxxxx;pwd=xxxxxxx;database=MYLOCDEV") 'OleDbConnection i
' open the connection
NewConn.Open()Dim MyInsert = New SqlCommand("INSERT into image([LocationID]) VALUES (@LocationID); SET @NewId = Scope_Identity()")
NewConn.Close()
If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0 Then
'RENAME THE FILEDim newid As Integer = e.Command.Parameters("@NewId").Value
Dim fn As String = (LocationId & "_" & newid & ".jpg")Dim SaveLocation As String = Server.MapPath("oicImages") & "" & fn
Try
File1.PostedFile.SaveAs(SaveLocation)Response.Write("The file has been uploaded.")
Catch Exc As ExceptionResponse.Write("Error: " & Exc.Message)
End Try
ElseResponse.Write("Please select a file to upload.")

End If
End SubProtected Sub Submit1_Click(ByVal Sender As Object, ByVal e As System.EventArgs) Handles Submit1.Click

UploadImage()End Sub
End Class

View 2 Replies View Related

Adding File Information To SQL Database On File Upload

Apr 18, 2004

Hi there :)

I'm in the final stage of my asp.net project and one of the last things I need to do is add the following file information to my SQL server 2000 database when a file is uploaded:

First of all I have a resource table to which I need to add:
- filename
- file_path
- file_size
(the resource_id has a auto increment value)

so that should hopefully be straight forward when the file is uploaded. The next step is to reference the new resource_id in my module_resource table. My module resource table consists of:
- resource_id (foreign key)
- module_id (foreign key)

So, adding the module_id is easy enough as I can just get the value using Request.QueryString["module_id"]. The bit that I am unsure about is how to insert the new resource_id from the resource table into the module_resource table on file upload. How is this done? Using one table would solve the issue but I want one resource to be available to all modules - many to many relationship.

Any ideas?

Many thanks :)

View 1 Replies View Related

Manage Detached Mdf File

Oct 13, 2006

I want to manage my sql express .mdf database file (e.g. set Roles) but I seem to only be working with a temporary instance of my database when I attach to .sqlexpress and manage in SQL Server Management Studio Express (SSMSE). The Role I set is gone when I detach and re-attach.

If I try to manage my file in Visual Studio under Server Explorer, I do not see the "Roles" folder to modify roles.

Any help is appreciated.

View 3 Replies View Related

Looking For Suggestion Of How To Manage A DB File When It Getting Too Big.

Aug 18, 2006

Hi all,

At our facility, we have a > 350 gigs database and the DB is breaking into 2 files. One file is our Image table with the size of 300 gigs. The other file contains all of the other tables. The image file is getting bigger and bigger everyday, I am worry that eventually when a data file getting too big it could lead into problem. - DB fragmentatio, hard to manage etc

My question is anyone has run into this problem, and how do you solve it?

I am open for any suggestion.

BTW: I am using SQL 2000.

Thanks in advance.

View 9 Replies View Related

How To Manage Errors With One File

Nov 15, 2006

Hi,

I am pretty new in SSIS 2005, and I have some problems... I want to add logging and error management in my package. I found how to made logging. But for errors managing i have some difficulties.

In my package I have only a flat file source and an ole db destination. I want add errors management for both of them. So I create a connection manager for errors on a file. For both element i add redirect row for all available error type and then i add 2 flat file destination. I branch red arrows of flat file source and ole db destination to the flat file destination.

When i run packge i have an error which indicate me that file error is already take by another process... I don't understand why. And i don't want to create on file for each element on package. Have you any idea on why i have this error? Or how can i made what i want do?

Krest

View 2 Replies View Related

A User Group Account Acting Like A Content Manager And Admin On The Report Manager????

Nov 2, 2007



A user was created with a limited privilege under the USERS group. Once this user loged in the Report Manager he is acting like an Admin and Content Manager, though he is not given even a browser role.

What do u think that this guy is acting like a Super User evenif he is restricted to a browser role on the Report Manager ????????????

I did all my best, but no luck so far

View 5 Replies View Related

Using Management Studio To Manage .sdf File On Device

Nov 29, 2006

Hi,

I am trying to connect to a database on a Windows Mobile device using the Management Studio. I am able to select server type "SQl Server Mobile" and navigate to the file on the device. When I try to connect I recieve the following error. Should this work? If so what must I do to allow the registry access?

Thanks,

Ron


Requested registry access is not allowed. (SQL Server Mobile Edition ADO.NET Data Provider)

------------------------------
Program Location:

at Microsoft.SqlServerCe.Client.TdsParser.ThrowExceptionAndWarning()
at Microsoft.SqlServerCe.Client.TdsParser.Connect(String host, SqlCeInternalConnection connHandler, Int32 timeout)
at Microsoft.SqlServerCe.Client.SqlCeEngine.FileExists(String filename)
at Microsoft.SqlServerCe.ManagementUI.Utilities.GetUniqueFilename(String path)
at Microsoft.SqlServerCe.ManagementUI.BrowseForFiles.OnBtnNewDatabaseClick(Object sender, EventArgs e)

View 3 Replies View Related

Manage A Data Source For A Report Found In A SharePoint Document Library

Jan 18, 2007

I was working for 2 days on integrating reporting services with MOSS 2007.



The problem i faces was to create a data source for the
uploaded report (Not created using a wizard ) that will connect
me to the SQL server.



As i clicked on the arrow near the uploaded report to manage the data source, i found no

data source for this item.



I would be pleased to know the howto create this data source and where.



Best Regards,



Lana

View 4 Replies View Related

Slow Initial Upload Of Report From .net

Jan 14, 2008

Hi,
In a .net application there is a link that brings up a SSRS report.
I have noticed that if it is the first time this report is requested i.e. Application has just been opened and the report button is clicked, then it takes a while to get this report to appear on the screen. But if this report is requested again (i.e. for the second time or more) then it only takes a few moments for the report to appear on the screen.
So it seems that only the first time the report is requested it takes a longer time to get this report. Is there a way to reduce this initial load of the report?
Thanks

View 3 Replies View Related

Can Not Upload Report Models (smdl)

May 29, 2007

I am having a problem deploying or manually uploading smdl files to reporting services. I can upload anyother type of file without a problem. (dsv, ds, etc.) However, when i try to upload a smdl file, I get



"The permissions granted to user '<me>' are insufficient for performing this operation. (rsAccessDenied)"



How do I fix this?








Thank you"

View 2 Replies View Related

File Upload Help

Dec 11, 2007

Hi, I am trying to upload a file to database.
I have used the following code, every loads good to the database apart from the image, does it go anywhere?
I have created a column in the table called 'FileUploadAdvert' and made it an image?
Any ideas where I'm going wrong?
ThanksGordon 
Protected Sub btnAdvertSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdvertSubmit.ClickDim dashDataSource As New SqlDataSource()dashDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("DashConnectionString1").ToString()
dashDataSource.InsertCommandType = SqlDataSourceCommandType.Text
dashDataSource.InsertCommand = "INSERT INTO tblAdvert (AdvertOwner, AdvertName, TopLeftH, TopLeftV, Height, Width, ToolTip, WebLink, AcceptTerms, DateTimeStamp, IPAddress) VALUES (@AdvertOwner, @AdvertName, @TopLeftH, @TopLeftV, @Height, @Width, @ToolTip, @WebLink, @AcceptTerms, @DateTimeStamp, @IPAddress)"dashDataSource.InsertParameters.Add("AdvertOwner", txtName.Text)
dashDataSource.InsertParameters.Add("AdvertName", txtCompName.Text)dashDataSource.InsertParameters.Add("TopLeftH", DropDownAccross.Text)
dashDataSource.InsertParameters.Add("TopLeftV", DropDownDown.Text)dashDataSource.InsertParameters.Add("Height", DropDownHeight.Text)
dashDataSource.InsertParameters.Add("Width", DropDownWidth.Text)dashDataSource.InsertParameters.Add("ToolTip", txtOver.Text)
dashDataSource.InsertParameters.Add("Weblink", txtURL.Text)dashDataSource.InsertParameters.Add("AcceptTerms", CheckBoxAgree.Checked)
dashDataSource.InsertParameters.Add("IPAddress", Request.UserHostAddress.ToString)dashDataSource.InsertParameters.Add("DateTimeStamp", DateTime.Now)
If Not FileUploadAdvert.PostedFile Is Nothing ThenDim filepath As String = FileUploadAdvert.PostedFile.FileName
Dim pat As String = "\(?:.+)\(.+).(.+)"Dim r As Regex = New Regex(pat)
'runDim m As Match = r.Match(filepath)
Dim file_ext As String = m.Groups(2).Captures(0).ToString()Dim filename As String = m.Groups(1).Captures(0).ToString()
Dim file As String = filename & "." & file_ext
'save the file to the server FileUploadAdvert.PostedFile.SaveAs(Server.MapPath(".") & file)
lblStatus.Text = "File Saved to: " & Server.MapPath(".") & fileEnd If
 Dim rowsAffected As Integer = 0
Try
rowsAffected = dashDataSource.Insert()Catch ex As Exception
Server.Transfer("Register_Fail.aspx")
Finally
dashDataSource = Nothing
End Try
If rowsAffected <> 1 ThenServer.Transfer("Register_Fail.aspx")
ElseServer.Transfer("Register_Complete.aspx")
End If
End Sub

View 4 Replies View Related

File Upload To SQL In 2.0 VB

May 2, 2006

Can anyone give me an example of how to Upload a file to SQL in asp.net 2.0 using VB?
 
Thanks
Randy

View 2 Replies View Related

Upload File

May 5, 2008

Hello

I am using Microsoft SQL Server Management Studio Express and want to insert a row into a table. The table (Pictures) has the following columns: ID (int), Filename (varchar), Data (varbinary).

INSERT INTO Pictures(ID, Filename, Data) VALUES
(12, 'photo.jpg', C:photo.jpg);


The statement above does not work. How do you do it?

Thank you

View 1 Replies View Related

Store A File Upload Into DB

Sep 10, 2007

Can someone please direct me to a discussion on which version of SQL Server allows a file to be stored in a db field and how this is accomplished as well as how the file is then retrieved with asp.net VB from the DBthanksMilton

View 16 Replies View Related

Upload File Only Works For Dbo

Nov 6, 2007

Hi there,
My problem is that the upload works in testing for our asp.net site only for dbo. Being mindful of security, I would prefer not use this account to execute all sp_/sql. One solution could be using impersonation only in the content management system where the uploading is done, this is code in web.config:
  <location path="Manage.aspx">    <system.web>    <identity impersonate="true" userName="dbo" password="****" />      <authorization>        <deny users="?" />      </authorization>    </system.web>  </location>
To do this I would have to change the dbo password as set up by previous employee, not a real dba so not sure of the implications (enough permissions to be dangerous though;). Is the above impersonation ok, or should I redo logins security in sql? Thanks.

View 1 Replies View Related

Upload .xls File To SQL Server

Aug 9, 2005

Here's what I have to do:1. Allow user to locate a .xls file on their machine2. Upload this .xls data into an existing table on a remote SQL ServerI can pull the file from my local machine to another directory on the local machien, but can't figure out have to configure the saveas() to save on the remote db server.It seems you have to save the the db server first on the hard drive, then you can insert the .xls file data into the table.Here's my code so far that works to save on the local machine to another directory on that local machine:Dim getmyFile As HttpPostedFile = myfile.PostedFileIf IsNothing(getmyFile) ThenLabel2.Text = "Please select a file to upload"ElseIf getmyFile.ContentLength = 0 ThenLabel2.Text = "Cannot upload zero length File"ElseDim ServerFileName As String = Path.GetFileName(myfile.PostedFile.FileName)getmyFile.SaveAs("C:TestSaving" & ServerFileName)Label2.Text = "Successful upload to C:TestSaving" & ServerFileNamesCon1.Open()Dim strSQL As StringDim err As IntegerstrSQL = "Insert into ActivityTest Select * FROM OPENROWSET"strSQL &= "('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D: esting.xls;"strSQL &= "HDR = YES ','SELECT * FROM [Sheet1$]')"Label3.Text = strSQL.ToString()Dim cmd As New SqlCommand(strSQL, sCon1)Trycmd.ExecuteNonQuery()err = "Select @@Error"If err <> 0 ThenLabel4.Text = err.ToString()ElseLabel4.Text = "No Error...line 91!"End IfCatch ex As ExceptionLabel2.Text = "Line 82 Error Updating Table: "Label2.Text &= ex.MessageFinallysCon1.Close()End TryEnd IfThanks for the help in advance!!!!

View 1 Replies View Related

Cannot Upload File To Database

Mar 16, 2006

  Can anyone correct my code?I will like to add a url to my database and upload my image to web server.txtAddTitle will become my title nametxtFileName allow user to type in image name that will upload to webserver and at the meantime will insert into database as url referencesvalue for @chapterid will get from drop down list(ddlLesson) and the index value will store in database.
now i am able to upload my images with the file name that i have given to web server, but I am unable to insert data to my database.
 Sub DoUpload(ByVal Sender As Object, ByVal e As System.EventArgs)        Dim sPath As String        Dim sFile As String        Dim sFullPath As String        Dim sSplit() As String        Dim sPathFriendly As String
              'Upload to same path as script. Internet Anonymous User must have write permissions        sPath = Server.MapPath("../Tutorial")        'sPath = Server.MapPath(".")        If Right(sPath, 1) <> "" Then            sPathFriendly = sPath 'Friendly path name for display            sPath = sPath & ""        Else            sPathFriendly = Left(sPath, Len(sPath) - 1)        End If
        'Save as same file name being posted        'The code below resolves the file name        '(removes path info)        sFile = txtFileName.Text        'sFile = txtUpload.PostedFile.FileName        sSplit = Split(sFile, "")        sFile = sSplit(UBound(sSplit))
        sFullPath = sPath & sFile        Try            txtUpload.PostedFile.SaveAs(sFullPath)            lblResults.Text = "<br>Upload of File " & sFile & " to " & sPathFriendly & " succeeded"
        Catch Ex As Exception
            lblResults.Text = "<br>Upload of File " & sFile & " to " & sPathFriendly & " failed for the following reason: " & Ex.Message        Finally            lblResults.Font.Bold = True            lblResults.Visible = True        End Try
        Dim mycommand As SqlCommand        Dim myConnection As SqlConnection        Message.InnerHtml = ""        'to all the valur to database        If IsValid Then
            myConnection = New SqlConnection("Server=localhost;UID=sa;pwd=;database=u")            mycommand = New SqlCommand("INSERT INTO t_linkTitle(link_chapterid,link_name,link_url) VALUES (@chapterid,@titleName,@titleUrl)", myConnection)
            mycommand.Parameters.Add("@chapterid", SqlDbType.VarChar, 50).Value = ddlLesson.SelectedItem.Value            mycommand.Parameters.Add("@titleName", SqlDbType.VarChar, 50).Value = txtAddTitle.Text            mycommand.Parameters.Add("@titleUrl", SqlDbType.VarChar, 100).Value = txtFileName.Text
            mycommand.Connection.Open()            msgErrorTitle.Style("color") = "OrangeRed"            Try                mycommand.ExecuteNonQuery()                msgErrorTitle.InnerHtml = "New title <b>" + txtAddTitle.Text + "</b> Added to " + "<b>" + ddlLesson.SelectedItem.Text + "</b><br>" + mycommand.ToString()            Catch Exp As SqlException
                If Exp.Number = 2627 Then                    msgErrorTitle.InnerHtml = "ERROR: Title already exists. Please use another title"                Else                    msgErrorTitle.InnerHtml = "ERROR: Could not add record, please ensure the fields are correctly filled out"                End If
            End Try
            mycommand.Connection.Close()        End If
        LoadTitle()
    End Sub

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved