Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
search Data Error
Purba Anggara
8y
247
1
Reply
public
List<Pelanggan> GetByName(
string
Nama)
{
List<Pelanggan> daftarPG =
new
List<Pelanggan>();
strSql =
"select TabelPelanggan.*,JenisPelanggan.nama as JenisPelanggan,Pekerjaan.nama as Pekerjaan from TabelPelanggan "
+
"inner join JenisPelanggan on (TabelPelanggan.idJenisPelanggan=JenisPelanggan.ID) "
+
"inner join Pekerjaan on (TabelPelanggan.idPekerjaan=Pekerjaan.ID) "
+
"where status=1 and upper(TabelPelanggan.nama) Like @1 ORDER BY TabelPelanggan.KodePelanggan "
;
using
(FbCommand cmd =
new
FbCommand(strSql, conn))
{
cmd.Parameters.AddWithValue(
"@1"
,
"'%"
+ Nama.ToUpper() +
"%'"
);
using
(FbDataReader dtr = cmd.ExecuteReader())
{
while
(dtr.Read())
{
daftarPG.Add(MappingRowToObject(dtr));
}
}
}
return
daftarPG;
}
search Database firebird
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Control a Datagrid from another class
How to get current latitude and Longitude in Window form