Mike Askew 131 Veteran Poster Featured Poster

Ooooooh, what a scary guy you are. You really like to wallow in your own stupidity and ignorance. You must think you're hid real good behind this so called wall of anonymity, you're not. Finding your stupid butt is what I do as a hobby & you're not really worth the effort.

Going all defensive makes suspicion of your guilt increase further.

Why turn offensive to the members of this forum, especially mods of all people. Peter is in the right to post as he did and from your original post we could make out no different as to what your intentions were.

Your post is just a clipboard dump of some text and we interpretted it as we did. Some explanation or clarity as to your problem would avoid situations like this. Therefore in my opinion you have absolutely no grounds to start having a go at others.

happygeek commented: well said +0
Mike Askew 131 Veteran Poster Featured Poster

Yup exactly like the are you sure buttons, it forces a response.

try googling "custom modal forms c#"

Mike Askew 131 Veteran Poster Featured Poster

It could probably exist but I dont see the logic behind the three buttons as there is no way apart from using a modal popup to force someone to click x or y button before proceeding. Hence the point that the button is modal.

Because with your method they can click the doStuff button without clicking either other one. The doStuff button can then not force the clicking of either of the other buttons, it is still down to the users choice unless you lock them out using a modal form.

Feel free to correct me if im wrong Deceptikon.

Mike Askew 131 Veteran Poster Featured Poster

ahh thank you it works fine now :) but one question? if i copy the original
CardsNumber = Cards;
CardsNumber = myObject.HandleString(CardsNumber);
and then only use the copy in the method i had earlier should'nt that give the same effect? just want to know :)

It would provide the same effect yes.

Mike Askew 131 Veteran Poster Featured Poster

You may need to tweak my variable declaration to get the length right, but you were overwriting the originals passed in as well as returning them to the new array as output.

public string[] HandleString(string[] str)
        {
            string[] TheResults = new string[str.Length];
            for (int a = 0; a <= 51; a++)
            {
                TheResults[a] = str[a];
                TheResults[a] = TheResults[a].Replace("   Hjärter ", "");
                TheResults[a] = TheResults[a].Replace("   Ruter ", "");
                TheResults[a] = TheResults[a].Replace("   Spader ", "");
                TheResults[a] = TheResults[a].Replace("   Klöver ", "");
            }
            return TheResults;
        }
Mike Askew 131 Veteran Poster Featured Poster

If myObject.HandleString(Cards); has a return value, CardsNumber = myObject.HandleString(Cards); will set CardsNumber to be that value.

Cards would be modified if it is a form level variable and the method makes changes to the Cards variable within it.

Can we see the method code and that might help find the change that you dont want.

Mike Askew 131 Veteran Poster Featured Poster

The following suggestions will help the process of answering threads in the most efficient manner.

  1. Do not hijack other member's threads, you will not get replies, instead start your own question.

  2. What have you tried? We are not here to mock mistakes and showing effort made will make us more inclined to help you than simply posting your issue and expecting us to fully code it for you.

  3. Provide the XML you are working with, or a snippet of it, it is time consuming and counter-productive to generate test XML.

  4. Provide the expected output XML, a copy of the actual output you would expect from the snippet of input XML is an underestimated help tool when creating solutions to the problems.

  5. Clearly explain what is required, transformations in particular can be complex and so clarity of what is required will reduce unnecessary delays/clarification.

  6. Namespaces, if your XML uses them and the snippet does not show this please inform us, they will change the outcome of some transformations when we don't know about them.

Happy posting!

Mike Askew 131 Veteran Poster Featured Poster
string update_sql = "UPDATE Customers SET Last_Name = '" + col2 + "', Type_Of_Trip = '" + col3 + "', Leaving_From = '" + col4 + "', Going_To = '" + col5 + "', Departing_Date = '" + col6 + "', Returning_Date = '" + col7 + "', Departing_Time = '" + col8 + "', Returning_Time = '" + col9 + "';"

Is the correct formatting of that SQL statement.

sai.ayilavarapu commented: Thanks +0
Mike Askew 131 Veteran Poster Featured Poster
<xs:element name="code">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z]{4}[0-9]{4}"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

Try that.

czxzxcXZ commented: Amazing guy +0
Mike Askew 131 Veteran Poster Featured Poster

Your welcome, mark the post as solved please :)

Mike Askew 131 Veteran Poster Featured Poster

@nmaillet, Didn't know you could leave the second part of the count specifier blank for any amount :)

@nesa24casa - the fix for my solution with your updated requirements using nmaillet's capturing. Also made it so it captures both <tab> and \t for the sake of covering all options :) simply remove |<tab> from the regex if you dont need it covered

string inputString = "nesa\t\tpera<tab><tab><tab><tab>nn\t\t\t\t\t\tkkn";
            string regexMatch = "(\t|<tab>){2,}";
            string regexReplace = ",";
Mike Askew 131 Veteran Poster Featured Poster
        string inputString = "nesa<tab><tab>pera<tab><tab><tab><tab>nn<tab><tab><tab><tab><tab><tab>kkn";
        string regexMatch = "(<tab>){2,20}";
        string regexReplace = "<tab>";
        string outputString;

        outputString = Regex.Replace(inputString, regexMatch, regexReplace);
Mike Askew 131 Veteran Poster Featured Poster

Specifically for <tab>

Match: (<tab>){2,20}
Replace: <tab>

This will match occurances of <tab> between 2 and 20 in a row, can adjust as needed. Works on your provided example though.

Input: nesa<tab><tab>pera<tab><tab><tab><tab>nn<tab><tab><tab><tab><tab><tab>kkn
Output: nesa<tab>pera<tab>nn<tab>kkn

Mike Askew 131 Veteran Poster Featured Poster
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output indent="yes" method="xml"/>
  <xsl:strip-space elements ="*"/>

  <xsl:template match="/">
    <Address>
      <xsl:apply-templates/>
    </Address>
  </xsl:template>

  <xsl:template match="row">
    <xsl:element name="Rowinfo">

      <xsl:element name="Locator">
        <xsl:value-of select="RateNumber"/>
      </xsl:element>

      <xsl:element name="LocatorDesignator">
        <xsl:value-of select ="concat(RateLetter, concat(', ',RateAccomDesc))"/>
      </xsl:element>

      <xsl:element name="thoroughfare">
        <xsl:value-of select="AssessmentStreet"/>
      </xsl:element>

      <xsl:element name="AddressArea">
        <xsl:value-of select="AssessmentStreet"/>
      </xsl:element>

      <xsl:element name="LocatorName">
        <xsl:value-of select="RateAccomDesc"/>
      </xsl:element>

    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Redid the style sheet slightly, this way allows access to all data within each row when the template is called, else we would need to store the row data in a variable each time.

Feel free to remove the second concatenation as you see fit, the comma seemed to be right considering the output.

With this stylesheet and the above input I get:

<?xml version="1.0" encoding="utf-8"?>
<Address>
  <Rowinfo>
    <Locator>1</Locator>
    <LocatorDesignator>Null, Dwelling (Part Of)</LocatorDesignator>
    <thoroughfare>Abesinia Passage</thoroughfare>
    <AddressArea>Abesinia Passage</AddressArea>
    <LocatorName>Dwelling (Part Of)</LocatorName>
  </Rowinfo>
  <Rowinfo>
    <Locator>1a</Locator>
    <LocatorDesignator>Null, Edmund's Home</LocatorDesignator>
    <thoroughfare>Arena's Palace Lane</thoroughfare>
    <AddressArea>Arena's Palace Lane</AddressArea>
    <LocatorName>Edmund's Home</LocatorName>
  </Rowinfo>
</Address>
abbelylee commented: Perfectly Solved +0
Mike Askew 131 Veteran Poster Featured Poster

Haha, girlfriends seem to leave you, my cat hasn't yet :)

Mike Askew 131 Veteran Poster Featured Poster
Mike Askew 131 Veteran Poster Featured Poster

Untitled84

Sorry didnt make myself clear, the code runs all the way to the end.

Mike Askew 131 Veteran Poster Featured Poster

Could try running it with a sleep of (500), equivalent of half a second.


Thread.Sleep() Is safe as it literally pauses execution of the thread and so therefore just makes the computer wait before running your next line of code, might give it the time to close the connection properly though in personal experience i've never had your issue.

Mike Askew 131 Veteran Poster Featured Poster

Kind of impossible to tell from the information provided.

Common sense would say either the Baza.Schedule object doesnt contain anything row wise or there is a failing link in your database working somewhere preventing the rows being pulled?

Maybe give us a more extensive code post and an insight into the type of informaation that you should be expecting?

Mike Askew 131 Veteran Poster Featured Poster

Try this:

If password.text <> confirmpassword.text Then
    Msgbox("Password not the same")
End If
Mike Askew 131 Veteran Poster Featured Poster

"Data type mismatch in criteria expression." is an error relating to your SQL.

In this case you are putting '11' around the number 11. When using numbers in the SQL you should leave out the ' ' :)

Mike Askew 131 Veteran Poster Featured Poster

Ok writing this code without an IDE is proving harder than i originally thought :D If someone else wants to contribute an OLEDB connection then feel free.

whatshername97, i suggest you look at the website which i learnt how to communicate with databases from. It takes you step by step through the process of writing the connection.

I will write one for you but i am off college for christmas now and my macbook pro doesn't have an IDE on it until i bookcamp to windows 7 after christmas :p

The website is as follows:
http://www.homeandlearn.co.uk/net/nets12p4.html

If you follow this tutorial through it should help you. If you get stuck with bits then i can always try sort it for you, but im stuck myself without an IDE as writing code in this text box is not as clear :(

Apologies, but i will assist where possible still :)

kvprajapati commented: Helpful! +11
Mike Askew 131 Veteran Poster Featured Poster

Im guessing the diary entry is written into a textbox?

Few things:
1. Whats the name assigned to the textbox storing the text?
2. Database file location? eg. c:\User\Database.mdb
3. Table name which you wish to store the information in?
4. Does the table just have one column storing the entries? Or are there multiple fields which are in the table. If there is more than one field (column) please list them in the order they appear in database from left-to-right :)

Does this database only need to store one entry? or would it need to be able to store a backlog of entries (needs extra code if storing a backlog)

If i can get that information off you im sure i can write an OLEDB connection to the database to store the information.

Mike Askew 131 Veteran Poster Featured Poster

As the title suggests, i am trying to pull a bitmap image stored in a table location with an OLEObject type to my picture box on the form. The code i am using is as following:

img_ProductPicture.Image = DS.Tables("LocationInfo").Rows(0).Item(5)

The error i am receiving is an InvalidCastException:
Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'

Am i missing something when pulling the image which will display it?

Thanks in advance for responses.

kvprajapati commented: ++rep. +11
Mike Askew 131 Veteran Poster Featured Poster

tbl_ProductInformation

Field: Product_Name

Entries:
Milk
Milkshake
Mushroom

SQL:
SELECT Product_Name FROM tbl_ProductInformation WHERE Product_Name LIKE '%M%'

I believe this should list all three entries in the database.