Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

richiemac

@richiemac
About
Posts
84
Topics
38
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL Join problem!
    R richiemac

    Thanks Eric! It worked a treat. I really didn't know it would be that simple. Thanks again!

    Database help database question

  • SQL Join problem!
    R richiemac

    Hi all, Here's the problem... I've got two tables, trains and trainarrivals. Each train has a link to two arrivals records. The first link is to the previous arrival record and the d=second is to the next arrivals record. I'm trying to join the tables using, select * from train LEFT OUTER JOIN trainarrivals ON train.PreviousArrival = trainarrivals.UniqueID OR train.NextArrival = trainarrivals.UniqueID ORDER BY train.UniqueID so that when i get the trains with their arrivals links I will get one row for each train. Due to the fact that the next and previous arrivals are separate records in the trainarrivals table I get two records for each train. My question is, is there any way to do this so I get only one record with both the next and previous arrival data together. Thanks for the help in advance. Rich

    Database help database question

  • Escaping quotes in XML
    R richiemac

    Cheers my friend! Got it working - eventually. Again thanks for the help. Rich

    XML / XSL question csharp database mysql xml

  • Escaping quotes in XML
    R richiemac

    Config files are used because the app has to have the ability to read any appropriate config and use the query string. Users can therefore add new config files that will be read. At this time the query could be anything so I therefore wouldn't use stored procs. Plus using stored procs now would mean major changes that time doesn't allow for. The DateTime.Now.ToShortTimeString() is a .net System statement that I'm trying to concatenate into the query string that is read from the config. If I can't do it in this way is there anyway aroud this without having to make big changes?

    XML / XSL question csharp database mysql xml

  • Escaping quotes in XML
    R richiemac

    Ok let me explain. The string is an sql query that is stored in an xml config file. The DateTime stuff is so i can check the database for records within a certain time frame. I am getting the string from the config file and trying to use concatenation to get the current time - the config will be called at different times and only wants values from the database for the next hour. If I hard code the string in the IDE, e.g. string sqlStr = "..."; then all works fine. The problem arises when I get the stored string from config. The reason I'm storing the string in config is because there are many different queries that depend on certain other aspects. The config thing needs to stay in place so I have to get it working this way (if possible). Hope this clears up the confusion. Rich

    XML / XSL question csharp database mysql xml

  • Escaping quotes in XML
    R richiemac

    Hi Not sure if this a question for XML, SQL or .Net forum but here goes. I have an XML file with a number of elements, one of which is,

    select * from trainarrivals where ActiveFlag = 1 and DueTime between ('" + DateTime.Now.ToShortTimeString() + "') and ('" + (DateTime.Now.AddHours(1).ToShortTimeString()) + "')

    I am using a C# application to read the file and connect to a MySql database. When I get this element the environment adds escape characters to the string so it looks like,

    select * from trainarrivals where ActiveFlag = 1 and DueTime between ('\" + DateTime.Now.ToShortTimeString() + \"') and ('\" + (DateTime.Now.AddHours(1).ToShortTimeString()) + \"')

    This in turn causes an exception in my code being thrown. My question is, how can I write the xml file so the ( " ) is treated as such or change the string when it is read? Thanks in advance and appologies if this is the wrong place!

    XML / XSL question csharp database mysql xml

  • XSD code generation problems!
    R richiemac

    ... or is there a tool around that will parse the .cs file for classes and create separate files. I don't how easy it is to do this but wouldn't feel conficent of doing it mysel. :)

    XML / XSL csharp ai-coding help question

  • XSD code generation problems!
    R richiemac

    Hi all, I'm trying to use the xsd.exe to generate some c# classes. I don't have a problem with creating the classes, however, they are all generated in the same file. My question is, can I set the tool so that it creates these classes in separate .cs files or is there another freely available tool that can do the same thing. thanks in advance guys. rich

    XML / XSL csharp ai-coding help question

  • .net Atlas project problems!!
    R richiemac

    Ahhh! That seems to have sorted out the problem with inheritance that I was having. You're one step ahead of me. :-) Nice one buddy!

    ASP.NET csharp javascript sysadmin help

  • .net Atlas project problems!!
    R richiemac

    What an idiot I am!! I knew it would be something trivial. :-O As for the Web vs Sys situation. How can I find out what version is being used so I know which to use. Oh and thanks for the help dude.

    ASP.NET csharp javascript sysadmin help

  • .net Atlas project problems!!
    R richiemac

    Hi all, I've been looking through some simple Atlas samples but can't seem to get anything up and running. Heres the code (hopefully someone can help me out). I have a .aspx page which simply displays a message on a button click. The two errors are highlighted below. The first states i need a ';' and the second tells me that AtlasBook is undefined.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestAtlasNamespace.aspx.cs" Inherits="TestAtlasNamespace" %>

        Untitled Page
        // <!CDATA\[
    
            function Button1\_onclick() {
                <b>var testCar = new AtlasBook.Car('Honda', 'Pilot', '2005');</b>
                alert(testCar.getMakeandModel());
                alert(testCar.getYear());
                return false;
            }
    
        // \]\]>
        
    
    
        
    
        <div>
            <atlas:ScriptManager ID="ScriptManager1" runat="server">
            </atlas:ScriptManager>
            
        </div>
    

    Here's the javascript file,

    // JScript File

    Type.registerNamespace("AtlasBook");
    AtlasBook.Car = funtion(strMake, strModel, strYear) {
    var m_Make = strMake;
    var m_Model = strModel;
    var m_Year = strYear;

    this.getMake = function() {
        return m\_Make;
    }
    
    this.getModel = function() {
        return m\_Model;
    }
    
    this.getYear = function() {
        return m\_Year;
    }
    
    this.getMakeandModel = function() {
        return m\_Make + ' ' + m\_Model;
    }
    
    this.dispose = function() {
        alert('bye ' + this.getName());
    }
    

    }
    Type.registerClass('AtlasBook.Car', null, Web.IDisposable);

    Thanks in advance for any help. I hope I made sense! :confused:

    ASP.NET csharp javascript sysadmin help

  • where not exists problem!
    R richiemac

    Thanks for the help Eric. I'm finally getting somewhere! Thanks again buddy!

    Database help database mysql sysadmin question

  • where not exists problem!
    R richiemac

    i'm not trying to insert duplicate records i am 'trying' to do the opposite. The '?' act sort of like tags so that the actual values can be put in later. The problem is definately not here as this works fine until i use the exist condition. I'm trying to use the exist to check for records as to not add duplicates. I have solved the problem in the web page that I'm using but was just trying to solve the problem at the database level thus making it more reliable. As the error message is quite obviously pointing to the sql statement, and the fact that a simple insert statement is working completely okay, then I am taking for granted that the problem occurs when i add the 'where not exists' condition. I was therefore just trying to get help with writing these kinds of sql statement. :)

    Database help database mysql sysadmin question

  • where not exists problem!
    R richiemac

    Hi all, i'm trying to build a SQL statement, commStr = "insert into mytable values(default,?number,?text,?date) " + "select * from mytable " + "where not exists(select * from mytable where int_field = '" + System.Convert.ToInt32(TextBox1.Text) + "')"; and I keep getting the following error System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MySql.Data.MySqlClient.MySqlException: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from mytable where not exists(select * from mytable where int_field = '' at line 1 at MySql.Data.MySqlClient.PacketReader.CheckForError() at MySql.Data.MySqlClient.PacketReader.ReadHeader() at MySql.Data.MySqlClient.PacketReader.OpenPacket() at MySql.Data.MySqlClient.NativeDriver.Prepare(String sql, String[] parmNames) at MySql.Data.MySqlClient.MySqlCommand.Prepare() at Service.InsertDB(String insStr, String connStr, Int32 inInt, String inText, String inDate) the SQL string that is being passed looks like insert into mytable values(default,?number,?text,?date) select * from mytable where not exists(select * from mytable where int_field = '20') What I'm trying to do is check that the entry is not already present in the database before i insert it. Some help I'm going mad with this. Thanks in advance.

    Database help database mysql sysadmin question

  • Exception when reading xml file???
    R richiemac

    Got it now. Knew it would be simple.:doh:

    XML / XSL csharp xml question

  • Exception when reading xml file???
    R richiemac

    Hi all, I'm trying to read a file wuth C#. The file contains the following: Microsoft Mary 100 0 and the code to read is: voice_reader.Read(); voice_reader.ReadStartElement("voice_config"); voice_reader.ReadStartElement("voice_type"); m_voice = voice_reader.ReadString(); voice_reader.ReadEndElement(); voice_reader.ReadStartElement("voice_volume"); m_volume = voice_reader.ReadContentAsInt(); voice_reader.ReadEndElement(); voice_reader.ReadStartElement("voice_rate"); m_rate = voice_reader.ReadContentAsInt(); voice_reader.ReadEndElement(); voice_reader.ReadEndElement(); I'm getting the following exception thrown: Exception : Unexpected XML Declaration. The XML Declaration should be the first node in the document, and no whitespace characters are allowed to appear before it, Line 1 position 100

    XML / XSL csharp xml question

  • Passing data from a form???
    R richiemac

    I've used the ShowDialog method with properties and it works fine. Knew it would be fairly straight forward - just not for me. :rolleyes:

    C# question

  • Passing data from a form???
    R richiemac

    Hi guys, I've got a form that has a number of textboxes. When a button is clicked I want the data in the boxes to be sent to the class that opened the form. How do I go about doing this? In myClass I call the form using myForm.Show (); This opens the form but how then do I get the data from it? It seems to want an instance of the calling class in the myForm, but I can't do this.:confused: Hope that makes sense.

    C# question

  • sapi 5.1 and c#
    R richiemac

    Hi all, does anyone have any idea about using the microsoft speech api in a c# application. I've got the basics down but there's limited to no documentation available. MSDN only seem to documentation, examples, etc for C++. The problem is that some of the classes etc are either not available or different in some way that those available in c#. I'm particularly interested in changing voices, pitch, rate, volume, etc. Thanks Rich

    C# csharp c++ json help

  • Problem with properties???
    R richiemac

    Thanks guys! Knew it was something trivial.:doh:

    C# help visual-studio question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups