Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fill a list view
Message
 
À
15/07/2005 16:33:17
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01033186
Message ID:
01033199
Vues:
28
Ok, I tried that, that was the first thing i tried but it didnt seem to work..
I just want to fill it even though i'm going to have to add two columns together eventually. THis is what I have:

string search_item = textBox1.Text.Trim();
SqlConnection con1 =new SqlConnection(connection);
SqlCommand cmd1 = new SqlCommand("sp_PMsearch_item", con1);
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.Add(new SqlParameter("@search_item", SqlDbType.VarChar));
cmd1.Parameters["@search_item"].Value = search_item;
SqlDataAdapter searchs = new SqlDataAdapter(cmd1);
DataTable dtsearch = new DataTable();
searchs.Fill(dtsearch);
con1.Open();
DataView searchresults = new DataView(dtsearch);
con1.Close();
this.listBox1.DataSource = searchresults;
this.listBox1.DisplayMember = "userid";
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform