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
N

NandoMan

@NandoMan
About
Posts
25
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program [modified]
    N NandoMan

    Hello people of CP, I have a problem and would like you to help me fix it. The problem is that right after I call a stored procedure calling the method stated in the title, the execution of the program is interrupted without any warning or prompt whatsoever. The code block is this:

    public virtual object Execute()
    { return this.command.ExecuteNonQuery();
    }

    I know the command executes because the state in the DataBase is changed. But right after the return this.command.ExecuteNonQuery(); line, the program just stops. It doesn't throw an exception, it doesn't even go to the last bracket of the method, the program just exits. So, any idea what this might be? Thanks a lot! Edit: Here's a clearer example:

    private void SetSystemEnviroment()
    {
    try
    {
    using (OracleCommand command = this.con.CreateCommand())
    {
    command.CommandText = "SetSystemEnviroment";
    command.CommandType = CommandType.StoredProcedure;

                    command.ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
    

    Again, after the command.ExecuteNonQuery(); line, it just stops the execution of the program, no warnings, no exceptions, nothing.

    modified on Monday, July 25, 2011 6:23 PM

    Database help database oracle tutorial question

  • Consuming SOAP 1.1 WebService using Telnet
    N NandoMan

    Hi guys! I need to consume a WebService using the SOAP 1.1 standard via Telnet in Windows, but I´m getting a "Bad Request (Invalid Verb)" response. The request is this:

    POST /WS_PRU_PRODUCTO_76/ws_initialize.asmx HTTP/1.1
    Host: opnt08
    Content-Type: text/xml; charset=utf-8
    Content-Length: 510
    SOAPAction: "OpenSystems.WebServices.UI/INITIALIZE_WS"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    soap:Header
    <AuthenticationHeader xmlns="OpenSystems.WebServices.UI">
    <User>*******</User>
    <Password>*******</Password>
    <Instance>********</Instance>
    </AuthenticationHeader>
    </soap:Header>
    soap:Body
    <INITIALIZE_WS xmlns="OpenSystems.WebServices.UI" />
    </soap:Body>
    </soap:Envelope>

    So, I telnet the host, paste the request, but even before finishing pasting, the response arrives. Here's the output produced by the Telnet session:

    POST /WS_PRU_PRODUCTO_76/ws_initialize.asmx HTTP/1.1
    Host: opnt08
    Content-Type: text/xml; charset=utf-8
    Content-Length: 510
    SOAPAction: "OpenSystems.WebServices.UI/INITIALIZE_WS"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
    http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/en
    velope/">
    soap:Header
    <AuthenticationHeader xmlns="OpenSystems.WebServices.UI">
    <User>*******</User>
    <Password>*******</Password>
    <Instance>********</Instance>
    </AuthenticationHeader>
    </soap:Header>
    soap:Body
    <INITIALIZE_WS xmlns="OpenSystems.WebServices.UI/INITIALI
    quest
    Date: Thu, 24 Mar 2011 01:05:48 GMT
    Server: Microsoft-IIS/6.0Z
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Length: 0

    _WS"
    Content-Type: text/html
    Date: Thu, 24 Mar 2011 01:05:48 GMT
    Connection: close/
    Content-Length: 35

    <h1>Bad Request (Invalid Verb)</h1>>
    C:\Documents and Settings\cpantoja>
    C:\Documents and Settings\cpantoja> </soap:Body>
    The syntax of the command is incorrect.
    C:\Documents and Settings\cpantoja></soap:Envelope>

    this guy

    Web Development asp-net xml csharp html wcf

  • Dynamically generated insert command from DataTable
    N NandoMan

    PIEBALDconsult wrote:

    First, ditch the DataTable. Then ditch the DataAdapters. And then ditch the Linq.

    Really? are they that bad? why are they bad? Thanks!

    Clever Code csharp database mysql linq data-structures

  • Dynamically generated insert command from DataTable
    N NandoMan

    So, I found myself having to migrate the data from a Db in Access to a Db in MySql. What I did was that I first filled a DataTable with the data from the access Db, then I used a little bit of Linq to generate a MySql insert command, then use a DataAdapter to insert the records of the DataTable. The DataRows' state had to be manually set to added. Here, "Tables" is an array of strings with the tables I wanted to migrate.

    foreach (string table in Tables)
    {

                string columns = string.Join(",",
                    (from col in ds.Tables\[table\].Columns.Cast()
                     select string.Format("\`{0}\`", col.ColumnName)).ToArray()); //select the columns' names present in the DataTable, separated by ","
    
                string values = string.Join(", ",
                    (from col in ds.Tables\[table\].Columns.Cast()
                     select "@" + col.ColumnName.Replace(' ', '\_')).ToArray()); //The same, but with an "@" in the beginning for the parameters' names
    
                var param =
                    from col in ds.Tables\[table\].Columns.Cast()
                    select new MySqlParameter("@" + col.ColumnName.Replace(' ', '\_'), ToMySqlDbType(col.DataType), col.MaxLength, col.ColumnName); //The parameters used in the DataAdapter
    
                StringBuilder command = new StringBuilder();
                command.Append("insert into ")
                    .Append(table)
                    .Append(" (")
                    .Append(columns)
                    .Append(") values (")
                    .Append(values)
                    .Append(") ");
    
                MySqlDataAdapter insertAdapter = new MySqlDataAdapter();
                insertAdapter.InsertCommand = new MySqlCommand(command.ToString(), connection);
                insertAdapter.InsertCommand.Parameters.AddRange(param.ToArray());
    
                insertAdapter.Update(ds, table);
            }
    

    And the ToMySqlDbType function, taken from someplace else:

    public static MySqlDbType ToMySqlDbType(Type type)
    {
    MySqlParameter p1 = new MySqlParameter();
    System.ComponentModel.TypeConverter tc;
    tc = System.ComponentModel.TypeDescriptor.GetConverter(p1.DbType);

            if (tc.CanConvertFrom(type))
                p1.DbType = (DbType)tc.ConvertFrom(type.Name);
            else
            {
                try
                {
    
    Clever Code csharp database mysql linq data-structures

  • Strange behaviour on search
    N NandoMan

    Searching articles. I have removed the content filter and search works fine, but I don't remember adding a content filter before, it just happened once I filtered my search with this tag. Thanks!

    Site Bugs / Suggestions android question

  • Strange behaviour on search
    N NandoMan

    I once made a search and refined the results adding the "Android" Tag. Now, every time I make a search, the "Android" Tag is present and I have to remove it manually (if I´m not looking for Android related things, obviously). Is this correct? Is there a way to override this setting without clearing my browsing data? Thanks!

    Site Bugs / Suggestions android question

  • Another problem solved by global warming
    N NandoMan

    Disputed isle in Bay of Bengal disappears into sea[^]

    The Back Room com help

  • There Is No Right to Health Care.
    N NandoMan

    I tought we were talking about health

    The Back Room testing sales beta-testing help

  • There Is No Right to Health Care.
    N NandoMan

    Here in Colombia we have a system similar (not exactly the same) to what you are proposing. It is a complete failure.

    The Back Room testing sales beta-testing help

  • GIJOTD
    N NandoMan

    It's funny, but not LOL funny. maybe smiley funny.

    The Lounge question

  • GIJOTD
    N NandoMan

    (Gramatically incorrect joke of the day) Two men walk into a train station's ticket counter One of the men says "Do you have tickets to Washington?" The teller responds "I'm sorry, but we do not have tickets to Washington" The man turns to his friend "I'm sorry Washington, I can't take you with me" It works in Spanish, I tought I could give it a try X|

    The Lounge question

  • Why global warming can't be a conspiracy... and why denial can
    N NandoMan

    Some graphic design[^]

    The Back Room com design

  • The ‘Climate Change Debate’ Is Science Versus Snake Oil
    N NandoMan

    The ‘Climate Change Debate’ Is Science Versus Snake Oil[^] So, what do you guys think? fact or fraud?

    The Back Room question

  • Calamities Of Nature - Hot Debate
    N NandoMan

    This is funny: http://www.calamitiesofnature.com/archive/?c=322[^]

    The Back Room com question

  • The bottom line
    N NandoMan

    I'm just gonna leave this here. The bottom line[^] been reading the back room lately with great amusement. This CaptainSeeSharp is soooooooo funny!

    The Back Room php com

  • To test a theory. (Shared Birthdays)
    N NandoMan

    I believe you are a bit wrong. If you have 366 people, you can guarantee that at least 2 people share birthdays. It´s called "the Pigeonhole principle" http://en.wikipedia.org/wiki/Pigeonhole_principle[^]

    The Lounge css question

  • Hibernate-style coding?
    N NandoMan

    Wow man, you are right that was the exact term I was looking for!

    Design and Architecture java question

  • Hibernate-style coding?
    N NandoMan

    Nevermind, the term I'm looking for is "Method chaining"

    Design and Architecture java question

  • Hibernate-style coding?
    N NandoMan

    Hello guys, What was the name of the coding style used a lot in Hibernate? I mean, where you would have several calls in one single instruction, as in:

    SomeType obj = SomeClass.createInstance()
    .SomeMethod()
    .SomeOtherMethod()
    .OneLastMethod();

    I remember reading an article somewhere on the internet, but i can't find it back. Thanks!

    Design and Architecture java question

  • Dynamic Types in Generics?
    N NandoMan

    Yes indeed! I have corrected my code to use the Activator. Thanks again!

    C# csharp tutorial 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