Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > data reader with richtextbox
 

data reader with richtextbox

Hi,

How shud i bind a data in a data reader to rich text box.

richtextbox.databindings = "//////////"

thsi is not wroking.

please help me

sairam120  Tuesday, June 10, 2008 10:51 PM

this happens because you use theBindingtype as a variable. learn how to bind here
Lucian Baciu  Wednesday, June 11, 2008 9:08 PM

Code Snippet

richTextBox1.DataBindings.Add(binding);

Lucian Baciu  Tuesday, June 10, 2008 11:10 PM

SqlConnection cn2 = null;

SqlCommand cmd2 = null;

SqlDataReader reader2 = null;

cn2 = new SqlConnection("User id=cmslogin;password=cmsunlock;database=sampleECSphase2test;Data source=primasqltst\\qa");

cn2.Open();

cmd2 =new SqlCommand ("select name from rich where Filename = '"+listBox1.SelectedValue+"'", cn2);

reader2 = cmd2.ExecuteReader();

retrievertb1.DataBindings.Add (Binding);

Error1' System.Windows.Forms.Binding' is a 'type' but is used like a 'variable'

I got the error .. please help me

sairam120  Wednesday, June 11, 2008 8:47 PM

this happens because you use theBindingtype as a variable. learn how to bind here
Lucian Baciu  Wednesday, June 11, 2008 9:08 PM

You can use google to search for other answers

Custom Search

More Threads

• Mixing of controls within a DataGridViewColumn
• CurrentRowIndex after sorting
• Databound DataGridView
• controlling optimistic concurrency behaviour by code
• Use a c# function in an DataGrid expression column?
• I need to change the DataGridView individual cell background
• how can i create owner draw menues
• Implementing ISerializable and IBindableComponent
• performance issues updating a datatable
• How to close database after using reportviewer? (C#)