w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
I want to fetch multiple data from oracle database and want to store it into another variables in C# .net
Not sure that this would be the root of the issue, but this might be giving you some weird data from your SQL query: Did you mean OC.CITY AS discm instead of OC.CITY discm? Also, just a suggestions that you might want to specify a type for the columns of your datatable: dtbl.Columns.Add("accid", typeof(int)); dtbl.Columns.Add("srno", typeof(int)); dtbl.Columns.Add("names", typeof(string)); etc.

Categories : C#

Data entry to a particular mysql database table via php, results "undefined index error" pointing variables of another table
I think the problem is with the HTML code, you are having two seperate forms : <form method="post" action="input.php"> ---first one <form method="post" action="input.php"> --- second one So when you click on first form's submit, only that form's data will be submitted (here , only cat_id and desc will be available in input.php) And then you try access other forms values in the same input.php ($item_id=$_POST['item_id']; which is not present with the first form's data. Hence you get this error. Also if you will try to submit the second form, the you will get the same error for $cat_id and $cat_descr variables. So keep all the data in a single form.

Categories : PHP

Securely store data for multiple party's in a single table
You are on the right track, but mapping the USER ID into the table is probably not what you want, because in practice many users have access to the corporations data. In those cases you would store "CorpID" as a column, or more generically "ContextID". But yes, to limit access to data, each row should be able to convey who the data is for, either directly (the row actually contains a reference to CorpID, UserID, ContextID or the like) or it can be inferred by joining to other tables that reference the qualifier. In practice, these rules are enforced by a middle tier that queries the database, providing the user context in some way so that only the correct records are selected out of the database and ultimately presented to the user.

Categories : Database

How to insert multiple form data to database from jquery table
Need to return inserted value to the model as json type. <style type="text/css"> #table1 tr { vertical-align: top; } #table1 tr td { width: 100px; } </style> <script type="text/javascript"> $(document).ready(function () { $("#butsend").click(function () { if (true) {//Check Validation $.ajax({ url: "save.php", type: "post", data: $.param($('#form1').serializeArray()), //data: JSON.stringify({}),//Pass json model success: function (data) { $("#table1").append('<tr><td>' + data.model.id + '</td><td>' + data.model.sname + '</td><td >' + data.model.age

Categories : PHP

Inserting and updating data on multiple table on SQLite database
I did it at last. :D I don't what was the problem but with changing the DatabaseHelper and Database Helperclass as below and changing input variable of functions used in this class to string, the problems had been eliminated. here is the DatabaseHelper class: public class DatabaseHelper extends SQLiteOpenHelper { private final String TAG = "DatabaseHelper"; private static final String DATABASE_NAME = "database"; private static final int DATABASE_VERSION = 1; private static final String COLUMN_ID = "_id"; private static final String COLUMN_NAME = "name"; private static final String COLUMN_VALUE = "value"; private static final String COLUMN_VALUE2 = "value2"; private static final String TABLE_NAME_1 = "table1db"; private static final S

Categories : Java

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

Select random user from database table and store in another table
You can change your first query to exclude users present in the other table with NOT EXISTS. http://dev.mysql.com/doc/refman/5.0/en/exists-and-not-exists-subqueries.html It should look like this SELECT userid, firstname, surname, email FROM users WHERE NOT EXISTS (SELECT * FROM winners WHERE users.userid = winners.userid) ORDER BY RAND() LIMIT 1; Also your code didn't work because it only had one loop because of the limit 1

Categories : PHP

Best way to store variables in a function that will be used multiple times (c++)
Usually you would pass in all the input data the algorithm needs as input parameters, and return all the useful output data the algorithm creats as a return type. You could create a separate C++ struct or class if you need to bundle a few pieces of information together. For data structures used internally by the algorithm - you would usually declare them only in the .cpp file, not the .h file. So, the user will not have any access / visibility of the internals (which is useful if you want to change how it works later). So, the header file should just have the function declaration - with input arguments and output return type. All the algorithm code goes into the .cpp file, which includes the .h file. The header file is the 'interface' and the cpp file is the 'implementation', which w

Categories : C++

Jquery variables only store limited data
64K can actually go by really quickly, especially if you have a table, and double-especially with base64 embedded images. Try changing to a LONGTEXT. If that works, then that was your problem.

Categories : Jquery

How to copy data from one database/table to another database/table in oracle using toad
copy is a SQL*Plus command, not a SQL statement. I would be surprised if Toad had implemented that particular SQL*Plus command (it does implement many of the simpler commands). If you want to use the copy command, you would need to use SQL*Plus, not Toad. If you want to use Toad, you would need to use a SQL statement to copy the data. You could create a database link in the destination database that points to the source database and then INSERT INTO tool_service_mapping SELECT * FROM tool_service_mapping@<<db link to source database>>

Categories : Oracle

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

store a blob string in database table
Refer to this link Writing BLOB values to a database. From MSDN: To write a BLOB value to your database, issue the appropriate INSERT or UPDATE statement and pass the BLOB value as an input parameter. If your BLOB is stored as text, such as a SQL Server text field, you can pass the BLOB as a string parameter. If the BLOB is stored in binary format, such as a SQL Server image field, you can pass an array of type byte as a binary parameter.

Categories : C#

Best way to store multiple passwords into Database
Looks like you should store somewhere that RC4 hash, because both client and server should do the same actions on challenge bytes and than server should compare results. Saving plain text password - bad idea, forget about it. If you save it as PasswordMD4 in database - it not add security more then PC4 by self. Saving in other table - no different with previous variant. Spring security - don't know how it can be apply here. You can store important or all DB data on encrypted partition, but it degrade performance a little. I can suggest store RC4 password into SHA-1 field, but encrypted. 3DES will be enough, maybe with some salt. You already should have salt somewhere for your SHA-1 hash. When you need RC4 hash, simple decrypt value from DB, subtract (or XOR) salt and do usual authenti

Categories : Java

Extract and store table values from database to dataValues
read Oracle tutorial How to use Tables reset DefaultTableModel to null, before a new Objects from JDBC are executed, added to DefaultTableModel, use (there are a few another methods, you can to starting with) model.setRowCount(0); create DefaultTableModel, JTable as local variables, re_use those variables, don't to create a new those Objects, then is required to remove uselles Objects and add a new Objects to Swing GUI override getColumnClass, its very important for JTables view to know data types stored in DefaultTableModel create (I assumed that there isn't another column structure, if yes then multiplay this variables) ColumnModel as local variable don't to reinvent the wheel, search for ResultSetTableModel, or better TableFromDatabase

