w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Dynamiccally load DLL with controllers and views from database, store to HDD and activate via activator
have you looked into MEF to load in the libraries with a mefcontrollerfactory to instantiate the controllers? this site should help get you started http://www.fidelitydesign.net/?p=259

Categories : Asp Net Mvc

What is the best way to store a field that supports markdown in my database when I need to render both HTML and "simple text" views?
You need to store your data in a canonical format. That is, in one true format within your database. It sounds like this format should be a text column that contains markdown. That answers the database-design part of your question. Then, depending on what format you need to export, you should take the canonical format and convert it to the required output format. This might be just outputting the markdown text, or running it through some sort of parser to remove the markdown or convert it to HTML.

Categories : Javascript

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

How do I modify an existing database table (add/remove columns) with PetaPOCO (Umbraco 6, MVC)
If you are using PetaPoco, you could use the db.Execute("alter table ...") but then you would need to have sufficient access rights to execute a DDL statement like that. Also I would run this within a PetaPoco transaction too, as it's good practice. Finally, if you were running this at Application_Start (which is fine) you would need to perform a check to ensure that the column didn't already exist.

Categories : C#

HTTP GET to return custom model with data from external database with Umbraco MVC Surface Controller
There are a lot of questions about this and the best place to look for an authoritative approach is the Umbraco MVC documentation. However, yes you will find, if you use Html.BeginUmbracoForm(...) you will be forced into a HttpPost action. With this kind of functionality (a search form), I usually build the form manually with a GET method and have it submit a querystring to a specific node URL. <form action="@Model.Content.Url"> ... </form> On that page I include an @Html.Action("SearchResults", "TyresSearch") which itself has a model that maps to the keys in the querystring: [ChildAction] public ActionResult(TyreSearchModel model){ // Find results TyreSearchResultModel results = new Wheels.BDL.TyreBDL().GetAllTyres(); // Filter results based on submitted mo

Categories : Asp Net Mvc

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

Refresh Controllers/Views after Database Change in MVC4 Database First
Unfortunately, it can't be... The model can only update entity classes, not views and controllers. A trick for could be to creating a new controller with a new name and keeping the old controller as well. Then, copy those important codes from the old contoller to the new one. And the same approach for views

Categories : Asp Net Mvc

How To Store a CBPeripheral For Use in Other Views
Create a singleton that implements all of all your CBCentralManagerDelegate methods. Then just create your own delegate methods for that singleton to message your viewControllers. That way you can easily use it in any class. As for storing the CBPeripherals, you can just place them inside of an NSMutableArray contained inside of your singleton. Check out this link on how to Create a Singleton Instance (Oh and for where you say "Initialize it in other view controllers"..That should not ever be the case. But maybe you just mean to store the CFUUIDRef? If you do that, you can just call retrievePeripherals:(NSArray*) and get the peripheral object back wherever you want. If thats what you mean...)

Categories : IOS

How can I use different urls for different store views in magento?
You can try this at the bottom of your .htaccess file located in your Magento root directory. SetEnvIf Host www.myshopsite..$ MAGE_RUN_CODE=$1 The MAGE_RUN_CODE variable is for the Magento Store View. You essentially set it to the store view code set under System > Manage Stores > Store View I've done quite a bit of these configurations so I know that sometimes your server environment setup (apache etc) may differ, and using SetEnvIf in .htaccess may not work. If that is the case, you may be better off inserting a bit of code into the index.php that achieves the results you are looking for. Yes, it's modifying a core file, however given this scenario is might be more stable to have PHP handle the store variable mapping rather than apache.

Categories : Htaccess

Store views in a buffer and show them later
How about using a Map? http://docs.oracle.com/javase/6/docs/api/java/util/Map.html Map<Integer,TextView> textViewMap = new HashMap<Integer,TextView>(); public void addTextView(int belowId, int id,String text){ RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); lp.addRule(RelativeLayout.BELOW, belowId); lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT); TextView tv = new TextView(this); tv.setLayoutParams(lp); tv.setId(id); tv.setText(text+" "); textViewMap.put(tv.getId(), tv); } public void showview(int id){ RelativeLayout rSub= (RelativeLayout) findViewById(R.id.rSub); rsub.addview(textViewMap.get(id)); }

Categories : Java

Best Way To Track Page Views and store in MySQL
Use an update query to increment the counter. UPDATE blog_posts SET views = views+1 WHERE id = 'SOME NUMBER' Where your each row in the blog_posts table has a numberic views field and an id. SQL Fiddle: http://sqlfiddle.com/#!2/0915b/1

Categories : PHP

windows 8 store app limit orientation of selected views or grids
You can set preferred orientation by this. DisplayProperties.AutoRotationPreferences = DisplayOrientations.Landscape | DisplayOrientations.LandscapeFlipped; Please note, this is applicable to whole app, so you have to keep changing the values when necessary. If you test this in simulator it won't work, you need to test it in real device.

Categories : Xaml

I want to get updated records from web sql server database into local database table through Store Procedure
Check linked server. http://www.jensbits.com/2010/11/10/create-linked-server-sql-server-2008/ after link the web server in to your local server, can access data easily.

Categories : Sql Server

how to store the class object array value into database and reterieve theses value from the database
To store an array in a database you can use the PHP serialize function $serialized_array = serialize($as); // This can now be stored in the database Then when you retrieve it from the database use unserialize $back_to_array = unserialize($result_from_database); //You now have the array again Also consider using PHP5 notation for class declarations such as declaring function and member variables as public/protected/private and using function __construct() instead of function your_class_name

Categories : PHP

Read Data from one database and store it in other database
You can use ETL (Extract/Transfer and Load) . Spoon is a free tool that you can create transformations purely using SQL to perform this type of a task. http://kettle.pentaho.com/ http://wiki.pentaho.com/display/EAI/Spoon+User+Guide http://rpbouman.blogspot.com.au/2006/06/pentaho-data-integration-kettle-turns.html

Categories : Java

Backbone Views within Views within Views - why does this.$el.html('insert some content here') do nothing?
I managed to sort this out, with a little help from this article here - Backbone View Nesting I rewrote the memberHomeView class and moved the region instantiation from the render to the postRender function. This then ensured that the template rendering had been completed, allowing the region to then instantiate correctly (It comes back to me now that this is why I created the postRender method in the first place. Here's the altered function... define(['ministry', 'jquery', 'views/v-header', 'models/m-ns', 'views/components/components', 'text!templates/hub/member-home.html'], function (Ministry, $, Header, Models, Components, TemplateSource) { var memberHomeView = Ministry.SecureView.extend({ name: 'Member Home', sectionName: 'Hub',

Categories : Javascript

Drop SCHEMABINDING from all views in a database
One way would be to highlight the Views node in Object Explorer, then hit F7 (View > Object Explorer Details). On the right will be all of the views; unfortunately you can't filter or add a new column to sort based on whether the view does have SCHEMABINDING. So you'll have to manually select the ones you want (or just select all except the System Views folder), then right-click, Script View As > DROP and CREATE to > New Query Editor Window. Now you can just search that script for SCHEMABINDING, delete or comment out each instance, and then run the script. If some of the views you selected did not have SCHEMABINDING in the first place, then no big deal - they'll just get dropped and re-created too. (This is much easier, in my opinion, than trying to search and replace CREATE VIEW

Categories : SQL

Creating JSP templates (views) dynamically from Database
If view templates are to be dynamically fetched from a database, you shouldn't think of JSP. JSPs are compiled into servlet classes and there's little support for doing that other than the standard way (static files somewhere under your webapp root). Therefore, just consider switching the view technology (at least for the dynamic part) to some general-purpose templating library like Velocity or Freemarker. This comes with a security bonus, since there's less one can break from within such a template than from within JSP code. You could even support multiple view technologies (perhaps anything that Spring MVC supports out-of-the-box, except for JSP) and allow your users to choose the type of template when uploading. Then you can write a custom view resolver which would delegate to the ap

Categories : Java

How to make database change cause updates to web clients' views
You need to implement a polling model here. On GUI implement a script that should make a server call every n seconds bring the latest data and show it on GUI, obviously on server side you need code that can bring data and generate response. To implement polling you can set a function to be invoked after x time. window.setInterval(dbCallFunction, x); Once function invokes, make a server call, return results, you can set again function interval. There are lot of javascript libraries that can solve this for you, I would recommend using JQuery, here is the link Cheers !!

Categories : Java

Sqlprojects: Stores and views with references to other database not compiling
You'll want to add some database references to your project. I usually have done this by creating a dacpac for the "Other_DB" database, putting that in some location that all database projects could access (usually the folder one level above the solutions), and adding a database reference without the option to use a variable for the database name. I have written this up on my blog here: http://schottsql.blogspot.com/2012/10/ssdt-external-database-references.html You can use SQLPackage to extract a dacpac from your existing database if VS/SSDT does not work. I've had mixed success using the GUI tools to create a dacpac file.

Categories : Database

adding fields to database without changing views mvc4
If you are prepared to change your model class then you can use Html.DisplayForModel (for read-only views) or Html.EditorForModel (for editable views), which will auto-generate HTML on the basis of the properties of your model.

Categories : C#

How do I QUICKLY check many sql database tables and views to see if they are not empty or contain records
I think I understand why querying the views could be expensive. Unlike a plain table, a query on the view potentially has to examine lots of rows in the underlying table or tables to determine that it has at least one row. Combine that with the fact that the SQLlite query optimizer might not be that "clever". So I suspect that the answer is that checking for empty views could be slow no matter how you do it.

Categories : Java

How to store the database value in array?
This code return the query result as array, now you can use the array inside your controller and pass it to your view. $data = array(); foreach ($query->result() as $row) { $data[] = array( 'title' => $row->title, 'name' => $row->name, 'body' => $row->body ); } return $data;

Categories : Codeigniter

How to store the the value of a text box in a database?
You can use a HTML form like this: <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"> </script> <script type="text/javascript" src="addEntryFormAjax.js"> </script> </head> <body> <form id="form"> <input type="text" id="blogText" name="blogText" size="40" /> <input type="submit" id="submit" value="submit"/> </form> <div id="result"> None </div> </body> The HTML form uses JavaScript to attach a submit handler (addEntryFormAjax.js): $(document).ready(function() { $("#form").submit(function() { doAjax(); // Prevent normal form submit return false; }); }); function doAjax() { $("#result").html("&

Categories : PHP

Store preferences in database - How to?
I would store preferences in SharedPreferences - it's what they are there for, there's a whole set of classes and methods for them. You certainly can store them in your own database but you would have to setup the tables, write the adapters, and so on. What's the benefit? A lot of my apps have an sqlite db in them to store content etc. Preferences I store in SharedPreferences.

Categories : Android

how to store this kind of value in database
Create a table referrals and save the referrals against the user Ids.Here userid will be foreign key. for e.g: ID UserID Referrals 1 32 referrals link here 2 41 referrals link here and so on. So in this way you can easily keep track the count of referrals for each user. As per your comment, if a user(abc) having id 32 got too many referrals then only your rows will increase for e.g: ID UserID Referrals 1 32 referrals link here 1 2 32 referrals link here 2 3 32 referrals link here 3 4 32 referrals link here 4 Now you can see the user id is repeating but the value of Referrals changes.This is a far better way of getting your approach rather than cr

Categories : PHP

Store JSON in database
Change this mysql_query($con,"INSERT INTO app_event (JSON_app) VALUES('mysql_real_escape_string($js)');"); With this mysql_query("INSERT INTO app_event (JSON_app) VALUES('".mysql_real_escape_string($js)."');"); You should consider learning more PHP, by the way.

Categories : PHP

PHP - Store information with NO database
Cookies might be helpful. I can't think of any other secure way. This isn't too graceful either. http://support.mozilla.org/en-US/kb/cookies-information-websites-store-on-your-computer

Categories : PHP

Database for an online store
You'll need Categories table and Products table. In products table you'll need category_id:integer field. Category.rb has_many :products Product.rb belongs_to :category has_many :line_items Cart.rb has_many :line_items LineItem.rb (table line_items with product_id:integer and cart_id:integer) belongs_to :cart belongs_to :product each time someone adds a product to cart it will create a line_item row with product_id and cart_id and you can also add quantity field to update if customer order more products of the same type. For Men and Women types of products you could add a field in products table that will id id this product is for him or for her, for_men: boolean, default:true Product.rb belongs_to :category has_many :line_items scope :men, -> {where(for_men: true)}

Categories : Mysql

Store some data from database
do it like this using (SqlConnection con = new SqlConnection(myConnectionString.ConnectionString)) { string query = "Select EmployeeID, (LastName + ','+ FirstName+' '+ MiddleName) as Name from Employee"; SqlDataAdapter dap = new SqlDataAdapter(query ,con); DataTable dt = new DataTable(); dap.Fill(dt); comboBox1.DisplayMember = "Name"; comboBox1.ValueMember = "EmployeeID"; DataRow dr = dt.NewRow(); dr[0] = -1; dr[1] = "Add Employee"; dt.Rows.InsertAt(dr, 0); comboBox1.DataSource = dt; } then private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if(Convert.ToInt32(comboBox1.SelectedValue.ToString())==-1) { EmployeeForm nf = new EmployeeForm();

Categories : C#

Where to store the database path as a variable?
Create a static method in some class which returns the FMDataBase object defined above. Class Aclass; +(FMDataBase)database{ //do your stuff here, make sure to return the database object. } The database is now accessible via : [Aclass database]; Don't forget to #import "Aclass.h" You could also create a class variable in Aclass.m and initialise it first and the access it using a class method. Like this example: Global Property in Objective C Sorry for the formatting.

Categories : IOS

How to store value from Drop Down List In Database
Change: $select_query= 'Select * from category'; $select_query_run = mysql_query($select_query); echo " <form action='insert_product.php' method='POST' ></br> Product Name: <input type='text' name='product_name' /></br> Price : <input type= 'text' name= 'price' /></br> Description : <input type='text' name='description' />*Seperate by Comma</br> <input type='submit' value='Insert' />"; echo "<select name='category'>"; while ($select_query_array= mysql_fetch_array($select_query_run) ) { echo "<option value='".$select_query_array['category_id']."' >". htmlspecialchars($select_query_array["name"])."</option>

Categories : PHP

The best way to store tree-like data in database
Saving data with tree like structure with space: you will run out of space for trees having larger hierachy. try this PkId Name ParentId(FkId to PkId ) --------------------- 1 root 0 2 child1 1 3 child2 1 4 child3 2 then you can us a function to generate the tree structure.

Categories : Database

i can't store data in database when i try to upload
Your INSERT statement is wrong, INSERT INTO updates (member_id, status, date) VALUES('$mem_id','$stat','$date') should be the right statement, as commented by Mike. However, you have 3 big problems in your code: 1) You're using deprecated functions. Seriously, stop using mysql_ functions, they're deprecated, they are no longer supported any more by PHP, and they may go away anytime, and when that happens your code will break, and you'll be in a hell of trouble. Use mysqli or PDO instead. 2) Your code is vulnerable to SQL Injection. You're not sanitizing user input, addslashes is not good enough to prevent SQL injection into your query, if you use mysqli or PDO you'll be able to use prepared statements, so that your code will no longer vulnerable to SQL Injection (it doesn't mean

Categories : PHP

Store Image path in database
Don't know if you already have solved this problem, but after looking for it myself i found a solution. what i did was use this. i stored my images in a subfolder in "Assets" and this works like a charm, don't know how many images it can hold in total, but i'll find out eventually i guess xD

Categories : Android

How to store graph data in a database?
I start at the bottom. Is it better to delete the memory after the user log out and read it from database when he logs in or should logging in and logging out should not have any impact on the node? You will need some sort of permanent storage, or your lose all the data you acquired on your first crash/restart that might upset your users a bit. How can I store the data? Well without knowing more about this it is difficult however assuming that you have a list of users and each user can have 0 or more friends then i would go with 2 tables. Users - stores all your user information such as username and password UsersFriends *- store all the relationships in a UserID -> UserID fashion * Example Users Table UserID Username 1 user2511713 2 abstracthchaos 3 a

Categories : Database

Store the given text field value into particular database?
In your Web server create a database, you need to use php for communication of database and your data storage request. Also you need to retrieve data so you need to use Json and implement it in Android. For example for this purpose go to Androidhive . Info and check the example given there.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.