dynamic

Suggestions for dynamic SQL Server access using C#

Hey guys, I'm looking for a good solution to make my life easier with regards to writing/reading to a SQL Server DB in a dynamic manner. I started with Entity-framework to make my life easier to begin with, but as the software become more general and config driven I'm finding that Entity becomes less and less appropriate because it reli...

Attach event to the dynamically generated html control in asp.net

Hi how to Attach event to the dynamically generated html control in asp.net with c# ? ...

Dynamic class field creation before metaclass machinery

I'm trying to get rid of exec in a code similar to this: class A(object): for field in ['one', 'two', 'three']: exec '%s = "%s value"' % (field, field) ...so that: >>> A.one 'one value' >>> A.two 'two value' >>> A.three 'three value' EDIT: and also the requirement mentioned in the subject is met i.e. A.one is 'one value...

Problem with .net dynamic control generation

Hello to all. I'm working on an asp.net website (using C#). I have implemented a detailsview as part of a data entry system for this website. The detailsview contains a drop down list used to associate a category with the record being submitted to this data entry system. The code behind file accesses a datasource (an SQL server 2005 d...

How to call function with address having stack object as argument with heap based data

Hello, I have a complex problem to be solve, as I am stuck and found no way at all to solve this. Here's a code struct MyStruct { int x; float y; char c; }; void foo(MyStruct a_myStruct); int _tmain(int argc, _TCHAR* argv[]) { void *pMyStruct = malloc(sizeof(MyStruct)); int* pInt = (int*)pMyStruct; *pI...

IE 8 and getElementById() that is dynamic throws error

I have a function that is called whenever a select changes. If the select had an ID of "foo" there'd be a text field with an ID of "foo_other" after it that by default is styled "display:none". If a value of "Other" is picked from the select, the function is supposed to display the text field, and set focus to it. If anything other than...

Include menu on every page

Let's say I have a simple CSS layout and my menu is a column on the side. This menu is going to be on every web page (About 10 web pages). If I have items on this menu in the form of links and such, how can I make it so that if I add a link on one page, it will add it to all pages? Would you just make it a PHP page and in that <div> elem...

Make nested for loop algorithm - dynamic

I have an algorithm that goes something like this: for m = 1 to 2 initialize(work_item(m)) for l = 1 to 2 initialize(work_item(l)) for k = 1 to 2 initialize(work_item(k)) for j = 1 to 2 initialize(work_item(j)) for i = 1 to 2 initialize(work_item(i)) doSomething(work_item(i)) ...

Creating Dynamic Predicates- passing in property to a function as parameter

I am trying to create dynamic predicate so that it can be used against a list for filtering public class Feature { public string Color{get;set;} public string Weight{get;set;} } I want to be able to create a dynamic predicate so that a List can be filtered. I get few conditions as string values ">","<",">=" etc. Is there a wa...

In PHP, mirror one dynamic webpage?

I have my blog at location /blog, and the content is dynamic. I would like /index.php on my site to mirror /blog How do I write index.php to mirror a dynamic webpage? ...

How to write String.Contains in Dynamic Linq

I'm trying to write a dynamic linq query like: var q = obj.Where("message.Contains('hello')"); I know it works for var q = obj.Where(o => o.message.Contains('hello')); but i'm looking for dynamic linq solution Thanks. ...

Dynamic + linq compilation error

I'll say up front that I am doing some really scary things with linq on dynamic data. But I can't figure out why this query fails to compile: Error 1 The property '<>h__TransparentIdentifier0' cannot be used with type arguments public class Program { public static void Main(string[] args) { var docs = new dynamic[0...

jQuery AJAX - Return dynamic content

Hello, I am making a jQuery Ajax form submit to a PHP page that I want to return values dynamically instead of all at once. For example, if my jQuery code is: jQuery.ajax({ type: "POST", url: "$PathToActions/Accounts.php", dataType: "html", data: "action=register&accounts=" + accounts, success: function(re...

buliding a website like dropthings.

Dear all, I was assigned to develop a dropthings-like project http://dropthings.omaralzabir.com/ so do you have any clue from where should i start ?? Thanks in advance ...

How to dynamically compile and load a Java class that complies to an interface at runtime?

I'm trying to compile and load a class at runtime, without knowing the package of the class. I do know that the class should comply with an interface, and the location of the source, (and hence the class name). I'm trying the following: /* Compiling source */ File root = new File("scripts"); File sourceFile = new File(root, "Test.java"...

cloacking url via .htaccess

so i read stuff about how apache's mod_rewrite does the trick but it seems to be too vague for beginners like me. lets say i wanted to mask site.com/userpage.php into site.com/ or site.com/userpage or even removing the get requests.. from site.com/userpage.php?query=yes into site.com/userpage.php or site.com/userpage how can i do tha...

How to name and find dynamically created webcontrols in c#

I am trying to add a unique name to each textbox that I'm adding to a table. I've tried: TableRow someRow = new TableRow(); TableCell someCell = new TableCell(); TextBox someTextbox = new TextBox(); someTextbox.Attributes.Remove("name"); someTextbox.Attributes.Add("name",itsId); someCell.Controls.Add(someTextBox); someRow.Cells.Add(s...

jQuery dynamic selectors show div

I have a set of dynamic headings and hidden divs with the idea that when the user clicks on a heading it toggles the div underneath to show/hide the divs all have an id in the form "div_x" where x is dynamically generated Ive managed to use .each() to loop over all divs that begin with div_ and I can .split the x portion of the id, but...

Dynamically create a gridview from a class(.cs) file

I want to create a gridview form a class and send that gridview as mail. I know the mailing part but how to create a gridview from a class file without using an aspx file. I am doing so because a method will be called at a scheduled time using quartz.net and that method will create a gridview and send it as mail. Any suggestion how it ...

Difference between dynamic and System.Object

What is the difference between a variable declared as dynamic and a variable declared as System.Object? Running the following function would seem to indicate that both variables get cast to the correct type dynamically: void ObjectTest() { System.Object MyTestVar = "test"; dynamic MyTestVar2 = "Testing 123"; Console.WriteLi...