Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 58F849FB36E for ; Mon, 16 Apr 2007 00:48:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 14536-09 for ; Mon, 16 Apr 2007 00:48:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by postgresql.org (Postfix) with ESMTP id 654A19FB226 for ; Mon, 16 Apr 2007 00:48:26 -0300 (ADT) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HdICX-0005Xo-B0 for pgsql-sql@postgresql.org; Sun, 15 Apr 2007 20:48:25 -0700 Message-ID: <10009763.post@talk.nabble.com> Date: Sun, 15 Apr 2007 20:48:25 -0700 (PDT) From: saytinh To: pgsql-sql@postgresql.org Subject: i have prolem can you help me MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: lovestory19852001@yahoo.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.78 tagged_above=0 required=5 tests=BAYES_00=-2.599, FORGED_YAHOO_RCVD=1.849, FROM_ENDS_IN_NUMS=2.53 X-Spam-Level: * X-Archive-Number: 200704/209 X-Sequence-Number: 28209 -- Table: ticket -- DROP TABLE ticket; CREATE TABLE ticket ( gid serial NOT NULL, id integer, name character varying, address character varying(254), province character varying(100), fax character varying(50), code integer, "type" integer, phone character varying(15), web character varying(40), levels integer, the_geom geometry, email character varying, CONSTRAINT ticket_pkey PRIMARY KEY (gid), CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2), CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL), CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 42102) ) WITHOUT OIDS; ALTER TABLE ticket OWNER TO postgres; Why i run void -> Exception parameter public DataTable SearchTicket(string strProvin, string strDistric, string strName, string strAddress, string strPhone, string strFax, string strEmail, string strType) { try { String Query = "Select name,gid from ticket Where 1=1 "; string str, str1; string strCode = "-1"; if (strDistric != "" && strDistric != "0") { Query += " and code = :code"; strCode = strDistric; } else { if (int.Parse(strProvin) != 0) { Query += " and code like ':code%'"; strCode = strProvin; } } if (int.Parse(strType) == 0) { str = " like '%"; str1 = "%'"; } else { str = " = '"; str1 = "'"; } if (strName != "") Query += " and lower(name) " + str + ":name" + str1; if (strAddress != "") Query += " and lower(address) " + str + ":address" + str1; if (strPhone != "") Query += " and lower(phone) " + str + ":phone" + str1; if (strFax != "") Query += " and lower(fax) " + str + ":fax" + str1; if (strEmail != "") Query += " and lower(email) " + str + ":email" + str1; Query += ";"; NpgsqlParameter[] values = new NpgsqlParameter[6]; values[0] = new NpgsqlParameter(@":code", Convert.ToInt32(strCode)); values[1] = new NpgsqlParameter(@":name", strName.ToLower()); values[2] = new NpgsqlParameter(@":address", strAddress.ToLower()); values[3] = new NpgsqlParameter(@":phone", strPhone.ToLower()); values[4] = new NpgsqlParameter(@":fax", strFax.ToLower()); values[5] = new NpgsqlParameter(@":email", strEmail.ToLower()); values[0].Direction = ParameterDirection.Input; values[1].Direction = ParameterDirection.Input; values[2].Direction = ParameterDirection.Input; values[3].Direction = ParameterDirection.Input; values[4].Direction = ParameterDirection.Input; values[5].Direction = ParameterDirection.Input; values[0].SourceColumn = "code"; values[1].SourceColumn = "name"; DataSet ds = PostGresServerDataAccess.getDataFromSQL(Query, "ticket", values); return ds.Tables["ticket"]; } catch (Exception ex) { throw ex; } } -- View this message in context: http://www.nabble.com/i-have-prolem-can-you-help-me-tf3582184.html#a10009763 Sent from the PostgreSQL - sql mailing list archive at Nabble.com.