.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Accessing image file in local machine from server

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
 Hi i have a  .JPG file in my local machine which has  to be sent as body of SMTP mail. Path of image D://foldername//imagename.jpg The code I run is in the server m\c. I want it to access my local machine's d:\ folder to get the image file. But it is accessing the server m\c's d:\ folder. How can this be done? Thanks Amuda.RG  

View Complete Post

More Related Resource Links

Saving Image File in a Folder on Sever from Client Machine using Sql Server

  Hi EveryOne... Can anyone help me Saving an Image file in a Server folder from a client machine using Sql server 2005....   

Accessing file on remote server


       I need help to achieve the following.
       I have integrated the Single Sign On to my webapplication. Service Provider(SP) is developing in .net platform and windows server.Identity Provider (IdP) is configured in apache and linux server.
       For authentication I am redirecting the user to IdP and authenticate at IdP and return back to my .net website. So I have user's database in IdP as a db file user.db (see the apache configuration below) for authenticating user.
          <Location /idp/Authn/RemoteUser>
               AuthType Basic

run dtexec on server from batch file on client machine

Hi I would like to enable a user to execute an SSIS (2005) package located on a server.  The client does not have any elements of SQL server installed on his machine so he cannot execute the package locally.  At present he has to remote connect to the server and double click a batch file on the server that contains the dtexec script. I would like to have a batch file located on the client desktop that he can click, that will run the dtsexec script on the server - as it will not work from the client machine.  However every set of commands i try inevitably end up trying to run the package on the local machine, which obviously fails. Is there any way to have the client kick of the package and have it run on the server, without him actually having to directly remote desktop to the client? Thanks  Guy

Initialize background image url in css file into custom server controls



i registered an image in AssemblyInfo.cs like this:

[assembly: WebResource("MyControl.Icons.bold.png", "image/png")]


protected override void RenderContents(HtmlTextWriter output)
            output.Write("<p class='BoldButtons' onclick='event4()'>event4 </p>");

now i want to initialize that image in css file for background-image but it dose'nt work.

my css file is:

	background-image: url("MyControl.Icons/font_bold.png");
	border: 0px; 
	height: 21px; 
	width: 21px;

i also try with this :

background-image: url(<%=WebResource("MyControl.Icons.bold.png")%>);

but it dose'nt work.

please help me? 

Creating DSN for local machine in SQL Server Express 2005


Good evening,

This is my first time with SQL Server, so please forgive me if this is a ridiculous question:

I'm trying to create a DSN so I can connect up to SQL Server Express 2005 on my laptop/local machine. I'm attempting to connect via Windows NT authentication. I've tried 'Named Pipes' and TCP/IP settings but am not able to connect. I keep getting an error that states:

SQLState: '01000'

SQL Server Error: 2

Connection failed

SQLState: '08001'

SQL Server Error: 17

SQL Server does not exist or access denied

Is the server created by just installing SQL Server 2005, or is there something additional I need to do? Any help would be much appreciated.




Image src from a local server



I have an admin web page, which has 5 textboxes, a fileupload and a "Save" button. In the fileUpload you select an Image file, and, after clicking the button, the image is saved to a location on a local server (the images are saved to \\servername\images\).

Then I have this other page (user page, which has an HTML img component) in which that image I just saved, should display.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Accessing Local Files from Web</title>
    <form id="form1" runat="server">
    <img id="HTMLImage" alt="Cannot display image" runat="server" src="file://servername/images/Image26.jpg" />

However it doesn't. When I inspect the element (the HTML img) with firebug (or however the one included in google chrome is called), i

Any hint to make a join between different server run on local machine?


if join remote table and local table, one execution plan is

1:  fetch the data from remote, and then run the sql at local.

2: push the data to remote, and execute the sql on remote, and fetch the result back.

which one is better depends. Does sql server support to use hint to use plan 1 or plan 2?

Can't connect to local database file .mdf using SQL Server Authentication?


Using  - Visual Studio 2005 Professional, SQL Server 2005 Express, WinForms App

Problem - I am unable to connect to SQL Server local Database file (.mdf) through  SQL Server Authentication.

Description -

I am addding a SQL Database file (local) in the c# winapp solution by right-click -> add new item -> SQL database file.

It adds the file, starts a wizard to create datasets and tableAdapters. Dataset files (.xsd) are created in solution. In the Data Connection pane along ToolBox we can see Database1.mdf.

When i right click on databse1.mdf -> Modify Connection.

It shows a form with Test Connection option. The connection gets tested for Windows Auth.But for SQL Server Auth it shows following error message -

When User Instance = True

Error 1 "Failed to generate a user instance of SQL Server. Only an integrated sonnection can generate a user instance. The connection will be closed"

When i set User Instance = False it shows this message -

Error 2 "An Attemp to attach an auto-named database for file C:\Doc&Sett\Admin\MyDocs\VS2005\Projects\SamApp\SamApp\Database1.mdf failed. A database with the same name

error in retriving image file from SQL Server


Hello Brother

I have a Prolem in my asp.net C# code

its a part of retriving image file from SQL Server

Hear is My Code is

first Part

Image image = RetrieveImage(id);
image.Save(Response.OutputStream, ImageFormat.Jpeg);

