Hey,

No it doesn't write to the database at all yet, I have just added
dummy data to the SQL DB directly.
The code is just to test, so far i am just attempting to detect the
change with no success - so that message box will not appear as that
event is never called.

50cal.

On Jan 11, 7:53 am, Benj Nunez <[email protected]> wrote:
> "...but I am not sure how to detect
> a text change to right the data back to the database. "
>
> From what you mentioned earlier, you were able to save to the database
> before.
> What is the name of your method that performs this action? It's user-
> defined.
> For example:
>
> public void saveToDatabase(string AValue)
> {
>   string query "INSERT INTO FOO..  WHERE..."  + AValue;   //
> pseudocode only.
>
>   // your implementation here.
>
> }
>
> I noted from your code:
>
>     public void mytextbox_TextChanged(object sender, EventArgs e)
>         {
>             MessageBox.Show("mytextbox changed");
>             mytextbox.Text = "TESTING!!!";
>         }
>
> lacks a call to the method that actually saves to the database. You've
> simply updated your visual control (textbox). It should something
> like:
>
>     public void mytextbox_TextChanged(object sender, EventArgs e)
>         {
>             MessageBox.Show("mytextbox changed");
>             mytextbox.Text = "TESTING!!!";
>             saveToDatabase(mytextbox.Text) ;
>         }
>
> Benj
>
> On Jan 11, 12:51 am, 50cal <[email protected]> wrote:
>
>
>
> > Hi All,
>
> > I am creating a very basic contact manager to get me started
> > developing in C#, I have created the form and a class call classfield
> > that builds a text box and stores all the relevant information, such
> > as the name and text etc.
> > The field is then added to the form. I can navigate dummy records and
> > load the relevant data into the field but I am not sure how to detect
> > a text change to right the data back to the database.
>
> > I though I could just add a text changed event to the class (like
> > below) but it does not appear to be working.
>
> >         public void mytextbox_TextChanged(object sender, EventArgs e)
> >         {
> >             MessageBox.Show("mytextbox changed");
> >             mytextbox.Text = "TESTING!!!";
> >         }
>
> > Any advice would be appreciated!!
>
> > Thanks,
> > 50Cal.

Reply via email to