private void DuplexSample(string s) { if (String.IsNullOrEmpty(s)) { throw new ArgumentNullException(); } EndpointAddress address = new EndpointAddress(addressDuplex); var clientCallback = new UpisiCallback(); var context = new InstanceContext(clientCallback); var factory = new DuplexChannelFactory <IUpisi>(clientCallback, binding, address); IUpisi messageChanel = factory.CreateChannel(); Task.Run(() => messageChanel.PosaljiInsert(s)); }
private static void DuplexSample() { //"INSERT INTO UneseneVrednosti " + //"(IDGeoPodrucja, VremeMerenja, Vrednost) " + //"VALUES ('" + idGeoPodrucja + "', '" + datum + "', " + _unesenaPotrosnja + ")"; string s = "INSERT INTO UneseneVrednosti(IDGeoPodrucja, VremeMerenja, Vrednost) VALUES ('DO', '2018-6-1 00:30:00.000', 234)"; var binding = new NetTcpBinding(); var address = new EndpointAddress("net.tcp://localhost:10101/IUpisi"); var clientCallback = new UpisiCallback(); var context = new InstanceContext(clientCallback); var factory = new DuplexChannelFactory <IUpisi>(clientCallback, binding, address); IUpisi messageChanel = factory.CreateChannel(); Task.Run(() => messageChanel.PosaljiInsert(s)); }