Categories : Java

Store a database table in memory in a C# website application?
If the table is small and frequently queried, there is an outstanding chance that the data and any indices is entirely in SQL Server's memory, the query plan is cached, and that the query will be extremely fast. Measure the actual performance impact before making any changes. If you see there is a performance impact, there are many caching strategies that you can use to reduce trips to the database. More information about access patterns to the table and the need for information consistency would be needed to recommend a specific caching strategy. You state to get the same information over and over again but also state once every 15 minutes If the information really is the same over and over, you can load it once into the ASP.Net cache at application start. If it might c

Categories : C#

How to store database table schema (>50 columns) in Java
If all that you need is to create table or migrate database in general you might want to look at http://flywaydb.org/ or http://www.liquibase.org/ you will not repent

Categories : Java

Fastest/Easiest way to store multiple arrays of data for multiple time steps
Why not index via the particle id?: particles = struct; particles(id).t % length(t)-by-1 particles(id).x % length(t)-by-1 particles(id).y % length(t)-by-1 particles(id).xdot % length(t)-by-1 particles(id).ydot % length(t)-by-1 Then particles(id).x is a vector where each element corresponds to an element in particles(id).t. particles(1).x(1) would be the first x value for id 1. However, the problem with breaking things up with an id is that you won't be able to search across particles. I'd really just use arrays (or a struct containing arrays for all particles): particles = struct; particles.ids % 1-by-length(ids) particles.t % length(t)-by-1 or length(t)-by-length(ids) particles.x % length(t)-by-length(ids) particles.y % length(t)-by-length(ids) particles.xdot % leng

Categories : Arrays

How can I handle different data types in an Entity-Attribute-Value design (e.g. single table with multiple columns or multiple tables per data type)?
This is a well known problem. The problem with the approach you mentioned is that you need to know the type of the attribute before you query for it. it's not the end of the world because you manage metadata but still... Two possiable solutions might be using a varchar2 datatype to represent all data types in a known format. Numbers and chars are no problem, date values can be written in a predefined manner (it's like implementing to_String() in any OO design). use the ANYDATA data type. i personally played around with it but decided not to use it.

