public static List<string> GetNama(string prefixText) { SqlConnection conn = new SqlConnection(connStr); conn.Open(); SqlCommand cmd = new SqlCommand("select * from report where nama like @nama+'%' or report_id like @report_id+'%'", conn); cmd.Parameters.AddWithValue("@nama", prefixText); cmd.Parameters.AddWithValue("@report_id", prefixText); List<string> ReportNama = new List<string>(); using (SqlDataReader sdr = cmd.ExecuteReader()) { while (sdr.Read()) { ReportNama.Add(sdr[0].ToString()); ReportNama.Add(sdr[1].ToString()); } } return ReportNama; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)