Second Part
    MemoryStream memStream = new MemoryStream(imageData);
    image = Image.FromStream(memStream);

My error is it asking the right assembly reference for above shown bold letter key words


please tell me what all are assembly reference i should add in project

please help me

thank you

Rupesh B S


Synchronizing schema from local development machine to remote web server


As a single developer in a small business I'm developing a data-driven website on my local machine using VS2008 Professional (I also have 2010 Professional)

It is then synchronised with a dedicated server using Expression Web (ditto design)

I'm using SqlExpress both machines and as features are added, I want to synchronize the dedicated server schema from the local schema

VS2010 has such a feature, but it's a ____ of a price to pay for one feature - basically adding fields as I add functionality.

I'm surprised SqlServer doesn't have such a feature built in - am I missing something?

(I've trialled RedGate SqlCompare, but it can't access the remote db, and I'm reluctant to enable SqlServer Remote Connections on a machine I don't own).


Import Excel File to Sql Server on a 64 bit machine


I need to import Excel (xls - 2003-2007) data into a Sql Server 2008 database. Both the Excel file and the database live on a Windows Server 2003 R2 sp2 64 bit machine.  I’m fine with it running in 32 bit mode but it all needs to happen on the same server. Also, I would like it to run in T-Sql but as a fallback we can do this in SSIS.

My T-Sql code which runs fine on a 32 bit machine is as follows:

SELECT * Into #TempTable From OpenRowSet('Microsoft.Jet.Oledb.4.0','Excel 8.0;Database=\\Servername\Folder\filename.xls;HDR=NO;IMEX=1', 'select * from [Main$]')


On the 64 bit server:

Problem accessing Report Server from client machine


We've deployed some reports from a server machine which can be accessed without any problems if you are logged onto the server itself by going to the URL of http://servername/ReportServer. However if we try and access the reports from a client machine (even if we use the same administrator Windows account) we get the Windows security window appear asking for a Username and Password to be entered in order to connect to the server. We've tried entering this but we then just get a blank screen after being re prompted a few times to enter the details.

Now I'm not sure whether this will be a Reporting Services or a Windows issue. Could it be a setting within IIS? It can't really be a user thing as the same user works on the server but not on the Client machine so it's more of a machine problem. It's as if there are some authentication settings somewhere that need to be set.

We are using SQL Server 2008 on Windows 7.


Thanks a lot


Windows 7 Home accessing SQL Server running on a WindowsXP Pro machine

I have a client running a program that uses SQL Server 2005 Express running on a WindowsXP Pro machine.  It runs just fine on the WindowsXP machine, even under several different Windows logins that SQL Server has been told are permitted.  Using a Windows 7 Home Premium machine, in trying to set up the ODBC driver to point the program to the SQL Server database on the WindowsXP machine, an error is returned indicating that it is not permitting a connection for the client machinename\Guest.  Of course, the Windows 7 machine is logged on with the same login name and password as is permitted on the WindowsXP machine, but apparently the Win 7 Home machine is not transmitting that login and password allowing the login to SQL Server to be validated through the use of Windows NT 2000 authentication.  This always works with a WindowsXP Pro workstation.  Is my problem that their workstation machine is running a HOME version, or is there some other solution to make the Win7 machine transmit the real login and password instead of trying to log in as Guest?  Networking is letting the Win 7 machine explore shared files and folders in the XP machine since those are not requiring a valid ID and password.

Action on server to cause launch of application on user's local machine.


Is there a way for an application on a server (Windows 2008) on the company intranet to cause an application to run on the user's local machine?

I need to communicate from the server to the local app, perhaps with named pipe (but I'm open to other methods). However, there is the possibility that the local app is not yet running, or went down, so I need to be able to cause it to launch, as well.


Jon Jacobs
This message was composed entirely from recycled electrons.

Accessing SharePoint 2010 Data with Server-Side APIs

Accessing SharePoint data in server-side solutions is one of the most common tasks that you will perform as a SharePoint developer. SharePoint 2010 provides powerful server-side APIs that enable you to retrieve, add, edit, and delete SharePoint data programmatically. SharePoint 2010 also includes the new LINQ to SharePoint technology that enables you to work with SharePoint data efficiently and easily.

scripts file not found on server - 404


Fiddler is showing a 404 error when my published web application runs. the jquery.js file in
/scripts is highlighted in red by fiddler as not found. ( IIS log also shows the 404 error ).
I run the web app from visual studio, on local host - no problems. The publish is successful.
All the files are in the scripts folder of the web app on the server.

In the site.master I have:
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

Visual studio does not complain about this. ( which indicates the file is found. )

Oddly, when I fully qualify the path, VS says file not found, but after I publish and run, fiddler
shows the jquery file being found and sent to the browser.
<script src="/MvcApplication1/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

when the <script> path is "../../Scripts/jquery-1.4.1.min.js", the fiddler error is
404: /Scripts/jquery-1.4.1.min.js .

when the <script> path is "/MvcApplication1/Scripts/jquery-1.4.1.min.js", fiddler shows the file
being sent to the browser from that /MvcApplication1/Scripts path.

Both the Scripts fol

image inside custom server control



I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend