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

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

how to call an dll file dynamically from (.cs )

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

i have  an  microsoft .office.interop.excel(dll) located  at an directory d:\abc\.  now i do not want to add them  as an web reference in my projet   and  call them

rather  call the dll dynamically  from my code behind(.cs)
is ther any way  we can do dynmically

 anyhelp would be  great
 thank  you

View Complete Post

More Related Resource Links

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

Problem in accessing resource file dynamically.


Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

Edit MSI file dynamically using c# code. : very urgent


Hi All,

I had created one application and this is multi client application means code is same but setup is different for each client with diff. client Code in app config file, diff product code, upgrade code, setup name, display name.

So i am looking for a way to edit my MSI file dynamically and made changes into that for each client using code or any other way dynamically.

Do any one has idea how to do this Dynamically/Anyother.

Thanks in advance.


Load the Excel File Dynamically?

Hi All, I want load the excel file in sqlserver destination. The excel file name is current date. How to load the excel file every day? Thanks CMK…

Writing connection string in web.config file by code or dynamically

I want to write connection string in web.config file of my application by code. If anyone know the way or code just help me..NET,C#,SQL SERVER

Edit CSS path on file that is dynamically created by ASP.NET

Hi,I'm not very familiar with .NET so bear with me. The website is question is built in ASP.NET and is using Themes.The external CSS link is outputted on the .master page dynamically by ASP.NET (so I've been told), apparently it generates this code from any CSS file located in /App_Themes/The problem is I need the link to the CSS to begin with a "/" so it points to the root directory.Currently the syntax is: <link href="App_Themes/file/file.css" type="text/css" rel="stylesheet" />And I need it to be <link href="/App_Themes/file/file.css" type="text/css" rel="stylesheet" />Is there anyway I can achieve this?Much thanks,Nick

How to call javascript from file

Hi, i want to call javascript from file JScript.js. I write in head section (in master site) code <script src="JScript.js" type="text/javascript"></script>. How i can call this file from default.aspx(not from master site)? Everything is fine then all code is in master page, but i need this script in other pages.<asp:DataList ID="DataList1" runat="server" RepeatColumns = "2"  RepeatLayout = "Table"  Width = "500px">     <ItemTemplate>         <br />         <table cellpadding = "5px" cellspacing = "0">         <tr>             <td>                 <asp:Image ID="Image1" runat="server" ImageUrl = '<%# Eval("FilePath")%>'                  Width = "200px" Height = "200px" onclick = "LoadDiv(this.src, this)" style ="cursor:pointer" />             </td>         </tr>         </table>         <br /> 

DataView upload save file goes nowhere. How do you set a folder to upload to? Dynamically?

I have a Dataview bound to Document Library with the New Document button enabled. It apears to upload but can't find the files anywhere. I don't have a Shared Document folder. How and where do you set where to upload the file? A specific folder would be nice and If I could make it dynamic tied to QueryString Ideal. Going a bit further, the library I'm bound to has many 3 digit numeric folders that are dynamically created when entries are added to another list. The page that is calling my dataview has a querystring that will tie into the folder I want to drop files into. Just wondering how I can dynamically set the upload destination. Currently this is the generated code: <input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}" /> <a href="javascript: {ddwrt:GenFireServerEvent('__cancel;dvt_1_form_insertmode={1}')}">Upload File</a> I have some other code that calls the classic file upload page that is working perfectly, but I'd really prefer the clean and simple UI of the DataView control if I could make it work. Thanks!

How to dynamically create HTML file from the code ?

Hi all,Precisely and concisely, I have aspx page that has only one button "Generate". If the user clicked on this button, one HTML page should be created. The created HTML page should have title "Home" and the Body should contain "Hello World". 1) What is the code that should be written inside "Generate" button in order to accomplish this functionality? 2) Assuming the HTML page gets created, How to store it inside specific folder on the local drive? Or how to store it inside DB? I would greatly appreciate any constructive input!

Is it possible to dynamically create Name (file name) when item saved to Doc Library?

Even though users have been instructed on a naming convention for saving documents to a library after creating a new one  from the library template, they forget or don't understand.  I would like to have the Name column (which is taken from the file name that it is saved as)  in the Document Library be a concatenation of other document meta data elements.  Is this possible?  In other words, is it possible for me to dynamically save the document with the correct file name as a Workflow action (in a Designer created workflow)?  I tried it, but without success.

