What control correspond to a SqlDataSource in Windows forms

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

In Webb forms there is a control called SqlDataSource. I just wonder which
control in Windows forms does
that control correspond to ?

//Tony
 
In Webb forms there is a control called SqlDataSource. I just wonder which
control in Windows forms does
that control correspond to ?

It does not correspond to a visible control.

When GUI design editors became available, at first they were used to
position buttons and other GUI elements on Forms only. However,
developers often need more than the visible elements of a GUI and it
was considered convenient to have a design time representation of non-
visible elements in the GUI editor, too, for quick review and
configuration.

The SqlDataSource is such an invisible element. It represents a query
to a SQL database that can be bound to a control. For example, the
content of a dropdown control could be filled from the result of the
query automatically when the GUI starts.
 
In Webb forms there is a control called SqlDataSource. I just wonder which
control in Windows forms does
that control correspond to ?

None.

In ASP.NET you have markup (.aspc) and code (.aspx.cs).

In in forms you have just code (.cs) - even though some of the
code can be WYSIWYG edited via the designer.

Since SqlDataSource is a markup tag, then it can't be
used in win forms.

But you should not worry.

In my opinion putting database logic in the UI markup
as SqlDataSource does is a horrible thing to do.

Code your database access in an appropriate place.

Arne
 
Back
Top