Categories : Database

What is the best way to store multiple checkbox values in the database and work with it later on
Ask yourself the following question: Do I need to evaluate the choices done by the customers? If you do, having them in plain comma separated lists will be a very ugly operation. If you really just want to log the choices, you can proceed with the implode/explode. Doing it the normalized way: Your table scheme: checkbox_id | customer_id | value When the customer submits his choices, you'll only insert the selected checkboxes: foreach (checkbox in POST) { INSERT IGNORE INTO `table` (`checkbox_id`, `customer_id`, `value`) VALUES (checkbox, customer, 1) } If you want to read the customer's choices later on, go for: SELECT `checkbox_id`, `value` FROM `table` WHERE `customer_id` = ? ORDER BY `checkbox_id`, `value` This will get you a list of all choices done by the specified cus

Categories : PHP

How to store multiple parameters passed as POST in database
use json_decode function to parse the json to an array or object. $a = json_decode($entityBody); $a->id; refer http://php.net/manual/en/function.json-decode.php

Categories : PHP

Best way to fetch multiple variables from MySQL Database using PDO
Have you tried the fetchAll method // FETCH name VARIABLE $fetch = $db->prepare("SELECT name, age FROM login WHERE username = :username"); $fetch->bindParam(':username', $username, PDO::PARAM_STR, 40); $fetch->execute(); $login = $fetch->fetchAll();

Categories : PHP

Multiple database records in a table vs database queries? What is the best for performance?
Before analyzing scenarios given in your question I would like to request you to clear one point which is a bit confusing in your question. The statements given below are confusing. 1) Also project has many posts, when a post is created a notification is created for each project user. 2) Let's say if Project A has 100 users, we'll have 100 notifications in database, this will load the database with a lot of duplicates. Statement no. 1 describes that when a post is created; a notification is sent for each user. So suppose there are 100 users and 100 posts then the table which has notifications data will have 10000 rows (100*100). Statement no. 2 describes that if there are 100 users then there would be 100 notifications in the database that means the notification table will have 100 row

Categories : Ruby On Rails

How to split one large database table into multiple database tables
There is no special command to do this. Using a SELECT * INTO... is as succinct as it gets. If table size is your worry then you could use a table partition or view partition as an alternative to splitting the table.

Categories : Sql Server

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#

Store login information in one table in school database with conditional relation
Use Table Inheritance. Read up on The Party Model.

Categories : Database

C# byte arrays to store multiple files into one filed in database
I will suggest to convert a file to byte arrays first. Then record its Length and Name in datatable. Get byte array of another file and append it to the previous array and record its length and name in datatable. Continue the same procedure for all the files. Update the database with your byte array to store all files. Store your datatable as an XML file in system. Whenever you need to get the files back, read the database field. Read your XML file. Split the array based on the File length from XML file. Use the corresponding name. You can optionally save the XML file data in database as well, if its possible. I hope you are looking for same thing. Hope it helps.

Categories : C#

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

Is this the right way to store data into mysql database?
mysql_escape_string is deprecated since 5.3.0, so is better to use mysql_real_escape_string This function is identical to mysql_real_escape_string() except that mysql_real_escape_string() takes a connection handler and escapes the string according to the current character set. mysql_escape_string() does not take a connection argument and does not respect the current charset setting. So is better to use mysql_real_escape_string. PDO or MySQLi extension Have a look PHP mysql_escape_string Updated: "This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used." I apologize about the answer I've given earlier, hope this correct the wrong that I've done.

Categories : PHP

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

unable to store a data value into database
You need to set $url1 before using it in the query. if (isset($_POST['url1'])) { $url1 = mysql_real_escape_string($_POST['url1']); } else { die ("Ad URL is required."); } mysql_query("UPDATE admins SET url1 = '$url1' WHERE id = '1'");

Categories : PHP

