Search Results

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

Page 75/408 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • LINQ Expression not evaluating correctly

    - by WedTM
    I have the following LINQ expression that's not returning the appropriate response var query = from quote in db.Quotes where quote.QuoteStatus == "Estimating" || quote.QuoteStatus == "Rejected" from emp in db.Employees where emp.EmployeeID == quote.EmployeeID orderby quote.QuoteID descending select new { quote.QuoteID, quote.DateDue, Company = quote.Company.CompanyName, Attachments = quote.Attachments.Count, Employee = emp.FullName, Estimator = (quote.EstimatorID != null && quote.EstimatorID != String.Empty) ? db.Employees.Single (c => c.EmployeeID == quote.EstimatorID).FullName : "Unassigned", Status = quote.QuoteStatus, Priority = quote.Priority }; The problem lies in the Estimator = (quote.EstimatorID != null && quote.EstimatorID != String.Empty) ? db.Employees.Single(c => c.EmployeeID == quote.EstimatorID).FullName : "Unassigned" part. I NEVER get it to evalueate to "Unassigned", on the ones that are supposed to, it just returns null. Have I written this wrong?

    Read the article

  • Where is my SQLite database?

    - by Brian Ramsay
    I have installed SQLite version 3 into a non-standard location on my dreamhost user account. I compiled it and installed it just fine, and it works with $db=new SQLiteDatabase("db.foont"); I can create tables and insert and read data with the SQLiteDatabase object just fine. However, I want to use PDO. My problem is that PDO requires an absolute path to the database specified in the connection. e.g., 'sqlite:/path/to/db.sq3' a) this is dumb - if the other object can figure out where the db is without an absolute path why can't PDO's sqlite driver - but that's not my question. b) where the heck is my database being stored? I can't find it anywhere in my user filesystem, and I'm pretty sure I don't have access to anything else.

    Read the article

  • Is there something like a "long running offline transaction" for NHibernate or any other ORM?

    - by Vilx-
    In essence this is a followup of this question. I'm beginning to feel that I should give up the whole idea, but I'll give it one more shot. What I want is pretty much like a DB transaction. It should track my changes to the DB and then in the end allow me to either commit or rollback them. If I insert an object, I should get it back in my next (appropriate) SELECT query. If I delete it, future SELECT queries should not return it. Etc. But there is one catch - this transaction would be very long running. It would start when the user opened a form (I'm talking about Windows Forms here), and the commit/rollback would be when the user closed it(with OK/Cancel). So it could take anywhere between seconds and days. This requirement rules out a standard DB transaction because that would lock the tables/rows it touched, and other users wouldn't be able to use the system. Also the transaction should not commit ANY changes to the DB until it was really committed. So if one user makes some changes, others don't see them until OK button is hit. This prevents errors in case the computer crashes or is disconnected from the network. I'm quite OK if the solution puts constraints on my model (I'm using MSSQL 2008, btw). I can design the DB/code any way I like. I'm also fine with the idea that a commit could fail because someone already modified one of the objects my transaction touched. Is there anything like this? I looked at NHibernate.Burrow, but I'm not sure that that's the thing I want. Added: It's the very beginning of the project so I'm not tied to NHibernate. I started out with it but I can still change easily.

    Read the article

  • In LINQ-SQL, wrap the DataContext is an using statement - pros cons

    - by hIpPy
    Can someone pitch in their opinion about pros/cons between wrapping the DataContext in an using statement or not in LINQ-SQL in terms of factors as performance, memory usage, ease of coding, right thing to do etc. Update: In one particular application, I experienced that, without wrapping the DataContext in using block, the amount of memory usage kept on increasing as the live objects were not released for GC. As in, in below example, if I hold the reference to List of q object and access entities of q, I create an object graph that is not released for GC. DataContext with using using (DBDataContext db = new DBDataContext()) { var q = from x in db.Tables where x.Id == someId select x; return q.toList(); } DataContext without using and kept alive DBDataContext db = new DBDataContext() var q = from x in db.Tables where x.Id == someId select x; return q.toList(); Thanks.

    Read the article

  • Efficient Search function with Linq to SQL

    - by Bayonian
    Hi, I'm using VB.NET and Linq to SQL. I have a table with thousands of rows and growing. Right now I'm using .Contains() in the Where clause to perform the query. Below is my search function : Public Shared Function DemoSearchFunction(ByVal keyword As String) As DataTable Dim db As New BibleDataClassesDataContext() Dim query = From b In db.khmer_books _ From ch In db.khmer_chapters _ From v In db.testing_khmers _ Where v.t_v.Contains(keyword) And ch.kh_book_id = b.kh_b_id And v.t_chid = ch.kh_ch_id _ Select b.kh_b_id, b.kh_b_title, ch.kh_ch_id, ch.kh_ch_number, v.t_id, v.t_vn, v.t_v Dim dtDataTableOne = New DataTable("dtOne") dtDataTableOne.Columns.Add("bid", GetType(Integer)) dtDataTableOne.Columns.Add("btitle", GetType(String)) dtDataTableOne.Columns.Add("chid", GetType(Integer)) dtDataTableOne.Columns.Add("chn", GetType(Integer)) dtDataTableOne.Columns.Add("vid", GetType(Integer)) dtDataTableOne.Columns.Add("vn", GetType(Integer)) dtDataTableOne.Columns.Add("verse", GetType(String)) For Each r In query dtDataTableOne.Rows.Add(New Object() {r.kh_b_id, r.kh_b_title, r.kh_ch_id, r.kh_ch_number, r.t_id, r.t_vn, r.t_v}) Next Return dtDataTableOne End Function I would like to know other methods for doing efficient search using Linq to SQL. Thanks.

    Read the article

  • why this sql not working?

    - by user295189
    I have a query public static function TestQuery( $start=0, $limit=0){ $sql = " SELECT count(*) AS total FROM db.table1 JOIN db.table2 ON table1.fieldID = {$fieldID} AND table2.assigned = 'N'"; $qry = new SQLQuery; $qry-query($sql); if($row = $qry-fetchRow()){ $total = intval($row-total); } return $total; } which works fine but when I add the limit as below, then it doesnt work and gives me errors public static function TestQuery( $start=0, $limit=0){ $sql = " SELECT count(*) AS total FROM db.table1 JOIN db.table2 ON table1.fieldID = {$fieldID} AND table2.assigned = 'N'"; //this fails if($recordlimit 0) $sql .= "LIMIT {$startRecord}, {$recordLimit} "; // $qry = new SQLQuery; $qry-query($sql); if($row = $qry-fetchRow()){ $total = intval($row-total); } return $total; } Any help will be appreciated

    Read the article

  • Codeigniter: Select from multiple tables

    - by Kevin Brown
    How can I select rows from two or more tables? I'm setting default fields for a form, and I need values from two tables... My current code reads: $this->CI->db->select('*'); $this->CI->db->from('user_profiles'); $this->CI->db->where('user_id' , $id); $user = $this->CI->db->get(); $user = $user->row_array(); $this->CI->validation->set_default_value($user);

    Read the article

  • how to automate upsizing from Access to SQL Server?

    - by Arne
    Hi, I need to automate the migration from an Access (2003) to an SQL Server DB (2005 or 2008). The upsizing should be done automatically as part of a build process. I need that because there are 2 versions of the software, a single user rich client and a web version. Access DB is used for single user to minimize setup effort, SQL Server to improve performance and scaling with many simultanious users. Access should be the "leading" DB, meaning devs do changes in Access DB and those are propagated to the SQL server within the build process. Many changes will occur, so doing it manually is not an option. I am new to the Microsoft world, so I dont know appropriate tools for that. What tools can I use and how? I know how to do it (by clicking) with the upsizing assistant. Perhaps I can automate that somehow? Thanks in advance for your answers. Cheers, Arne

    Read the article

  • PHP Doctrine frustration: loading models doesn't work..?

    - by ropstah
    I'm almost losing it, i really hope someone can help me out! I'm using Doctrine with CodeIgniter. Everything is setup correctly and works until I generate the classes and view the website. Fatal error: Class 'BaseObjecten' not found in /var/www/vhosts/domain.com/application/models/Objecten.php on line 13 I'm using the following bootstrapper (as CodeIgniter plugin): <?php // system/application/plugins/doctrine_pi.php // load Doctrine library require_once BASEPATH . '/plugins/Doctrine/lib/Doctrine.php'; // load database configuration from CodeIgniter require_once APPPATH.'/config/database.php'; // this will allow Doctrine to load Model classes automatically spl_autoload_register(array('Doctrine', 'autoload')); // we load our database connections into Doctrine_Manager // this loop allows us to use multiple connections later on foreach ($db as $connection_name => $db_values) { // first we must convert to dsn format $dsn = $db[$connection_name]['dbdriver'] . '://' . $db[$connection_name]['username'] . ':' . $db[$connection_name]['password']. '@' . $db[$connection_name]['hostname'] . '/' . $db[$connection_name]['database']; Doctrine_Manager::connection($dsn,$connection_name); } // CodeIgniter's Model class needs to be loaded require_once BASEPATH.'/libraries/Model.php'; // telling Doctrine where our models are located Doctrine::loadModels(APPPATH.'/models'); // (OPTIONAL) CONFIGURATION BELOW // this will allow us to use "mutators" Doctrine_Manager::getInstance()->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true); // this sets all table columns to notnull and unsigned (for ints) by default Doctrine_Manager::getInstance()->setAttribute( Doctrine::ATTR_DEFAULT_COLUMN_OPTIONS, array('notnull' => true, 'unsigned' => true)); // set the default primary key to be named 'id', integer, 4 bytes Doctrine_Manager::getInstance()->setAttribute( Doctrine::ATTR_DEFAULT_IDENTIFIER_OPTIONS, array('name' => 'id', 'type' => 'integer', 'length' => 4)); ?> Anyone? p.s. I also tried adding the following right after // (OPTIONAL CONFIGURATION) Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE); spl_autoload_register(array('Doctrine', 'modelsAutoload'));

    Read the article

  • SubSonic-based app that connects to multiple databases

    - by Fervelas
    Hello there, I currently developed an app that connects to SQL Server 2005 database, so my DAL objects where generated using information from that DB. It will also be possible to connect to an Oracle and MySQL db, all with the same table structures (aside from the normal differences in fields, such as varbinary(max) in SQL Server and BLOB in Oracle, and so on). For this purpose, I already defined multiple connection strings and multiple SubSonic providers for the different DB's the app will run on. My question is, if I generated my objects using a SQL Server database, should the generated objects work transparently with the other DB's or do I need to generate a different DAL for each database engine I use? Should I be aware of any possible bugs I may encounter while performing these operations? Thanks in advance for any advice on this issue.

    Read the article

  • Domain Keys, DKIM and Sendmail

    - by Daniel
    When I am using DomainKeys and DKIM together on a linux system, do I run both of them on the same port? DomainKeys: /usr/bin/dk-filter -l -p inet:8891@localhost -d example.com -s /var/db/ domainkeys/default.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Or do I do something like this: DomainKeys: /usr/bin/dk-filter -l -p inet:8892@localhost -d example.com -s /var/db/ domainkeys/mail1.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail2.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Just wondering since information about DomainKeys and DKIM tell you to run them on the same port: http://www.elandsys.com/resources/sendmail/domainkeys.html http://www.elandsys.com/resources/sendmail/dkim.html I want to run both of them together, is this a bad idea?

    Read the article

  • Source Controlled Database Data import strategies.

    - by H. Abraham Chavez
    So I've gotten a project and got the db team sold on source control for the db (weird right?) anyway, the db already exists, it is massive, and the application is very dependent on the data. The developers need up to three different flavors of the data to work against when writing SPROCs and so on. Obviously I could script out data inserts. But my question is what tools or strategies do you use to build a db from source control and populate it with multiple large sets of data?

    Read the article

  • Updating multiple tables at the same time in Linq-to-SQL

    - by kiran
    How do I update two tables at the same time using Linq-to-SQL? var z = from a in db.Products join b in db.ProductSubcategories on a.ProductSubcategoryID equals b.ProductSubcategoryID join d in db.ProductCategories on b.ProductCategoryID equals d.ProductCategoryID select new { ProductName = a.Name, ProductCategory = d.Name, ProductSubCategory = b.Name, Cost = a.StandardCost, discontinuedDate = a.DiscontinuedDate, ProductId=a.ProductID };

    Read the article

  • How to dynamically choose two fields from a Linq query as a result

    - by Dr. Zim
    If you have a simple Linq query like: var result = from record in db.Customer select new { Text = record.Name, Value = record.ID.ToString() }; which is returning an object that can be mapped to a Drop Down List, is it possible to dynamically specify which fields map to Text and Value? Of course, you could do a big case (switch) statement, then code each Linq query separately but this isn't very elegant. What would be nice would be something like: (pseudo code) var myTextField = db.Customer["Name"]; // Could be an enumeration?? var myValueField = db.Customer["ID"]; // Idea: choose the field outside the query var result = from record in db.Customer select new { Text = myTextField, Value = myValueField };

    Read the article

  • Null Reference Exception In LINQ DataContext

    - by Frank
    I have a Null Reference Exception Caused by this code: var recentOrderers = (from p in db.CMS where p.ODR_DATE > DateTime.Today - new TimeSpan(60, 0, 0, 0) select p.SOLDNUM).Distinct(); result = (from p in db.CMS where p.ORDER_ST2 == "SH" && p.ODR_DATE > DateTime.Today - new TimeSpan(365, 0, 0, 0) && p.ODR_DATE < DateTime.Today - new TimeSpan(60, 0, 0, 0) && !(recentOrderers.Contains(p.SOLDNUM))/**/ select p.SOLDNUM).Distinct().Count(); result is of double type. When I comment out: !(recentOrderers.Contains(p.SOLDNUM)) The code runs fine. I have verified that recentOrderers is not null, and when I run: if(recentOrderes.Contains(0)) return; Execution follows this path and returns. Not sure what is going on, since I use similar code above it: var m = (from p in db.CMS where p.ORDER_ST2 == "SH" select p.SOLDNUM).Distinct(); double result = (from p in db.CUST join r in db.DEMGRAPH on p.CUSTNUM equals r.CUSTNUM where p.CTYPE3 == "cmh" && !(m.Contains(p.CUSTNUM)) && r.ColNEWMEMBERDAT.Value.Year > 1900 select p.CUSTNUM).Distinct().Count(); which also runs flawlessly. After noting the similarity, can anyone help? Thanks in advance. -Frank GTP, Inc.

    Read the article

  • PHP gallery, thumbnail listing

    - by Benjamin
    Hi everyone, I am planning a dynamic PHP photo gallery and having difficulty deciding on the best way to display the thumbnails after they have been retrieved via MySQL. I considered using an inline unordered list but this resulted in the thumbs being stacked one on top of the other (touching). Also tried a table but not sure how I would start the next row after x number of thumbnails. Any suggestions on page layout for this purpose? I will be using Lightbox to cycle through the photos themselves, that isn't the issue. Also, would a while() loop be best for fetching the list of thumbs and inserting the appropriate HTML? Thanks! -Ben

    Read the article

  • Tools, scripts for working with SQL Server 2008

    - by hgulyan
    Hi, While working with DB, I find useful using some tools, that help me to solve DB problems. Some of them are: 1) Insert generator 2) A tool that can execute a script on a list of DB's 3) Finding a text in stored procedures and functions. 4) DB Back up scripts My question is, what are most useful tools, scripts(anything else), that help you to work with SQL Server? Thanks in advance. UPDATE I assume, there are no other tools for SQL Server 2008 or any other version?

    Read the article

  • when I click submit it should change the text and update the row something is wrong there

    - by Yousef Altaf
    good morning programers, I have this small code which content a news control panel and I made a submit button there to active or inactive the news row so if I click on this button it should change if it's active it will be inactive it worked but there's something wrong there when I click on item one it updates the last on the table not the first on as it should do. here is the code that I use <?php $getNewsData="select * from news"; $QgetNewsData=$db->query($getNewsData)or die($db->error); $count=mysqli_num_rows($QgetNewsData); while($newsRow = mysqli_fetch_array($QgetNewsData)) { $getActivityStatus=$newsRow['news_activity']; switch($getActivityStatus){ case 1: echo"<input style='color:red; font-weight:bold; background:none; border:0;' name='inactive' type='submit' value='?????' /><input name='inActive' type='hidden' value='".$newsRow['news_id']."'/>"; break; case 0: echo"<input style='color:green; font-weight:bold; background:none; border:0;' name='active' type='submit' value='?????' /><input name='Active' type='hidden' value='".$newsRow['news_id']."'/>"; break;} } if(isset($_POST['inactive'])){ $inActive=$_POST['inActive']; echo $inActive; $updateStatus="UPDATE news SET news_activity=0 WHERE news_id='".$inActive."' "; $QupdateStatus=$db->query($updateStatus)or die($db->error); if($QupdateStatus){ } } if(isset($_POST['active'])){ $Active=$_POST['Active']; echo $Active; $updateStatus="UPDATE news SET news_activity=1 WHERE news_id='".$Active."' "; $QupdateStatus=$db->query($updateStatus)or die($db->error); if($QupdateStatus){ header("Location:CpanelHome.php?id=7"); } } ?> please any idea to solve this problem. Thanks, regards

    Read the article

  • Calling ADODB inside a function?

    - by David
    Hi, I'm wondering why when i put an sql ADODB query in side a function it produces the following error: Fatal error: Call to a member function Execute() on a non-object in -path to script- My function is something like: $dsn = 'mysql://user:pass@localhost/db'; $db = ADONewConnection($dsn); function getem($q){ $r=$db->Execute($q); return $r->RecordCount(); } echo getem("select * from table"); Any ideas how to fix that?

    Read the article

  • Linq-to-SQL: How to perform a count on a sub-select

    - by Peter Bridger
    I'm still trying to get my head round how to use LINQ-to-SQL correctly, rather than just writing my own sprocs. In the code belong a userId is passed into the method, then LINQ uses this to get all rows from the GroupTable tables matching the userId. The primary key of the GroupUser table is GroupUserId, which is a foreign key in the Group table. /// <summary> /// Return summary details about the groups a user belongs to /// </summary> /// <param name="userId"></param> /// <returns></returns> public List<Group> GroupsForUser(int userId) { DataAccess.KINv2DataContext db = new DataAccess.KINv2DataContext(); List<Group> groups = new List<Group>(); groups = (from g in db.Groups join gu in db.GroupUsers on g.GroupId equals gu.GroupId where g.Active == true && gu.UserId == userId select new Group { Name = g.Name, CreatedOn = g.CreatedOn }).ToList<Group>(); return groups; } } This works fine, but I'd also like to return the total number of Users who are in a group and also the total number of Contacts that fall under ownership of the group. Pseudo code ahoy! /// <summary> /// Return summary details about the groups a user belongs to /// </summary> /// <param name="userId"></param> /// <returns></returns> public List<Group> GroupsForUser(int userId) { DataAccess.KINv2DataContext db = new DataAccess.KINv2DataContext(); List<Group> groups = new List<Group>(); groups = (from g in db.Groups join gu in db.GroupUsers on g.GroupId equals gu.GroupId where g.Active == true && gu.UserId == userId select new Group { Name = g.Name, CreatedOn = g.CreatedOn, // ### This is the SQL I would write to get the data I want ### MemberCount = ( SELECT COUNT(*) FROM GroupUser AS GU WHERE GU.GroupId = g.GroupId ), ContactCount = ( SELECT COUNT(*) FROM Contact AS C WHERE C.OwnerGroupId = g.GroupId ) // ### End of extra code ### }).ToList<Group>(); return groups; } }

    Read the article

  • Best ORM, Simple data Structures, Strong Query analysis.

    - by sayth
    What is the best ORM db combination for simple data structures. That is data that contains names as identifiers and locations, but whose main interaction will be numerical data for times(sports durations), and currency related data. I initially want to create a sports data base that will take names and statistics. Secondarily I plan to start into an investment and stock analysis db. Which ORM suits storing many numerical types and have strong query functions? I really am not biased to db engine (most likely use sqlite or mongo) so any suggestions to best network less db server to suit said ORM appreciated.

    Read the article

  • Reading a string in TASM x86 assembly

    - by I_S_W
    hi all , i am trying to read a string from user in TASM assembly , i know i need a buffer to hold the input , max. length and actual length , but i seem to forgot how exactly we declare a buffer my attempt was smth like this Buffer db 80 ;max length db ? ;actual length db 80 dup(0);i think here is my problem but can't remember the right format Thanks in advance

    Read the article

  • using JdcbTemplate standalone

    - by Flyhard
    Hi We are looking into using the JdbcTemplate for accessing the DB - but we have many different DB-connections, that each class could use, so injecting the jdbcTemplate is not an option atm. So if we do a jdbcTemplate = new JdbcTemplate(dataSource); what will the transaction policy be? Auto-commit is off in the DB.

    Read the article

  • How can I block based on URL (from address bar) in a safari extension

    - by PerilousApricot
    I'm trying to write an extension that will block access to (configurable) list of URLs if they are accessed more than N times per hour. From what I understand, I need to have a start script pass a "should I load this" message to a global HTML page (who can access the settings object to get the list of URLs), who will give a thumbs up/thumbs down message back to the start script to deny/allow loading. That works out fine for me, but when I use the usual beforeLoad/canLoad handlers, I get messages for all the sub-items that need to be loaded (images/etc..), which screws up the #accesses/hour limit I'm trying to make. Is there a way to synchronously pass messages back and forth between the two sandboxes so I can tell the global HTML page, "this is the URL in the window bar and the timestamp for when this request came in", so I can limit duplicate requests? Thanks!

    Read the article

  • ObjectContext ConnectionString Sqlite

    - by codegarten
    I need to connect to a database in Sqlite so i downloaded and installed System.Data.SQLite and with the designer dragged all my tables. The designer created a .cs file with public class Entities : ObjectContext and 3 constructors: 1st public Entities() : base("name=Entities", "Entities") this one load the connection string from App.config and works fine. App.config <connectionStrings> <add name="Entities" connectionString="metadata=res://*/Db.TracModel.csdl|res://*/Db.TracModel.ssdl|res://*/Db.TracModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=C:\Users\Filipe\Desktop\trac.db&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> 2nd public Entities(string connectionString) : base(connectionString, "Entities") 3rd public Entities(EntityConnection connection) : base(connection, "Entities") Here is the problem, i already tried n configuration, already used EntityConnectionStringBuilder to make the connection string with no luck. Can you please point me in the right direction!? EDIT(1) How can i construct a valid connection string?!

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >