Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Carriage Return/Line Feed Puzzle
Message
De
19/12/2005 10:36:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/12/2005 10:37:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01078811
Message ID:
01079179
Vues:
52
Bonnie,
I think you're confusing him (or me:). He doesn't need a conversion with a ASP.Net textbox control. Just update/insert as I showed. FWIW I even tried with ASP.Net to see if actually there were a problem and there wasn't. Simply I typed in an ASP.net textbox control (multiline) with CRLF in it (and even pasted text with CRLF in it) and just inserted into a dbf as I showed in code. All memo content is there as it should be. ie: This was the code in ASP.Net:
  DataRow newRow = ds.Tables[0].NewRow();
  newRow["myId"] = ds.Tables[0].Rows.Count + 1;
  newRow["myMemo"] = TextBox1.Text; // this is a webforms textbox control
  ds.Tables[0].Rows.Add(newRow);
  da.Update(ds);
Cetin

>Stephen,
>
>I was about to post a code snippet for TextBox EventHandlers, until I realized that this was a WebForm TextBox you were talking about, not WinForm. In a WinForm TextBox, there are Parse and Format events, and you can put code in the events to replace the CR/LF with the appropriate character string, both before it gets displayed and after the user types into the textbox and it gets placed in the data. However, I don't use ASP much, so I'm not sure where to put this code in an WebForm TextBox. Maybe you simply replace before you put it in the TextBox, and after you get it back from the TextBox on the PostBack. Simply use a string's Replace method.
>
>~~Bonnie
>
>
>
>>Thank you for the detailed example, but I am afraid you have lost me. (I've only been working with aps.net and vb.net for a couple of months.) Is the trick here to use a streamreader to insert the memo fields? In my web page I am building up the "Update" command one text box at a time. I then pass the command off to a business object that uses the execute nonquery method to apply it to my foxpro database. I am currently pursuing a way to use string replacement to substitute any found "vbcrlf" strings with the "chr(13)+chr(10)" string as I build up the Update command. I haven't fully tested it yet though.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform