Search Results

Search found 10177 results on 408 pages for 'thumbs db'.

Page 97/408 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • AutoComplete implementation - Interview Question

    - by user181218
    Hi, Say you have a DB table with two cols: SearchPhrase(String) | Popularity(Int). You need to initialize a DS so that you could use it to implement an autocomplete feature (like google suggest) comfortably. The requirement: Once the data from the db is processed into the data structure, when you type a letter you get the 10 most popular searchphrases from the db starting with that letter,then when you type the next one you get the 10 .... with these two letters and so on. The question only concerns planning the ds and pseudocoding Insert,Search etc. Note: YOU CANNOT USE TRIE DS. Any ideas?

    Read the article

  • Why MSSQL keeps throwing me Exceptions?

    - by Augusto Càzares
    I have my project in .NET that uses a db in MSSQL Server,i'm using LINQ , sometimes when the projec throws me an exception (Constraint) in a part of the project this same error keeps showing in other part of the project when i do another thing with the db, like when i do an insertion and i had before an exception on delete the insertion throws me the delete exeption, and it remainds this way until i close and open again the project, my major problem is when this happen in my online project, this error in my project causes me problems in the project i'm testing online (i use the same db). I don't know if this exception is on the memory or something but its have been causing me a lot of headechs.

    Read the article

  • Re-ordering collection C#

    - by Adam
    Hi - I have a problem which I cant seem to find answer to through searches (either that or I am searching for the completely wrong thing!). I have a list of items called "Top 10" in a sortedlist item that is populated from my DB (SortedList where int is position and string is item). I want to be able to move items up & down the list order at the click of a button and then save the new order back to the DB. I am OK with the DB part it is just the re-ordering I am really struggling with - is a sortedlist the correct collection for this? Many thanks for any advice offered.

    Read the article

  • Add version control to existing SQL Server database

    - by ederbf
    I am part of a development team currently working with a database that does not have any kind of source control. We work with SQL Server 2008 R2 and have always managed the DB directly with SSMS. It now has ~340 tables and ~1600 stored procedures, plus a few triggers and views, so it is not a small DB. My goal is to have the DB under version control, so I have been reading articles, like Scott Allen's series (http://bitly.com/9cJmGR) and many old SO related questions. But I am still unable to decide on how to proceed. What I'm thinking of is to script the database schema in one file, then procedures, triggers and views in one file each. Then keep everything versioned under Mercurial. But of course, every member of the team can access SSMS and directly change the schema and procedures, with the possibility that any of us can forget to replicate those changes in the versioned files. What better options are there? And, did I forget any element worth having source control of?

    Read the article

  • Why is this postgres function failing only on one specifc database?

    - by Ollie Edwards
    I'm trying to fix an issue with a legacy database. The quote_literal function is not working for a specific database on an 8.4 install of postgres. Here's my results on a fresh test database: select quote_literal(42); quote_literal --------------- '42' (1 row) And now the same on the target db select quote_literal(42); ERROR: function quote_literal(integer) is not unique LINE 1: select quote_literal(42); ^ HINT: Could not choose a best candidate function. You might need to add explicit type casts. AIUI, the quote_literal(anyvalue) function should handle integer values ok, and this seems to be upheld by the first test. So I figured the quote_literal function must have been overridden in this db but no this doesn't seem to be the case. I could override it with a specific quote_literal(integer) function but I don't see why I should have to. The question is what is could be causing the failure of this function in this specific database whilst not affecting the fresh db?

    Read the article

  • Table-per-type inheritance insert problem

    - by gzak
    I followed this article on making a table-per-type inheritance model for my entities, but I get the following error when I try to add an instance of a subclass to the database. Here is how I create the subtype: var cust = db.Users.CreateObject<Customer>(); // Customer inherits User db.Users.AddObject(cust); db.SaveChanges(); I get the following error when I make that last call: "A value shared across entities or associations is generated in more than one location. Check that mapping does not split an EntityKey to multiple store-generated columns." With the following inner exception: "An item with the same key has already been added." Any ideas on what I could be missing?

    Read the article

  • oralce + java encoding problem while insert

    - by Ahmad
    hi, I am kind of stuck on this one. im not a java or oracle guru, so please give detailed answers :) i've a web-service that inserts something into DB. the web-service is hosted on axis. the db is oracle with following properties: NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CHARACTERSET ZHS16GBK the web-service is hosted on windows server 2008, english version but i have changed the locale of the system to chinese now the data after insert has encoding problem and shows strange characters like ????,exxk?? the jws file has GBK encoding. and the data that is inserted into the DB is hard-coded in the file [we are not reading it from REQUEST]

    Read the article

  • Run a SQL Script Against MySQL using Powershell

    - by abarr
    I have a Powershell script that backs up my MySQL DB's each night using mysqldump. This all works fine but I would like to extend the script to update a reporting db (db1) from the backup of the prod db (db2). I have written the following test script but it does not work. I have a feeling the problem is the reading of the sql file to the CommandText but I am not sure how to debug. [system.reflection.assembly]::LoadWithPartialName("MySql.Data") $mysql_server = "localhost" $mysql_user = "root" $mysql_password = "password" write-host "Create coonection to db1" # Connect to MySQL database 'db1' $cn = New-Object -TypeName MySql.Data.MySqlClient.MySqlConnection $cn.ConnectionString = "SERVER=$mysql_server;DATABASE=db1;UID=$mysql_user;PWD=$mysql_password" $cn.Open() write-host "Running backup script against db1" # Run Update Script MySQL $cm = New-Object -TypeName MySql.Data.MySqlClient.MySqlCommand $sql = Get-Content C:\db2.sql $cm.Connection = $cn $cm.CommandText = $sql $cm.ExecuteReader() write-host "Closing Connection" $cn.Close() Any assistance would be appreciated. Thanks.

    Read the article

  • caching in memory on server

    - by zaharpopov
    I want to write web app with client Javascript and back-end server (Python). Client needs data from server frequently in AJAX way. Data in DB, and expensive to load for each request. However, in desktop app I would just load data from DB once to memory and then access it. In web app - the server code runs each time for request so I can't do it (each run has to load from DB to memory again). How can this work? Can a single process run on server or do I have to use something different here? An example is like auto-complete here on stackoverflow for tags - how is it implemented in the server for fast caching/loading?

    Read the article

  • Create Access databases programatically through vb.net

    - by user87225
    Let me preface this by saying that I know this is a stupid way to go about this, but it needs to be handled in this way. I need to make an application that from a master database creates a number of access database files (tables of a larger db), then these are manually given to users who fill in data, the database files are emailed back to a user who, through the application, combines them again. The only part of this that I am unsure about is problematically creating the access db's. I have read that through Microsoft Jet OLE DB Provider and Microsoft ADO Ext I can create them (the tables and data), but I also need forms. I have yet to start writing anything and this is away from my area of work, so any insight/links would be much appreciated. Also, I would hope to be able to write this in the free express version of visual studio. Are there components needed that would prevent me from this? Thanks.

    Read the article

  • how to simplify this database update query (php)

    - by krike
    How could I simplify this update instruction? Whenever a client buys an item it will update the sales with 1. $this->db->query('SELECT amount FROM shop_items WHERE itemid='.$itemid.''); $new_amount = $item->amount+1; if(!$this->db->query('UPDATE shop_items SET amount='.$new_amount.' WHERE itemid='.$itemid.'')): return false; endif; Can't I make it more simple so there are less lines, for example: if(!$this->db->query('UPDATE shop_items SET amount=_current_value_+1 WHERE itemid='.$itemid.'')): return false; endif; is this possible? if not thanks anyway

    Read the article

  • Call Method from LinQ query.

    - by Jitendra Jadav
    Hello Everybody, I am using Linq query and call method Like.. oPwd = objDecryptor.DecryptIt((c.Password.ToString()) it will return null value. Means this will not working. how I Resolve this. Thanks.. var q = from s in db.User join c in db.EmailAccount on s.UserId equals c.UserId join d in db.POPSettings on c.PopSettingId equals d.POPSettingsId where s.UserId == UserId && c.EmailId == EmailId select new { oUserId = s.UserId, oUserName = s.Name, oEmailId = c.EmailId, oEmailAccId = c.EmailAccId, oPwd = objDecryptor.DecryptIt(c.Password.ToString()), oServerName = d.ServerName, oServerAdd = d.ServerAddress, oPOPSettingId = d.POPSettingsId, };

    Read the article

  • Hibernate Updating an existing entity with a new object

    - by DD
    Hi, Assume I have an entity Foo in the DB. I am parsing some files and creating new Foo objects and would like to check if the parsed Foo object exists in the DB (using a unique attribute). If it exists already update it otherwise save as a new object. What is the best approach? Could I simply set the id and version in the new Foo object? Or would I be better off loading the Foo object from the DB and copying over the properties from the parsed file? Thanks.

    Read the article

  • [Hibernate] Problem with saveOrUpdate()

    - by kunkanwan
    Hi, I've problem with Hibernate. I have a class User class User { int id; String name; } where id is native generator in User.hbm.xml , and name is primary-key in DB. In my database , I saved some information about Users. Than, I want to connect with this information about User. For example in my DB i have row INSERT INTO User VALUES ('Bill'); Main.java User bill = new User(); bill.setName("Bill"); session.saveOrUpdate(bill); This code always trying insert bill to database , rather than update when row about Bill exists in DB... Could you help me ? Thank you for advance.

    Read the article

  • Codeigniter database update

    - by Carry All
    The table is like this and I want to update DecryptionDate by specify ArchiveID and RecipientID this is my code $this->load->database(); $date = date("Y-m-d H:i:s"); $data = array('DecryptionDate' => $date); $array = array('ArchiveID'=>$archiveID.'','RecipientID'=>$userID.''); $this->db->where($array); $this->db->update('log', $data); if ($this->db->affected_rows() > 0) { echo "SUCCESS"; } else { echo "FAIL"; } my problem is I can update the data only when $archiveID is 911 and $userID is test01 but the program fail to update when $archiveID is 911 and $userID is test02

    Read the article

  • url rewriting + Asp.Net Login Form = Death

    - by xor88
    Hi, on our site we do url rewriting to generate massive amounts of database generated pages. on every page, there is a Login control for users. like this: Internal aspx page: /DB.aspx?id=123 User visible url: /ABC/123.aspx, /ABC/456.aspx ... (url rewritten) unfortunately, the tag on each page has an action attribute of "DB.aspx?id=123". when the user clicks the button the browser is posting to /ABC/DB.aspx?id=123 which of course does not exist. solutions i tried: 1. change the action attribute by subclassing HtmlForm. this destroys the all other forms on the site. 2. remove the action attribute (so that the browser is always posting to the same url). this works on the rewritten pages but on "/" (the default.aspx in the root dir) i get a message that the verb post is not allowed on "/" (iis 6 and i have no control over mappings) anybody?

    Read the article

  • Query two tables from different schema

    - by Guru
    Hi- I have two different schemas in Oracle (say S1, S2). And two tables in those schemas(say S1.Table1, S2.Table2). I want to query these two tables from schema S1. Both S1 and S2 are in different databases. From DB1 - Schema S1, I want to do something like this, select T1.Id from S1.Table1 T1 , S2.Table2 T2 Where T1.Id = T2.refId I know one way of doing this would be creating a DB Link for the second schema and use it in querying. But sadly, I don't have priv to create DB link. Is there some way to do without DB link, like, in TOAD, you can compare two schema objects. But again, two schema objects and it is general comparision. Not like querying them. Any ideas, suggestions are greatly appriciated. Thanks in advance.

    Read the article

  • SQL Temp Tables & Replication

    - by Refracted Paladin
    I have had an issue with our replication process and would like to salvage some data. I have a process in place where I will connect to each subscriber before flagging them for reinitialization and I will run the below to pull any data they may have entered in during the "dark time". I am pretty sure this will work in a vanilla palace. What I am unsure of is whether the Global Temporary Table will persist through DB Replication. To be clear, I am not trying to Replicate the TempTable, I just want to make sure it will still exist at the local DB after the Replication so I may run the INSERT from it. Thoughts? USE MemberCenteredPlan -- Select Data from tblPLan SELECT * INTO ##MyPlan FROM tblPlan WHERE PlanID = 407869 --------------------------- -- Run Replication Process --------------------------- -- Insert Plan back into DB INSERT INTO tblPlan SELECT * FROM ##MyPlan WHERE PlanID = 407869 -- Drop Global Temp Table DROP TABLE ##MyPlan --------------------------- -- Run Replication Process ---------------------------

    Read the article

  • Idatareaders not returning values from database

    - by Phil
    In my codebehind I have this vb: Dim reader as idatareader = includes.SelectDepartmentID(PageID) While reader.Read Did = reader("departmentid") GroupingHeading = reader("heading") Folder = reader("folder") If reader("OwnBanner") Is DBNull.Value Then OwnBanner = String.Empty Else OwnBanner = reader("ownbanner") End If Then in my class I have: Public Function SelectDepartmentID(ByVal PageID As Integer) As IDataReader Dim Command As SqlCommand = db.GetSqlStringCommand("sql") db.AddInParameter(Command, "@pageid", Data.DbType.Int32, PageID) Dim reader As IDataReader = db.ExecuteReader(Command) reader.Read() Return reader End Function No Errors are being presented yet nothing is being returned by the reader. Is there an error in my code? Thanks.

    Read the article

  • Poll database using jQuery/Ajax

    - by Gav
    Hi guys, I am trying to use jQuery (latest version) & ajax to poll a mysql db every x seconds, post.php does a simple search query on the table and limits to 1 row. (eg SELECT id FROM TABLE LIMIT 1) I've got some other jQuery UI (using v1.8) code that displays some modal/dialog boxes on the screen, simply put if post.php returns something from the db I need to initialise the dialog to pop up onto the screen. I've done all the popup stuff I am just having issues joining all these bits together - i've added some pseudo code of how i expect this to work. Thanks in advance var refreshId = setInterval(function(){ $.ajax({ type: "POST", url: "post.php", data: "", success: function(html){ $("#responsecontainer").html(html); } }); }, 2000 );s /* proposed pseudocode */ if (ajax is successful & returns a db row to #responsecontainer) { show jQueryUI modal (done this bit already fortunately) }

    Read the article

  • problems, custum wrap (class) around PDO, doesn't work

    - by Knarf
    DB::construct(); $STH = DB::prepare('INSERT INTO users (username, password, email, activationkey) VALUES (?, UNHEX(?), ?, ?)'); var_dump($STH); $result = $STH->execute(array('test', 'nils', '[email protected]', '227a038fe9c81515b514cb152188e95c')); echo "working? <br />"; if($result == false) echo 'noooo...'; It outputs and doesn't put anything in the database. Works with a similare code with DPO just without my DB class. But I doesn't get any errors. Anyone have an idea what the problem could be? object(PDOStatement)#2 (1) { ["queryString"]=> string(87) "INSERT INTO users (username, password, email, activationkey) VALUES (?, UNHEX(?), ?, ?)" } working? <br /> noooo...

    Read the article

  • Syncing a table records with a Service response frequently

    - by Karthik Dheeraj
    I am requesting data from a service whose response in stored in a database.First, I have an empty table, whenever I make my very first request the records from the service comes to my database table. from now, whenever I make second request, the service will provide me some records which may be same as my first response, may be new records, may be updated records etc. my query is to how to update my table with respect to the responses coming from the service during my second request on-wards? so that Unchanged records will remain same, New records will be added, updated records will be updated.Do I need to write any stored procedure on my DB or any workaround ?what might be the scenario if I use Nomysql DB's like mongo DB ? Thanks In Advance.

    Read the article

  • FASM - Adding to Start Up HKCU

    - by Josh Line
    I am trying to make my FASM application add itself to the system start up by adding an entry in "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" I am using the following API's: RegOpenKeyExA RegSetValueExA RegCloseKey In advapi32.dll When my code is ran, the entry is never created. Here is my code: format PE GUI 4.0 include "Win32A.Inc" entry start section ".idata" import data readable writable library kernel32, "kernel32.dll",\ advapi32, "advapi32.dll" import kernel32,\ lstrlen, "lstrlenA",\ ExitProcess, "ExitProcess" import advapi32,\ RegOpenKeyExA, "RegOpenKeyExA",\ RegSetValueEx, "RegSetValueExA",\ RegCloseKey, "RegCloseKey" section ".data" data readable writeable sKey db "SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0 lpData db "C:\File.txt",0 lpValueName db "Text File" phkresult dd ? section ".code" code readable executable start: invoke RegOpenKeyExA, HKEY_CURRENT_USER, sKey, 0, KEY_SET_VALUE, phkresult invoke lstrlen, lpData invoke RegSetValueEx, phkresult, lpValueName, 0, REG_SZ, lpData, eax invoke RegCloseKey, phkresult exit: invoke ExitProcess, 0 I am not understanding as to why my entry is not being added in the registry. Any help on this issue would be greatly appreciated.

    Read the article

  • simple form validation in dancer/perl

    - by devnull
    I am trying to do a simple form validation in perl dancer but I was wondering what would be the best way to validate simple parameters (e.g. field cannot be empty, validity of the email, minimum length of a field) in dancer/perl without any extra plugin or CPAN module here is the code so far post '/register' => sub { my $db = connect_db(); my $sql = 'insert into users (username, email, password, motivation) values (?, ?, ? ,?)'; my $sth = $db->prepare($sql) or die $db->errstr; $sth->execute(params->{'username'}, params->{'email'},params->{'password'}, params->{'motivation'}) or die $sth->errstr; set_flash('Hey you signed up !'); redirect '/thanks'; }; I did google it and I found several ways to do validation using CPAN modules like Form::Foo but how do it without that ?

    Read the article

  • sqlite & python - only pulls the first result

    - by pencilNero
    This is pretty strange (admitedly, this is my first attempt with python / sqlite), but I can seem to get all of the rows if I do a fetchAll(), but other than that - no matter what I try, always ends up in the db only returning the first row - the second iteration stops because a null is returned. Wondering if there is something wrong with how I am coding this up in python? The db seems ok.. con = sqlite3.connect('backup.db') con.row_factory = sqlite3.Row cur = con.cursor() cur.execute('select * from tb1;') for row in cur: try: # row = dataCur.fetchone() #if row == None: break print type(row) print ' Starting on: %i' % row[0] cleaner = Cleaner(scripts=True, remove_tags=['img'], embedded=True) try: cleaned = cleaner.clean_html(row[2]) #data stored in second col cur.execute('update tb1 set data = ? where id = ?;', (cleaned, row[0])) except AttributeError: print 'Attribute error' print ' Ended on: %i' % row[0] except IOError: print 'IOexception'

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >