Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Suchfunktion an Datenbank anbinden

Empfohlene Antworten

Hallo ihr!

Bin ein totaler Anfänger in C#.

Habe folgendes Problem.

Ich möchte auf meiner Webseite eine Suchfunktion die mit meiner SQL Datenbank verknüpft ist.

Habe eine GridView angelegt die auf meine DB zugreifen kann. Auserdem habe ich eine TextBox (Der Name oder anders für die suche reinkommen soll) und einen Button der die Suche anschieben soll.

Ich möchte das die Suche alle Daten aus der DB berücksichtigt. d.H es sollen alle Spalten durchsucht werden (z.B. Suche nach Namen oder eben nach dem Ort oder der Telefonnummer).

Danke für Eure hilfe

Was ist deine Frage?

wie du die daten in dein gridview bekommst?

nutze eine sql-abfrage, du musst wissen nach was er suchen soll.

nach einem namen oder einer telefonnummer etc.

Er sollte eigendlich nach allen Suchen

Ok hab es nach etwas rumprobieren geschafft.

protected void txtSuche_TextChanged(object sender, EventArgs e)

{

SqlDataSource1.FilterExpression = "Strasse LIKE '" + txtSuche.Text + "%' OR PLZ LIKE '" + txtSuche.Text + "%' OR Nachname LIKE '" + txtSuche.Text + "%' OR Vorname LIKE '" + txtSuche.Text + "%' OR Titel LIKE '" + txtSuche.Text + "%' OR Ort LIKE '" + txtSuche.Text + "%' OR Land LIKE '" + txtSuche.Text + "%'";

GridView1.DataBind();

}

:)

schön !

kommt mir zwar komisch vor, aber wenns funktioniert!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.