1. an endless loop of Csharp.Frustration[s]

    Date: 11/22/07 (Web Development)    Keywords: database, asp, security, web, shopping

    Hi all,

    I'll write my C# frustrations here...Note that this is for an assignment, so there is no need to worry about security issues and all those other wonderful things. I would ask my professor, but he's a programmer...and he's horrible at getting his thoughts across.

    I created a web form that allows users to choose a certain amount of a product they want, and afterwards, it all gets confirmed and a message shows up saying the conversion was completed (even though it wasn't...not yet anyway)

    Please note that I am NOT looking for code answers just to copy and paste. I would like the theory of how I should go about solving this - since most websites just give you a basic understanding of how try/catch works.

    Problem 1: How do I implement the "try", "catch", "finally" exception if a user picks the same product and quantity twice? I already have an if-statement that keeps track of what has been chosen in the user's session. Would the try/catch go into that if-statement?

    Problem 2: What if the user decides to first order 3 items of a product, then decides to order more? How would I input this into the "try", "catch", "finally"? I have an if-statement that keeps track of whether the quantity has been "trimmed" or not.

    Problem 3: Do I need a database connection command in that particular web page to determine how much of a product has been chosen and how much is available to other users?

    Problem 4: Confirmation e-mail. I understand the whole idea of "using System.Net;" for email, but how would I go about implementing code to get an e-mail application started? (This problem/question is seperate from the code below)


    Here's my code for the different problems 1 - 3:





    protected void btnOrder_Click(object sender, EventArgs e)
    {
    //Check for Shoppingcart object
    // Create first if not there

    if (Session["cart"] == null)
    {
    Session["cart"] = new ShoppingCart();
    int quantity = 0;
    }

    // make sure there is text
    if (txtQuantity.Text.Trim().Length != 0)
    {
    // try to convert text to int ???
    int quantity = int.Parse(txtQuantity.Text);
    // check for this item in the cart
    // Note this only makes sense if the "cart" exists
    // since it checks for an individual item in the cart
    if (((ShoppingCart)Session["cart"]).
    keyExists(int.Parse(TextBox1.Text)))
    {
    //throw new Exception("Item already in cart - fix this");

    Response.Write("Item already exists in cart. What do you want to do?");
    // Message to user that product is already in the order


    ///AND this is where my problems start:
    /*try
    {

    Response.Write("Item already exists, what do you want to do?");
    }

    catch (ArgumentException de)
    {
    ShoppingCart;
    }

    finally
    {
    Console.WriteLine("Finally Block");
    }
    * */
    ///END of one set of problems (sorry for intending issues)

    }
    if ((txtQuantity.Text.Trim().Length != 0)) // This is a new item
    {
    //Response.Write("Please choose the quantity");
    OrderItem item = new OrderItem(
    int.Parse(TextBox1.Text), TextBox2.Text,
    double.Parse(TextBox6.Text),
    int.Parse(txtQuantity.Text));
    ((ShoppingCart)Session["cart"]).addToCart(item);
    Response.Write("Item added successfully!");
    Server.Transfer("CatalogDisplay.aspx");

    }
    else
    {
    // Make the item
    OrderItem item = new OrderItem(
    int.Parse(TextBox1.Text), TextBox2.Text,
    double.Parse(TextBox6.Text),
    int.Parse(txtQuantity.Text));
    // add to cart
    ((ShoppingCart)Session["cart"]).addToCart(item);

    ///////////////////////////////not sure what the next part does

    // How to make this work ??
    // Who is the sender ?
    // What are the System.EventArgs ?
    this.btnReturn_Click(sender, e);

    //////////end of "not sure"
    }
    else
    {
    //Basically if the quantity field is empty, you can't move on to the Order page.
    Response.Write("Nothing Ordered
    You must order some of the product or return to the Catalog");
    }




    Database reference: Northwind.mdb

    Source: http://community.livejournal.com/webdev/449890.html

  2. trouble with css

    Date: 11/25/07 (WebDesign)    Keywords: css, database

    I want to have an array of databased results display in rows...

    [pic] [pic] [pic]

    [pic] [pic] [pic]

    [pic] [pic] [pic]

    ...

    and not..


    [pic]
    [pic]
    [pic]
    [pic]
    [pic]
    [pic]
    ...

    My trouble is that without formatting, results show like example 2.
    I've been able to create this by using tables, however like many I'm not a fan of tables and want to use css to accomplish this.

    Help, ideas?

    Thanks,

    Source: http://community.livejournal.com/webdesign/1333818.html

  3. MySQL SQL Delete Notes

    Date: 11/27/07 (Java Web)    Keywords: mysql, database, sql

    To delete duplicates from a MySQL database table I normally copy the duplicate data first to a temporary table and then use the copied id’s to delete from the original table. Delete using the temporary can take two forms. First is the slow way: delete from target where id in (select id from temp); This can be [...]

    Source: http://blog.taragana.com/index.php/archive/mysql-sql-delete-notes/

  4. Blist - A Flex database/spreadsheet in the cloud

    Date: 11/29/07 (Data Management)    Keywords: database, web

    A little while ago Mark Hendrickson posted about Blist [Screenshot Gallery] on TechCrunch. He described it as a web-based database application and gave it a pretty good review. The Blist team is up here in Seattle and they are one of my favorite startups. As a result, when I saw...

    Source: http://blogs.zdnet.com/Stewart/?p=648

  5. I could use some input on SQL Server DBA vs. Developer tasks

    Date: 12/03/07 (SQL Server)    Keywords: database, sql

    I'd like input on what is considered SQL Server developer tasks vs. SQL Server DBA tasks. I know there's a lot of overlap and would like to identify which task truly falls into which bucket and which tasks truly apply to both.



    I'm a bit "stuck between a rock and a hard place," SQL Server-wise. I've done a lot of database design, creation, administering, writing complex ANSI SQL and T-SQL and the like in Access since 1994 (when you didn't get fluffy cute wizards to help you and had to learn to program and normalize data and plan db's the hard way!) :-p

    I now have a little over 3 yrs experience in SQL Server (v.2000 and 2005). Unfortunately, both places where I did SQL work did not allow for me to get into the fun developer tasks (barely had the chance to work with or edit stored procedures or do any real performance tuning or query optimization).

    I did get to do a lot of complex T-SQL coding, including detailed CASE statements. I did various tasks that fall under ETL (importing flat files, spreadsheets, cleaning the data, pulling random samples) as well as Decision Support (pulling a variety of counts and other aggregate data post-project for the Project Managers and Exec. Mgmt).

    My goal is to get the new 2005 version of the MCDBA certification and be a 2005 SQL Developer. It's a bit hard to get in anywhere except as a SQL Server Analyst at the moment. Any advice in that area would be appreciated.

    Source: http://community.livejournal.com/sqlserver/65221.html

  6. OpenOffice plugs code execution vulnerability

    Date: 12/05/07 (Data Management)    Keywords: database, java

    OpenOffice.org has patched a highly critical code execution vulnerability that could allow an attacker to take control of a system. Every OpenOffice release prior to 2.3.1 is affected. According to OpenOffice, "users opening specially crafted database documents may allow attackers to execute arbitrary static Java code." ...

    Source: http://blogs.zdnet.com/security/?p=718

  7. lost in Csharp.translation(again)

    Date: 12/07/07 (Web Development)    Keywords: database, sql

    How do I get a datareader to compare a number entered in a text box with the information in a database? I have the datareader connected, but I think the problem may lie in my SQL statement: here's the whole code:


    Session.Add("Quantity", txtQuantity.Text);
    //Adds the info in txtQuantity.Text to a session, for later use.
    //there is already an exception that checks if a user entered a number or letter
    //...no worries there.
    OleDbConnection conn = new
    OleDbConnection((string)Application["DBConnectionString"]);
    OleDbDataReader qdr = null;
    //the value of qdr is originally null, will get filled later.
    // Query string concatenates fixed text with the user's selection
    string qtyString = "SELECT Products.UnitsInStock " + "FROM Products " + "WHERE Products.UnitInStock ="; //+ //int.Parse(Session["Quantity"].ToString());
    // OleDbDataAdapter da = new OleDbDataAdapter();
    OleDbCommand cm = new OleDbCommand(qtyString, conn);
    conn.Open();
    qdr = cm.ExecuteReader();
    //Since I have a "where Products.UnitInstock =", I get an error that qdr is still null.
    /*I suspect my comparison would go somewhere here, but I am unsure how to write a comparison of a textbox value to qtyString (or if there is another better way of comparing the two. */
    qdr.Close();
    conn.Close();
    thanks :). PS formatting sucks cos I disabled the richtext editor.

    Source: http://community.livejournal.com/webdev/451053.html

  8. mail

    Date: 12/09/07 (PHP Community)    Keywords: rss, database

    My mail script has gotten rather long and complex, so I'd like to move the code off of each page that requires an email to be sent.
    I've thought about using an include, but I want something cleaner. My emails are a standard template, just notification that a change has been made. The only difference is who the email gets sent to.
    This is where my novice will show ... what I want is the ability to put just one line on the page something like ...

    
    mail2user($emailaddress) 
    

    I'd pull the email address from my database as the script runs and the "mail2user" would know to pass the $emailaddrss variable to that "function"???

    Is this possible?

    Source: http://community.livejournal.com/php/602053.html

  9. US-CERT warns of Microsoft Access Database attacks

    Date: 12/12/07 (Data Management)    Keywords: software, database, microsoft

    On the same day Microsoft issued fixes for at least 11 Windows software flaws, the U.S. Computer Emergency Response Team (US-CERT) warned that hackers were using malicious Microsoft Access databases to launch attacks against unknown targets. According to a US-CERT alert, the attacks are using an unpatched...

    Source: http://blogs.zdnet.com/security/?p=738

  10. IBM sues Informix for patent infringement

    Date: 02/08/00 (Data Management)    Keywords: software, technology, database

    IBM claims that software maker Informix is using technology that IBM has patented in at least five of its database products, including its Informix-Online Dynamic Server. IBM has sued database software maker Informix, accusing its rival of infringing on six of its database patents....

    Source: http://news.zdnet.com/2100-9595_22-236666.html

  11. XML parsing woes...

    Date: 12/15/07 (PHP Community)    Keywords: php, mysql, xml, database, sql

    Okay, so while I'm relatively good with PHP, I'm not so good with PHP 4's XML handling, and I'm having some problems creating an XML parser that will read tag attributes (which I'm then putting into a MySQL database).

    I've tried a half-dozen different examples of parsers that others have done, and none seem able to pull the attributes out. I have no say in how it's structured, so I have to find a way to deal with it as is. My XML looks something like this:



       
          
             <br />            Blah blah blah...<br />         
             
                Big long description goes here.
             

             
                0000-00-00T00:00:00-0500
             

          

       




    Everything else parses fine, except those damn description attributes. They seem to just disappear into the ether.

    Anyone know of an easy way (outside of PHP 5, not an option in this situation) that I can get the info I need?

    Source: http://community.livejournal.com/php/603991.html

  12. How To Truly Delete Pages in MODx

    Date: 12/16/07 (Java Web)    Keywords: database, web

    MODx is an excellent AJAX enabled content management system, which is leagues ahead of Joomla / Mambo. One of the features of MODx is that pages aren’t fully deleted. They are marked as deleted (displayed as strike-through items) and they are not displayed on the web. However they still remain in the database. This is [...]

    Source: http://blog.taragana.com/index.php/archive/how-to-truly-delete-pages-in-modx/

  13. random text

    Date: 12/17/07 (PHP Community)    Keywords: database, sql, web

    I have 15 random paragraphs of text, each a couple sentences long, nothing major. I want to display a random one on the main page of a website every time the page loads. I am not terribly concerned with the flexibility or expandability of this script, I just don't want it to slow anything else down... I once took down a sql server because I had way too many queries on a web page, and since then I've been a little paranoid about using tons of database-driven stuff. Then again if I just hard-code all the text into the script, my 500 byte script or whatever will be 10x the size it once was, since it'll have to load all the text.

    Source: http://community.livejournal.com/php/604385.html

  14. HanDBase 4.0 mobile database application released with major updates

    Date: 12/18/07 (Data Management)    Keywords: database

    I occasionaly use database applications on my mobile devices, primarily for tracking my paid time off and for making gift lists. Many enterprise users need a database program that provides lots of functionality and that works with desktop solutions like Access (bi-directional conduit support in HanDBase). One of the most...

    Source: http://blogs.zdnet.com/mobile-gadgeteer/?p=744

  15. IBM buys database software firm Solid Information

    Date: 12/21/07 (Data Management)    Keywords: software, technology, database

    Deal expected to close in early 2008; financial details not disclosed. International Business Machines said on Friday it has agreed to buy in-memory database software provider Solid Information Technology from private owners for an undisclosed sum. Solid's largest owners were private equity firms Apax Partners and CapMan. ...

    Source: http://news.zdnet.com/2110-3513_22-6223858.html

  16. FBI aims for world's largest biometrics database

    Date: 12/22/07 (Security)    Keywords: database

    Agency has already started compiling data to be used in the planned $1 billion project, according to a report. The FBI is embarking on a $1 billion project to build the world's largest computer database of biometrics to give the government more ways to identify people at home...

    Source: http://news.zdnet.com/2100-1009_22-6223876.html

  17. Developer-friendly Hosting?

    Date: 12/22/07 (PHP Community)    Keywords: php, programming, mysql, software, database, sql, postgresql, web, hosting

    Hello Friends

    I am interested in exploring web programming via Lisp, Ruby on Rails, and several of the popular Python frameworks.

    Here are the features I am interested in:

    * Lisp hosting including access to web servers and/or mod_lisp
    * Ruby on Rails hosting
    * Python hosting
    * Configurable source control repository with public and private areas (SVN/Trac or better)
    * SSH access
    * MySQL or PostgreSQL database
    * PHP support (for third-party software packages)

    Has anyone here had similar needs? Would you recommend any particular hosting solution?

    Thanks,
    '[info]'jkndrkn

    Source: http://community.livejournal.com/php/605765.html

  18. How To Fix Postfix Warning: dict_nis_init: NIS domain name not set - NIS lookups disabled

    Date: 12/25/07 (Java Web)    Keywords: database

    First of I didn’t ask postfix to do NIS lookups. These warning messages started showing up when I commented out alias_maps and decided to only use alias_database instead. The fix was simple. alias_maps when commented, uses the default settings: alias_maps = hash:/etc/aliases, nis:mail.aliases This allows postfix to work even without explicit alias_maps settings. However the default also encumbers [...]

    Source: http://blog.taragana.com/index.php/archive/how-to-fix-postfix-warning-dict_nis_init-nis-domain-name-not-set-nis-lookups-disabled/

  19. .NET Remoting on port 80 -- reasonable?

    Date: 12/29/07 (C Sharp)    Keywords: software, xml, database, asp, web, linux, hosting, microsoft

    All,

    As those of us who have worked with attempting to make any logically partitioned/layered OO schema work between .NET client applications and WebServices know, it's simply not possible without going far out of your way to do a lot of extra work that the elegant OO inheritance/extension was supposed to alleviate anyway. When I am especially irked about this issue, I will construct job interviews with the following two questions spaced one after the other:

    n) Do you consider yourself a fully object-oriented developer, familliar with the concepts of inheritance, extension, abstract classes, interfaces, with the ability to both understand and work with the boundaries/"layers"/"tiers" between classes for a given software project (e.g. Database/Business Objects/User Interface)?

    m) If so, what do you consider the most effective way to transmit an instance or instances of a business object from one .NET application to another (either client -> server or server -> client)?

    The answers are invariably n) Absolutely, yes, I am God's gift to rational software development; and m) [whirr-clunk as Microsoft gears engage within brain] Using disconnected System.Data.DataSets since they're already XmlSerializable!

    Always gives me a laugh. Nevermind that employing such an approach basically necessitates the creation of a FOURTH boundary/"layer"/"tier" -- call it Middleware, or specifically in this hideous world, Serialization/Deserialization.

    Anyway, on to my question!

    Due to the headaches raised by the above subject, and the deeper object replication that goes on using .NET Remoting (e.g. regardless of what is actually transmitted down the wire, you get a complete, functional, fully type-specific object with its public/private members/properties/methods intact, with NO Reference.cs or any other whiz-bang class-redefinition machinery thrown in your face), I come upon a quandary.

    In my mind, at least up til the present moment, .NET Remoting is great for applications over whose general operational control you or your company or your trusted partner will maintain for the lifecycle of said application. With this kind of organizational scenario, routers and firewalls are generally surmountable, or at least negotiable, obstacles, since you know exactly from which machine(s) or subnet(s) certain TCP packets will be sent, and exactly to which machine(s) or subnet(s) those packets will be transmitted, and on what TCP port(s).

    .NET WebServices, on the other hand, are a better choice for software with an eventual goal of wider distribution to CUSTOMERS rather than colleagues or partners -- entities whose firewalls you do not control, and who will regard something as little as a request as to its status wrt your application's performance as reflecting an incredibly unprofessional design. In other words, it's not much of a limit to place on your customers that they can transmit HTTP over port 80, and/or HTTPS over port 443.

    But, as I finish up the previous 4 hours of banging my head into various WebService-related walls attempting to get class instances (or even just their public data -- I know how WebServices work and I understand it's for good reason) to replicate, I have to wonder -- what kinds of problems might there be lurking in, say, a widespread commercial application, some of whose clients employ .NET Remoting to communicate with their remote servers using TCP port 80? I don't see any particular *TECHNICAL* problems that are unsurmountable -- obviously, as usage scales, there will be more of a hassle doing load-balancing types of activities compared to, say, turning on IIS clustering and walking away. But that's a problem that is entirely out-of-scope for me -- if I get there with the subject of this question, and it's my biggest problem, I will be very happy.

    Anyone consider or try this in a relatively large/Enterprise-level "ASP" (in its original disambiguation, that is, an Application Service Provider hosting the requests of potentially hundreds or thousands or more clients) environment? I pulled the better part of a decade as a systems/network admin and general TCP/IP geek (UNIX/Linux), so I know that, at least as of ~2003, you couldn't tell your router (unless it had more processors than most mainstream servers in 2007) to ONLY allow traffic fitting the profile of HTTP requests out on port 80. So I don't really see any technical problems.

    However, any feedback is welcome. Thanks for reading this -- my fingers tend to run away from me. :)

    Source: http://community.livejournal.com/csharp/90393.html

  20. checking compatibility level

    Date: 01/03/08 (SQL Server)    Keywords: database, sql

    Is there any way to simply check what the compatibility level is on a database without changing it in SQL Server 2005?

    Everything I've found points to sp_dbcmptlevel, which will not simply return the level the database is currently at, it requires you to enter a value to change it to. I need to return the current compatibility level, not write over it.

    Source: http://community.livejournal.com/sqlserver/65674.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home