How to get data from SQL database to store in combo box - C#
If you set up your connection string to be something of this sort: string SqlConnectionString = "Data Source=[SERVER];Initial Catalog=[DATABASE];" Then using that set up, you can set your string 'Sql' as: string Sql = "select company_name from dbo.Comp"; This could be a possible set up you could use to read out the values. using (SqlConnection saConn = new SqlConnection(this.ConnectionString)) { saConn.Open(); string query = "select DBName from dbo.Company"; SqlCommand cmd = new SqlCommand(query, saConn); using (SqlDataReader saReader = cmd.ExecuteReader()) { while (saReader.Read()) { string name = saReader.GetString(0); combobox1.Add(name); } } saConn.Clo

Categories : C#

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

Azure table storage store multiple types
Your understanding is completely correct. Having the tasks split into 2 separate tables would mean 2 separate queries thus 2 transactions (let's keep more than 1000 entities out of equation for now). Though transaction cost is one reason to keep them in the same table, there are other reasons too: By keeping them in the same table, you would be making full use of schema-less nature of Azure Table Storage. 2 tables means 2 network calls. Though the service is highly available but you would need to take into consideration a scenario when call to 1st table is successful however call to 2nd table fails. How would your application behave in that scenario? Do you discard the result from the 1st table also? By keeping them in just one table saves you from this scenario. Assuming that you have a

Categories : Azure

What Database model should I use to store this data format?
In working with a MySQL-like database, one thing to remember is that you should avoid having things like dicts and arrays in a particular column. The reason is that this makes querying on these values horrible. What I would do is have, for example, a "Friends" schema with two columns, FriendA and FriendB. For every friend pair you have, this will be a row in this database. You can do the same with with "Followers", have a Follower and a Followee column. Now querying across these tables just requires a join, and more importantly if two friends get unfriended or someone decides to unfollow someone else, this is just one delete instead of two (and no arrays!) And of course, unless you're planning on having unstructured key/value data, expand that to a full schema.

Categories : PHP

Receive and store data on website database
On load of the page use something loke this. public class ajax : IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { Stream dataStream = context.Request.InputStream; StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); JavaScriptSerializer json_serializer = new JavaScriptSerializer(); Dictionary<string, object> data = (Dictionary<string, object>)json_serializer.DeserializeObject(responseFromServer); selected_user u = new selected_user(); u.user_name = data["uname"].ToString(); u.pass = data["pass"].ToString(); u.sname = data["lname"].ToString(); context.Response.Write(yourjsonre

Categories : C#

Store Angularjs form data in database using php
You have several errors: JS (You need to $scope to link your variables) $scope.save = function() { var data = { name: $scope.user.name, email: $scope.user.email } $http.post("insert.php", data).success(function(data, status, headers, config){ }); } HTML <form name="myForm" ng-controller="Ctrl" ng-submit="save()"> <label>Name:</label> <input type="text" ng-model="user.name"/><br /><br /> <label>Email:</label> <input type="text" ng-model="user.email"/><br /><br /> <input type="submit" value="Submit"/> </form>

Categories : PHP

Store test data from rails into database
1) create a file in config/initializers/test_data.rb 2) In that file conn = ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :username => "myuser", :password => "mypass", :database => "test_database" ) conn.execute("INSERT INTO 'crm_donation_email_types' ('id', 'emailtype', 'created_at', 'updated_at') VALUES (1, 'to', '2013-08-28 05:19:08', '2013-08-28 05:19:08'), (2, 'cc', '2013-08-28 05:19:15', '2013-08-28 05:19:15'), (3, 'bcc', '2013-08-28 05:19:26', '2013-08-28 05:19:26'), (4, 'from', '2013-08-28 05:19:35', '2013-08-28 05:19:35');")

Categories : Ruby On Rails

get data from database table to other database table php mysql
I think you should look here: MySQL syntax for Join Update Or here: MySQL Insert & Joins You could do this in just one query with some joining of the tables.

Categories : PHP

Copy data from one table in one database to another table in another database
You dont need two connection string. Query you mentioned in ur code snippet need to be run on DB1 db. So your Constr just need to point to DB1 db. Your query will run on DB1 and create a new table Car in DB2 db. Note: Assumption is that both DB1 and DB2 exists on same server and user you are using have access to create table in DB2 database.

Categories : Sql Server

Identify blank tables in a database and insert data from another table on a different database
do you want an exact copy of the database? why not a backup of the main one and a restore with a different name? If not possible, you can use SSIS to move the data or something like: insert into destDB.dbo.mytable select * sourcedb.dbo.mytable you can use your script to loop through the empty tables and run some dynamic SQL to execute the command above

Categories : SQL



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