While building my excel file, do an ajax call



I'm in trouble here because of a little problem.

In fact, in my MVC project, I have a controller which build a Excel file and the return value is a FileResult.

for now, I'm using this like that :

<form id ="TransacExportForm" method="POST" action="/theproject/thecontroller/theaction" style="display:none;">


With the javascript :


As I expected, after 25 seconds, the browser send the window popup to download the file (which is what I want)

It works perfectly, but it's so long... It's why I would do some ajax calls in order to have a "loading gif", and when the file is "created", the browser send the message to download the file.

I tried a loooot of things (get, ajax, etc...). The file is created but the browser don't send any message to download the file.

If someone could give me an answer, it would be very great :D !

Create Excel file dynamically in SSIS package and fill it by resultset data returned by Stored proce


Hello Every One,

I have a scenario in which i am executing a Stored Procedure which returned a result set.

I want to create a Excel file [name_date_time] dynamically, and fill result set data into Excel file. And then finally sent Excel file to Specific user[Email ID].

Point is that the excel file should have unique name so i want to give name as name_date_time.

So every time when package run new file is created with unique name.


Can any one suggest me who to create Excel file and fill result set data into Excel file.

And then finally send that Excel file ?







How to dynamically add the Visual elments from external file( say CustomButton.xaml) into the custom


We have a requirement on custom control. The visual elements of the control template needs to be ldoded from the external xaml file(from the end user say CustomButton.xaml) based on the user request in order to support the Component UI customization. We ahve followed the layered grid approach as explained below.

We have the custom control which has control tempalte contains 2 grids. In which the first grid(default grid) has the default visual elements. the second grid is empty(The visual elements are loaded dynamically). The triggers and converters are added into control template based on the children of default grid visual element names.

Based on the user request the UI of the control template needs to be updated into the second grid from the external xaml file(c:\test.xaml) which has the necessary visual elements. These visual elements can have the same name which is already used in the default grid children.  For this we define a dependency property called IsCustomXAML. if this property set to true then we will do the necessary logic in the property change call back of IsCustomXAML. they are like below


1. load the visual elements from external xaml file(c:\test.xaml) into the second grid.     

 UIElement externalXAMLElement = (UIElement)XamlReader.Load(new XmlTextReader(control.XamlPath));

When dynamically creating an excel file, can SSIS create xlsx files successfully? I can only get SSI


Problem: An Excel file (XLSX) dynamically created by a SQL Task cannot be opened via Excel. The task succeeds, but when you try to open the workbook in Excel you get the fillowing error message: Excel cannot open the file 'myfile.xlsx" because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

1. If the Excel file (xlsx) is created manually in Excel, then the SQL Task has no problem creating table (new worksheets) in the xlsx (so the "CREATE TABLE" statement works fine)
2. If I adjust the connection and task to work with Excel 97-2003 (xls) format then the approach works perfectly
3. The execution results show success of the SQL Task, but there are two warning messages. These same warnings appear when the SQL Task creates a new table (worksheet) successfully in a workbook (xlsx) which was created manually in Excel (and is not corrupt). Messages as follows:
Warning: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Warning: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

SSIS Details:
1. ConnectionString: "Data Sour

How to get Response.ContenType of a file dynamically


Is there any way to find Response.ContentType based on file extension dynamically. i don not want to hard code ContentType in my code like below.

Response. ContentType = "application/ms-word";

How can I change the CSS file used in Master Page dynamically?


I am thinking that it would be better to use multipe CSS files and change them within the master page dynamically than it would be to use multiple master pages (basically one master page for each page, which defeats the purpose of the master page).

However, I do not know how to make a change to the master page before a standard apsx page that is derived from it is loaded.

how to call the Stored procedures dynamically


 hi frndz,

                 ringht now i am working with one web page, in that page

i have 3 sections of data [or 3 set of data]

in 1 set 4 to 5 fields

actions to be taken

when we click on save button

1st it should save the 1st fields data in one of my sp

and it should get the table level id

it should loop that table level id into another set of records & insert into to the another sp

same should be continued twice

pl some one help me


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