Database Reference
In-Depth Information
txtLoadText.AppendText("TextBytes has length" + textBytes.Length + " bytes.\n");
return textBytes;
}
Otherwise, the processing logic is basically the same as you've seen many times throughout the
book: open a connection, access a database, and then close the connection.
Now let's retrieve the text you just stored.
Retrieving Data from Text Columns
Retrieving data from text columns is just like retrieving it from the smaller character data types. You'll
now write a simple console program to see how this works.
Try It: Retrieving Text Data
To retrieve data from text columns, follow these steps:
1. Select the Text and Binary Data project, right-click, and choose Add
Windows Form. From the opened dialog, make sure Windows Form is selected
and rename Form1.cs to RetrieveText.cs ; click OK to add this form to the Text
and Binary Data project.
2. Select the RetrieveText form, and set the Size property's Width to 438 and
Height to 334.
3. Drag a TextBox control to the form, and position it toward the center of the
form. Select this TextBox control, navigate to the Properties window, and set
the following properties:
Set the Name property to txtRetrieveText.
For the Location property, set X to 12 and Y to 12.
For the Size property, set Width to 401 and Height to 269.
Leave the Text property blank.
4. Now your LoadText form in the Design view should look like Figure 17-8.
 
Search WWH ::




Custom Search