Click here to Skip to main content

Comments by Oleksandr Kulchytskyi (Top 200 by date)

Oleksandr Kulchytskyi at 11-Feb-14 3:44am View
   
There are a lot of samples here:
http://www.codeproject.com/Articles/34460/WCF-Duplex-Reentrant-Services
http://www.codeproject.com/Articles/17704/WCF-Duplex-Operations-and-UI-Threads
http://www.codeproject.com/Articles/566543/WCF-Message-Exchange-Patterns-MEPs
 
the articles above related to the WCF duplex communication, what is concersn signalR read about it on the Microsoft site.
With regards, Oleksandr.
Oleksandr Kulchytskyi at 24-Apr-13 5:10am View
   
Reason for my vote of 5 \n Nice one!
Oleksandr Kulchytskyi at 26-Mar-13 4:12am View
   
Wow, i'm a bit wondering with your implementation...
Do you know, that after first read operation was perormed you stream will seek to the value of read bytes, as a result stream position will be = number of read bytes??
Oleksandr Kulchytskyi at 26-Mar-13 4:08am View
   
Did you try to use WebClient and set action method to POST ??
Oleksandr Kulchytskyi at 18-Mar-13 10:06am View
   
Well if be honest, for now i have no issues. I just want to get the whole idea of transferring voice stream in HTML5 client or even to know if there is such ability to do it??
In case of Yes, i also would like to know if it would work in mobile view, lets say in IOS 4+?
Oleksandr Kulchytskyi at 17-Mar-13 12:24pm View
   
Deleted
Well if be honest, for now i have no issues. I just want to get the whole idea of transferring voice stream in HTML5 client or even to know if there is such ability to do it??
In case of Yes, i also would like to know if it would work in mobile view, lets say in IOS 4+?
Oleksandr Kulchytskyi at 21-Jan-13 13:41pm View
   
Ouhh, yep , from that point of view, you are completely right!
Oleksandr Kulchytskyi at 21-Jan-13 5:15am View
   
Why abuse ? If i will be using System.Threading.Timer ,which performs counting on separate thread, so no overheads on UI thread. Furthermore, if we try to inject Rx to aforementioned approach and change existing behavior to push, with this approach we can extremely reduce some overheads to UI part.
 
Maybe you can advise some more advanced approach, i would like to hear it, because you have a spot and always have been giving nice advices =)
Oleksandr Kulchytskyi at 15-Jan-13 5:29am View
   
Reason for my vote of 1 \n Omg!
What about sql injection in your scripts (SQL injection problem)? Very poor.
Oleksandr Kulchytskyi at 10-Jan-13 9:00am View
   
What will happen if I used some session variables for all users????
What do you mean?
if you add some data to Session storage this data will be only avaliable for 1 user whic issued this session!!
if you want to access to some variable storage for more than only 1 user use Application level storage instead of Session
Oleksandr Kulchytskyi at 7-Jan-13 14:52pm View
   
ok =) i'm glad
Oleksandr Kulchytskyi at 3-Jan-13 4:30am View
   
Nope, it's require self implementation and self design.
About SignalR , you can read here https://github.com/SignalR/SignalR/wiki
Oleksandr Kulchytskyi at 29-Dec-12 18:54pm View
   
Why did you replicate your question?? if you can just improve the old!! You produce a spam!
Oleksandr Kulchytskyi at 29-Dec-12 18:46pm View
   
Man , what is wrong with you??? i have been answered on your previous question..
Why did you ask that again????
Oleksandr Kulchytskyi at 29-Dec-12 9:19am View
   
Reason for my vote of 2 \n Where is a lazy initialization?
Oleksandr Kulchytskyi at 29-Dec-12 9:01am View
   
As far as i remember you have asked such question!
Oleksandr Kulchytskyi at 29-Dec-12 8:11am View
   
Oppss, sorry about that.
Oleksandr Kulchytskyi at 29-Dec-12 6:06am View
   
Thanks
Oleksandr Kulchytskyi at 29-Dec-12 5:57am View
   
Well i completelly confused. as far as i understood UF17DataDownloader itself is your web service ?
As concerns real web-services in dot Net, where does you host it ? And which type of service WCF ?
If yes and it host in windows enviromnemnt , though:
 
host = new ServiceHost(serviceType);
host.Open(); //-- start WCF service;
 
//....
 
host.Close(); // -operation that stops WCF service.
 
In case os IIS hosting of web-service ... this won't work.,..
Oleksandr Kulchytskyi at 29-Dec-12 5:26am View
   
Ok, wait few minutes... and i will provide you with basic idea.
Oleksandr Kulchytskyi at 29-Dec-12 5:06am View
   
Whithout any internals of UF17DataDownloader i can't advise you smth.
Oleksandr Kulchytskyi at 29-Dec-12 4:50am View
   
Ok, where did you get this UF17DataDownloader?
This module was written by U?
Oleksandr Kulchytskyi at 29-Dec-12 4:39am View
   
So please provide us with you code where you have been working with Media Element !
Without code anyone cant help you!
Oleksandr Kulchytskyi at 29-Dec-12 4:35am View
   
What does it mean API?? What exact API?
ASP.NET WEb API ?? or what?
Oleksandr Kulchytskyi at 28-Dec-12 10:52am View
   
So =)
As far as i understand, you need complex turtorial about relationships between tables in EF and it's configuration???
Oleksandr Kulchytskyi at 28-Dec-12 9:50am View
   
You are welcome.
Oleksandr Kulchytskyi at 28-Dec-12 9:47am View
   
1) i write application using NHibernate with configuration MS Sql server.-
In which form this configuration is persisted? in case of FLUENT API, my answer is NO, otherwise (in case of xml config), - YES.
 
NHibernate is some aspect is a replication (porting code from JAVA platform to C#) + some complementary changes have been added (such as LINQ - which is not characteristic of JAVA)
Oleksandr Kulchytskyi at 28-Dec-12 9:04am View
   
=)))
Oleksandr Kulchytskyi at 28-Dec-12 9:04am View
   
Deleted
You are welcome! accept solution if you dont mind :)
Oleksandr Kulchytskyi at 28-Dec-12 7:56am View
   
Sorry for so late response....
But if be honest, in my turn, i do not understand U..
What did you expect? If you are expected that i will write a whole explanation turtorial about implementing the same func like Java Hibernate but in consideration of NHibernate...
Do you know how much time it can takes?
I have shared to you from my Skydrive a link to a book, please read it!!!
https://skydrive.live.com/redir?resid=BF850F36B9E30F29!4507&authkey=!AKPW5f3sM0xm0ig
Oleksandr Kulchytskyi at 28-Dec-12 7:51am View
   
Which errors???
Oleksandr Kulchytskyi at 28-Dec-12 6:28am View
   
Ohhh , sorry for my inattentiveness. Now i have caught what you mean..
Yep of course this things are still relevant for NHibernate.
Oleksandr Kulchytskyi at 28-Dec-12 6:24am View
   
Furthermore, in you injected in your solution such things as DI, and IoC,
you can achive functionality of replacing of usage differ DB servers on runtime , for example using config files.
Oleksandr Kulchytskyi at 28-Dec-12 6:06am View
   
Elaborate you question! Wich framework did you use ???
WinForms , WPF ??
Oleksandr Kulchytskyi at 28-Dec-12 5:55am View
   
How do you think , how can we help you from that little description??
Maybe it would be more efficient to add some exception message ??
Please accomplish your question
Oleksandr Kulchytskyi at 28-Dec-12 5:33am View
   
So what do you meand in term of "multiple database server"?
Is it the same server architecture , but in differ location???
Or you mean various DB servers??
Oleksandr Kulchytskyi at 28-Dec-12 5:24am View
   
So, accept the solution if it was helpful, please ;)
Oleksandr Kulchytskyi at 28-Dec-12 5:23am View
   
Which exact data you want to store in DB???
Oleksandr Kulchytskyi at 28-Dec-12 5:14am View
   
Yep, of course you can get rid of creating proxy class...
One of the possible reasons why you cannot receive data it to need specify some additional argument in header request via web client.
 
Also i would reccomend to add aditional check point:
void wClient_OpenReadCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if(e.Error!=null)
{
// log error state ....
return;
}
XNamespace ns = "http://schemas.datacontract.org/2004/07/WCF_REST_Service";
XDocument xdStudent = XDocument.Parse(e.Result);
var Result = (from emp in xdStudent.Descendants(ns +"Employee")
select new Employee
{
EmpNo = emp.Element("EmpNo").Value,
EmpName = emp.Element("EmpName").Value
}
).ToList();

dgData.ItemsSource = Result;
 

Oleksandr Kulchytskyi at 28-Dec-12 4:44am View
   
Omg, could you please elaborate you qustion ??
Which technology, framework etc??
Oleksandr Kulchytskyi at 28-Dec-12 4:01am View
   
Unfortunatelly, We cannot work from this little that you have described to us...
Provide community with sources
Oleksandr Kulchytskyi at 28-Dec-12 3:41am View
   
Please , elaborate your question!!! Describe in more details about your specific issue
Oleksandr Kulchytskyi at 28-Dec-12 3:40am View
   
So what a problem ??? Any issues with replacing instead of combobox to put listbox??
Oleksandr Kulchytskyi at 28-Dec-12 3:32am View
   
Yep of course , they cause the parsing issue , because of you forget to add xml namespaces to your xdoc
Oleksandr Kulchytskyi at 28-Dec-12 3:03am View
   
How how ?) Easily ,you need to be referenced to all necessary assemblies and begin to develop ;)
Oleksandr Kulchytskyi at 28-Dec-12 2:53am View
   
So what's the problem ?
Who told you that with SignalR you will be able to develop only a group chat ?))
Oleksandr Kulchytskyi at 28-Dec-12 1:45am View
   
Yep, completely agree with you, in that answer i had to pay more attention while have been mentioned about Equals method, but for some reason i have missed that,
And of course List.Find, also is quite good enough.
Thank for correction!
Oleksandr Kulchytskyi at 27-Dec-12 16:30pm View
   
As usual very informative and effective , my 5.
Oleksandr Kulchytskyi at 27-Dec-12 15:45pm View
   
Did you try to do anything ?? Or you expecting to receive code ?
Oleksandr Kulchytskyi at 27-Dec-12 15:07pm View
   
thanks !)
Oleksandr Kulchytskyi at 27-Dec-12 14:51pm View
   
Thanks :)
Oleksandr Kulchytskyi at 27-Dec-12 14:24pm View
   
I saw that somefuc returns a bytes array , that is all what i know.
But what exact it does? which encodings , and so on??
Oleksandr Kulchytskyi at 27-Dec-12 14:22pm View
   
Hm , i think No.
Oleksandr Kulchytskyi at 27-Dec-12 11:58am View
   
Yep , it similar to First(), expect one thing in case if there is no such element with specified criteria , method will return null.
And yep again, under the hood of LINQ located old-plain foreach , for =))
Oleksandr Kulchytskyi at 27-Dec-12 11:53am View
   
What about
using System.Reactive.Linq ??
Oleksandr Kulchytskyi at 27-Dec-12 11:36am View
   
Please provide community with your code!
Oleksandr Kulchytskyi at 27-Dec-12 11:34am View
   
Yep fully agree with you, Session state is one of the most suitable solution for it. My five to U.
Oleksandr Kulchytskyi at 27-Dec-12 11:33am View
   
You are welcome, contact me if any ;)
Oleksandr Kulchytskyi at 27-Dec-12 11:32am View
   
=)I wish you good luck !) Have a nice coding procedures ;)
Oleksandr Kulchytskyi at 27-Dec-12 11:13am View
   
=) Well, obviously, you didnt catch the whole idea of MVVM pattern, the main idea is delimnit your logic from view , though , there must be no code in your view....
 
So lets, go back to your question, it's possible, buts from code clean consideration more polite will be usage of declarative
Oleksandr Kulchytskyi at 27-Dec-12 10:22am View
   
"But do you know, that there is no other way to bind via xaml for me? (so i can mark this question as answered...)" - what do you mean?
There are 2 ways to declare bindings: imperative and Declarative.
The way like you did is called imperative, the way like i suggest is declarative.
Oleksandr Kulchytskyi at 27-Dec-12 9:43am View
   
Agree , patterns is not a bible, but they are something that devs you should consider :)
Oleksandr Kulchytskyi at 27-Dec-12 9:32am View
   
Thanks for your mark,you are welcome =)
Oleksandr Kulchytskyi at 27-Dec-12 9:30am View
   
Obviously yes, you must(might ) review you architecture approach...
good application design is one of the crucial aspect in software development.
Oleksandr Kulchytskyi at 27-Dec-12 9:21am View
   
As concerns binding in the code, define a lot of ViewModels and bind it in XAML
Oleksandr Kulchytskyi at 27-Dec-12 9:20am View
   
As concerns RaisePropertyChanged read this http://wilberbeast.com/2010/07/21/wpf-mvvm-and-raisepropertychanged/

Oleksandr Kulchytskyi at 27-Dec-12 8:27am View
   
you deploy it localy ? In case of yes, so choose anothe option to deploy.
Oleksandr Kulchytskyi at 27-Dec-12 8:23am View
   
So, create your own application in IIS,
run inetmgr, go to sites node , create your own web app,
and deploy via your's web-service to that app.
Oleksandr Kulchytskyi at 27-Dec-12 7:55am View
   
So if you mind,please rate our answer ;)
Oleksandr Kulchytskyi at 27-Dec-12 7:37am View
   
I knew it ;)
But anyway thanks, i think it will be useful for questioner!
Oleksandr Kulchytskyi at 27-Dec-12 7:36am View
   
Deleted
I knew it ;)
But anyway thanks, i think it will be useful for questioner!
Oleksandr Kulchytskyi at 27-Dec-12 7:10am View
   
Any exception??
Oleksandr Kulchytskyi at 27-Dec-12 7:07am View
   
As concerns INPC , i think you are completelly mistake!
What would be if you develop some input , and while try to input FirstName , now do you think does WPF will track property changes ???
My answer is now...
Oleksandr Kulchytskyi at 27-Dec-12 7:05am View
   
So, make double check! What a problem?)
if(string.IsNullOrEmpty(FirstName))
return "Name cannot be empty";
if (!Regex.IsMatch(FirstName, "^[a-zA-Z ]+$"))
result = "Name doesnot contain Numerical value";
Oleksandr Kulchytskyi at 27-Dec-12 6:41am View
   
Yep, of course it must occur,
when you declare you class:
public class Customer : IDataErrorInfo you didn't provide any initialization of your class , so as a result if you check string.IsNullOrEmpty(FirstName), it it turn, it will return true!
And last one you must also inherit in INotifyPropertyChanged interface in your entities..., without such notification WPF wont update/display values properly...
 
Ohh yess. one more in for error notification (display func you must add appropriate style), so for textbox it must be:
 
Oleksandr Kulchytskyi at 27-Dec-12 6:19am View
   
Not exactly what i'm expectiong for..
You said : "am getting an exception while following the method which using regex."
Where Exception???
Oleksandr Kulchytskyi at 27-Dec-12 6:09am View
   
Ho to the link , i provided you with it , then download assembly from codeplex,
and add this assembly (reference to it) in you VS project
Oleksandr Kulchytskyi at 27-Dec-12 6:03am View
   
Please provide me with exception cotent
Oleksandr Kulchytskyi at 27-Dec-12 5:54am View
   
What do you mean ???
Total count of collumns on one sheet??
Or all columns (it's name )???
Oleksandr Kulchytskyi at 26-Dec-12 15:44pm View
   
Which UI farmework did you use ??
WPF or WinForms???
Oleksandr Kulchytskyi at 26-Dec-12 9:19am View
   
So for which purpose you need different instances of your web-service?
Oleksandr Kulchytskyi at 26-Dec-12 9:17am View
   
So if my solution will be helpful ,please accept solution, and RATE this post ;)
Oleksandr Kulchytskyi at 26-Dec-12 9:12am View
   
So if substitution of Dispatcher priority doesn't help, so we need to enforce Dispatcher loop with help of the code above in my solution
Oleksandr Kulchytskyi at 26-Dec-12 9:05am View
   
Try to do the next, set the Dispatcher priority. ->
DispatcherTimer(System.Windows.Threading.DispatcherPriority.Render);
and now i'm trying to provide you with some helper code to force push messages in Dispatcher loop (wait few minutes)
Oleksandr Kulchytskyi at 26-Dec-12 9:05am View
   
Deleted
Try to do the next, set the Dispatcher priority. ->
DispatcherTimer(System.Windows.Threading.DispatcherPriority.Render);
and i now i'm trying to provide you with some helper code to force push messages in Dispatcher loop
Oleksandr Kulchytskyi at 26-Dec-12 8:15am View
   
How to print in MVC telerik grid ... hmmm...
public ActionResult Index(){
ArrayList AL = new ArrayList();
DataClasses1DataContext contextData = new DataClasses1DataContext(); System.Data.Linq.ISingleResult Results = contextData.usp_DelBithdays_SELECT_BIRTHDATE_For_30_Days();
var qur = contextData.usp_DelBithdays_SELECT_BIRTHDATE_For_30_Days();
foreach (var sp in qur)
{
AL.Add(sp);
}
ViewBag.Collection= AL.ToArray(typeof(//yourData));
}
 
and somewhere in your VIEW you must assign ItemSource to ViewBag.Collection
Oleksandr Kulchytskyi at 26-Dec-12 7:27am View
   
"I am also using two temp tabel for remark of record which is already loaded in ListView." - Why so complicated ?)
You can be easily bounded with only 1 table, in which you will write every action which affected table that you are observed.
 
Approach with SignalR by it nature will be robust and reliable!
But it requires some experience in web.
But one bigger advantage of it, with help of SignalR you can easily get rid of unneccessary stuff with observing temp tables and performing sync.
 
Lets quickly go through:
Your apps conneced to a SignalR hub, the for CRUD operation they will use this hub.
For example app on PC1 removes record with ID = 1, On Hub side SignalR performs delete operation , after delete was succeed, Hub will notify the rest of the client about delete operation , and all app on differ PF will receive notification abou that and do appropriate actions for sync ListView
Oleksandr Kulchytskyi at 26-Dec-12 6:29am View
   
=)) Yep nice question =))
This is from serie where people asking which car is best =))
Each of it has their own prons and cons =)
As being C++ and C# developer, i can answer in the next key:
C# much easier for studie. In some case with C# some things musch easier to implement rather than C++.
And the last one , it's all depends, from purposes which you pursuit =)
Oleksandr Kulchytskyi at 26-Dec-12 5:47am View
   
it seems very strange ....., i'll try to figure out what is wrong
Oleksandr Kulchytskyi at 26-Dec-12 5:46am View
   
Thanks :)
I alway try to use TryParse methods, because it's a robust approach not so error prone like would be in case of usage Parse methods =)
Oleksandr Kulchytskyi at 26-Dec-12 5:43am View
   
Which version of WP core ? 7.0 or 7.1??
Oleksandr Kulchytskyi at 26-Dec-12 5:32am View
   
And one more , recently one person posted about Master-Detail MVVM in WPF
, so you can read it carefully to understant this approach
 
http://www.codeproject.com/Articles/332615/WPF-Master-Details-MVVM-Application
Oleksandr Kulchytskyi at 26-Dec-12 5:23am View
   
Nice one !)
Oleksandr Kulchytskyi at 26-Dec-12 5:13am View
   
Ok , i have updated my solution, so you can look at it, if it will help to U, please accept the solution and mark my answer ;)
Oleksandr Kulchytskyi at 26-Dec-12 4:41am View
   
Sorry, but what the key and time period you are asking about ????
Oleksandr Kulchytskyi at 26-Dec-12 4:09am View
   
My answer was concise, so as a result in property declaration i have ommited INPC(INotifyPropertyChanged mechanism) in WPF and MVVM it's need to be persisted anywhere , so without delraring this properties AS INP (in Models and ViemModel) it won't be work properly..
Oleksandr Kulchytskyi at 26-Dec-12 4:05am View
   
Deleted
My answer was concise, so as a result in property declaration i have ommited INPC(INotifyPropertyChanged mechanism) in WPF and MVVM it's need to be persisted anywhere , so without delraring this properties AS INP (in Models and ViemModel) it won't be work properly..
Oleksandr Kulchytskyi at 26-Dec-12 3:42am View
   
=) Thanks, native strings :-)
Oleksandr Kulchytskyi at 25-Dec-12 16:08pm View
   
Yep of course there are a lot of ways to do it, and maybe for learning purpose it would be more prefarable for you as a starting point, but i have formed my idea from consideration of extensibility and maintability of code.
What if in future decide to extend your app, and add one more tab which will access to db, and furthermore, if you familar with IoC and DI , for example you can easily replace your SQL repo with another one, for example Mongo Repo...
Oleksandr Kulchytskyi at 25-Dec-12 16:01pm View
   
Ouch , could you please explain for which purposes you allow log in process in two different tabs of the same application??
Oleksandr Kulchytskyi at 25-Dec-12 15:41pm View
   
Yep, completely agree with you, today i have tired to explain people that insertion command represented via string is a bad style, and this can lead to SQL injections...
Nice answer! My five :)
Oleksandr Kulchytskyi at 25-Dec-12 9:27am View
   
So if my answer is compelling for you, please accept solution ;)
As concerns you problem (without having admin access), only one suitable advise can be useful for U- is to use port 80, which is open, otherwise for resolving access for other ports , unfortunately no way to resolve it whithout admin right.
Or i mistake, if you deploy it to IIS , and try to access for example from port 82. it might be work!)
Oleksandr Kulchytskyi at 25-Dec-12 9:03am View
   
Empty = new EmptyPage[100];??? Provide community with full list of code!!!
Oleksandr Kulchytskyi at 25-Dec-12 9:02am View
   
I don't believe you!! if(Empty[0]==null) must work!!!
Oleksandr Kulchytskyi at 25-Dec-12 8:41am View
   
Did you try to do something ?) Or you expecting a list of sorces, which you can easily paste in VS ?))
Oleksandr Kulchytskyi at 25-Dec-12 8:11am View
   
So, Does it help to you??
Oleksandr Kulchytskyi at 25-Dec-12 5:56am View
   
Again not so correct question....
I have been involved in development of various ASP.NET apps.
Each of them use differ session state management mechanism.
Again and again i repeat that all depends...
In my own blog which i have written on ASP.NET , i use InProc mode , because:
- I store a little of data in session,
- I have no load balancer for it,
- My hosting provider exposes to me very powerful server(maybe this has no relevance for this question)
- Not all peages require sessions storage
So one conclusion, InProc mode much more faster but it requires more memor on the server
Oleksandr Kulchytskyi at 25-Dec-12 3:39am View
   
Are envisioning to expose any code to community?)
Oleksandr Kulchytskyi at 25-Dec-12 3:32am View
   
For the first time you don't have a problem, i mean did you envisioning such term as network latency or slow internet connection? This is a kind of gold rule to get rid of redundance overheads on UI thread..
So lets go back to you problem. Would you mind to show to community declaration of your lbBooks in XAML ?
I can mistake , but if you do not provide ItemSource property with some binding , the error could be hidden there, so for example:
<ListBox x:Name="lbBooks" ItemsSource="{Binding}">....
 
and another way is to do next <ListBox x:Name="lbBooks" ItemsSource="{Binding ObsBooks}">
 
where ObsBooks is ObservableCollection ObsBooks {get;set;} in your window.
 
Also i recommend to you change DispatcherPriority.ApplicationIdle to Background
Oleksandr Kulchytskyi at 24-Dec-12 7:55am View
   
Thanks for your answer, but if be honest i really know that if an objcets implements IDisposable, i need manually call Dispose method, or wrap it in scope of using block.
As concerns my question, i surf a lot in internet and got some confusion when i saw, that all articles which was written by MS, after finished of using Task object, do not call dispose method against instance of a Task.... or even didnt wrap in in using block. (I assume that most of MS developers knew about IDisposable interfale and resource disposing :) )
Thats why i have been asked this question..
Oleksandr Kulchytskyi at 24-Dec-12 7:07am View
   
Sorry, obviously i inattentively read your question...
Oleksandr Kulchytskyi at 24-Dec-12 4:19am View
   
Sorry ,I had no purpose to hurt you... my approach is below , under your first comment
Oleksandr Kulchytskyi at 24-Dec-12 4:18am View
   
It can be done purely bu using XPath...
 
xmlDoc.SelectNodes("//dbo[xs:date(./FDate@text()) > xs:date('given date') and myParameter[text()='given parameter']]")
Oleksandr Kulchytskyi at 24-Dec-12 4:12am View
   
Ohhhh, Recently i have been observing such tendency that there are a lot of lazy people who write some questions with only one intent is to get code which would work properly , it's very frustrates ....
Try to do the best of yourself , and only then , in case of failure, ask a question...
Oleksandr Kulchytskyi at 24-Dec-12 3:30am View
   
No problem , make a reverse engineering from existing DB you can successfully replicate to code-first model, just look at this link -> http://thedatafarm.com/blog/data-access/quick-look-at-reverse-engineer-db-into-code-first-classes/
 
And the rest still remains the same as i wrote above!
Oleksandr Kulchytskyi at 23-Dec-12 14:32pm View
   
Is it so hard to open MSDN and search all about IRequiresSessionState ?)
Namespace: System.Web.SessionState, Assembly :System.Web.dll.
Oleksandr Kulchytskyi at 22-Dec-12 16:21pm View
   
You are welcome,Sorry but obviously, i have misspelled smth in that LINQ, just remove line -> let tmp=e, this is redundancy line of code =)
Oleksandr Kulchytskyi at 21-Dec-12 10:49am View
   
Do you have any code ?)
Every time when peoples asking question like yours it's quite difficult to understand the problem behind the scene...
So please , sources in a studio )
And second one you don't specified type of EF is it Ef Code-first ? Which version?
Or somethink like that...
Oleksandr Kulchytskyi at 21-Dec-12 9:09am View
   
Did you invoke Session.Abandon() method after completion all of the logic in logout button ??
Oleksandr Kulchytskyi at 21-Dec-12 3:31am View
   
Deleted
Nice solution especcially usage impersonation of user at first line in Main method.
 
But Have you ever seen the third overload of ServiceController ctor?)
If not , please check it on MSDN. It gives to you 1 additional parameter machine name , or in your case Ip address.
 
And the last one, Does any of remote machine located in the same domain ? If not , you approach will fail anyway.
Oleksandr Kulchytskyi at 20-Dec-12 10:49am View
   
And i have forgotten to add url to call that service.
In your case it will remains the same: http://localhost:2664/FrontService.svc/Login?UserName=max
Oleksandr Kulchytskyi at 20-Dec-12 9:08am View
   
Hi , Did you use the in-process session state mode ???
When the Session State Manager removes a session state object that resides in the cache, the HttpCache manager will call any registered callbacks. In effect, this behavior raises the Session_OnEnd event handler. (IN CASE of in-process session state mode!!!)
Oleksandr Kulchytskyi at 19-Dec-12 3:35am View
   
Ok.
Well, personally for me,it would be preferable to work in Wpf MVVM with conjunction of third-party Library called MvvmLight (Galasoft.MvvmLight.* namespaces), by its convenience and exposing many helpfull features like Mediator , Notification, Threading. You can get it via NuGet package manager.
 
So let begin with our domain model.
//as far as you want to perform various validations against model, our domain model inherits IDataErrorInfo interface
public class PersonModel: GalaSoft.MvvmLight.ObservableObject,IDataErrorInfo
{
private int _id;
public int Id
{
get{return _id;}
set { if(_id!=value){_id=value; base.RaisePropertyChanged(()=>Id);}}
}
... other properties was omitted for brevity
}
 
ViemModel part:
 
public sealed class PersonViewModel:GalaSoft.MvvmLight.ViewModelBase
{
private PersonModel _curPer;
public PersonModel CurrentPerson
{
get{return _curPer;}
set
{
_curPer=value; base.RaisePropertyCahnged(()=>CurrentPerson);
}
}
 
private ObservableCollection<PersonModel> _perList;
public ObservableCollection<PersonModel> PersonList
{
get{return _perList;}
set
{
_perList=value; base.RaisePropertyCahnged(()=>PersonList);
}
}
// other stuff(Commands and so on) was omitted for brevity.
}
 
And last , you xaml:
 


....

<ListBox ItemsSource="{Binding PersonList}" DisplayMemberPath="Id"
SelectedItem="{Binding CurrentPerson,Mode=TwoWay}"/>
Oleksandr Kulchytskyi at 2-Oct-12 2:23am View
   
All depends!!
WinForms has no such powerful UI capabilities like WPF.
And i'm sure that UI of 2012 has been built on top of WPF.
Oleksandr Kulchytskyi at 7-Sep-12 3:49am View
   
Well actually i'm using static bound functionality, and reffer to one assembly , which in turn use late/rutime binding.
Oleksandr Kulchytskyi at 5-Sep-12 7:55am View
   
thx! Yep, it's really work with hotfix.
You are my saviour!)
Oleksandr Kulchytskyi at 5-Sep-12 7:45am View
   
Sorry, but about which hotfix, you have mentioned above ???
I haven't encountered any suggestion about hotfix.
Could you please share link , where you have been read about that??
Oleksandr Kulchytskyi at 23-Aug-12 14:24pm View
   
I fully agree with you. The code looks much cleaner.
But if think in way of performance consideration, if one thread wants to read some resource , but another has already locked it resource and tries to write some data, reader thread must wait until another thread will complete its activities agains this resource.
In case of RWLS we locked only specific action types (write , read)
Oleksandr Kulchytskyi at 23-Aug-12 13:37pm View
   
Yep, i know such locking construction but i one arcticle which is related to C# development, i've read that it would be more polite to replace lock(..){} to more efficient ReaderWriterLockSlim technic.
So as a result, i've been interesing in using of ReaderWriterLockSlim.
Oleksandr Kulchytskyi at 21-Aug-12 3:00am View
   
returnTypes[Type.GetType(item.Attribute("service").Value)] = Type.GetType(item.Attribute("contract").Value);
Oleksandr Kulchytskyi at 21-Aug-12 3:00am View
   
As usual =) Your answers are perfect !)
Thanks a lot for you help. For now i have clear imagination about my issue and i know how to handle it. Again , thanks)
Oleksandr Kulchytskyi at 20-Aug-12 8:28am View
   
In such way we define and assign length of ipTemp member of IntPt type. to define OS bitness version of OS (32,64)
Oleksandr Kulchytskyi at 15-Aug-12 11:23am View
   
yes , of course , i'm a bit of careless today , so instead of name OrderByType i called it Order in method above.
Oleksandr Kulchytskyi at 15-Aug-12 10:57am View
   
yep ,sorry for incorrect piece of code.
 
[HttpPost]
public ActionResult OrderByType(Models.PrePurchaseSearch search)
{
try
{
if (!ModelState.IsValid)
{
return Json(new
{
Result = "ERROR",
Message = "Form is not valid! " +
"Please correct it and try again."
});
}
return Json(db.RoomData).Where(x=>x.type==search.Type);
}
catch (Exception ex)
{
return Json(new { Result = "ERROR", Message = ex.Message });
}
return Index();
}
 
But with it code my $.post method fails, i dont know why.
In debug i go through code and ensures that query to db work properly and retreives appropriate data.
I work with EF 4.3.1 , and have chhosen Code-First approach.
Oleksandr Kulchytskyi at 15-Aug-12 10:46am View
   
Yep, I'm in favor of Razor.
So for now i've resolved this.
Thanks for your help.
Oleksandr Kulchytskyi at 15-Aug-12 10:22am View
   
No , my select control looks like this:
<p>
<fieldset>
Movie Type
<select id="prePurchaseType" name="Type">
<option value="0" selected="selected">Time to start</option>
<option value="1">Highest prize value</option>
</select>
<input type="submit" id="btnSearch" value="Search" />
</fieldset>
</p>
Oleksandr Kulchytskyi at 15-Aug-12 10:22am View
   
Deleted
No , my select control looks like this:
<p>
<fieldset>
Movie Type
<select id="prePurchaseType" name="Type">
<option value="0" selected="selected">Time to start</option>
<option value="1">Highest prize value</option>
</select>
<input type="submit" id="btnSearch" value="Search" />
</fieldset>
</p>
Oleksandr Kulchytskyi at 15-Aug-12 9:47am View
   
The problem hides behind the passing of value which user choose in html select control
to HTML.Action method ...
HTML.Action("Search","Models",new {country =???}
Oleksandr Kulchytskyi at 13-Aug-12 15:44pm View
   
I think it's very specific issue, so as a result try you own to resolve it via self implementation.
Oleksandr Kulchytskyi at 13-Aug-12 15:35pm View
   
Try to use ASP.NET WebApi in hot favor of it's flexibility and scalability , it can gives to you more control over JSON , and standart HTTP protocol.
As concersn your issue , show implementation of your method, how you convert it to JSON ? At first sight , with Rest declaration of your WCF, it seems like it fine.... but what behind the scene ?
Oleksandr Kulchytskyi at 11-Aug-12 13:25pm View
   
I can recommend to use use WebApi , instead of old-palain WCF Rest.
Try to use this brand-new framework , and i think you will be astohished with it.
You can set differ message formatters the in few lines of code, set necessary routing , etc.
Oleksandr Kulchytskyi at 11-Aug-12 13:21pm View
   
As being favor in ITextSharp , i recommend to you use this open-source library!
http://sourceforge.net/projects/itextsharp/
Oleksandr Kulchytskyi at 11-Aug-12 9:10am View
   
Nothing great, sorry, i have been impatiently read article , and at first sight i got it like MS allows development to a desktop in express edition of vs 2012
Oleksandr Kulchytskyi at 10-Aug-12 11:01am View
   
it's very interesting !) Thanks again!)
Oleksandr Kulchytskyi at 10-Aug-12 10:49am View
   
whoa) It's great news)) From the latest article which i have read , Microsoft restricted dev not only in express for desktop but in general, including dev only for metro =)
 
But that article changed my knowledge =)I have seen that it still remains in paid versions of VS2012!!)
Tahnks a lot !)
Oleksandr Kulchytskyi at 10-Aug-12 10:49am View
   
Deleted
whoa) It's great news)) From the latest article which i have read , Microsoft was restrict dev in express for desktop , including dev only for metro =)
But that article changed my knowledge =)
Tahnks a lot !)
Oleksandr Kulchytskyi at 10-Aug-12 10:43am View
   
Thanks for your answer =)
But this is not exactly what i'm interesting in.
I know what it is a WPF, XAML , WinForm and how these frameworks looks like and so on =)
Also i know that WPF in most cases pushed off WinForms from a play-chase, Microsft itself heavily uses the WPF technology in their own apps.
 
For the dev , who being confident in XAML , microsoft opened a wide range for development: WinPhone 7,7.5 + as far as i know will remain in upcoming WP 8;
Wpf - uses Xaml, and in core of Metro UI you can still find a XAML =)
So the question still relevant =) Core of UI in VS 2012 relies on WPF ?)
Oleksandr Kulchytskyi at 8-Aug-12 8:34am View
   
Well exactly i need to check access to following string :
Ldap + "://" + ldapServer + fulldomain.trim() + ":" + port.trim() + "/"
Oleksandr Kulchytskyi at 8-Aug-12 8:22am View
   
Yep, thanks for it.
But it require a login and password.But in my case, i can only provide it with
server name, full domain name and port.
So this is not exactly what i need.
Oleksandr Kulchytskyi at 1-Aug-12 15:55pm View
   
Thanks for a link, but i have already read this article, and this article didn't preview any unstandart routing templates, only standart routing , like this:{controller}/{action}/{parameters}. This is not exactly what i need...
Oleksandr Kulchytskyi at 30-Jul-12 8:31am View
   
Models.PhysicianInfo2.Speciality property that, represents physician info specialties, it could consists from one or more items.
Oleksandr Kulchytskyi at 30-Jul-12 8:28am View
   
partially, i resolved my issue , but i encountered with another problem related to aggregate exception
 
Fixed query looks like below:
 
var item2 = (from item in _context.Physician.Include("PersonalInfo").Include(x => x.PhysicianSpecialty).Include("PhysicianSpecialty.Speciality")
 
let specialities = (from spec in _context.PhysicianSpecialty
where spec.PhysicianID == item.PhysicianID
select spec.Specialty)
 
select new Models.PhysicianInfo2()
{
NPI = item.NPI,
Email = item.PersonalInfo.Email,
FirstName = item.PersonalInfo.FirstName,
LastName = item.PersonalInfo.LastName,
MiddleName = item.PersonalInfo.MiddleName,
Prefix = item.PersonalInfo.Prefix,
Suffix = item.PersonalInfo.Suffix,
Speciality = (from subItem in specialities
select subItem.Name).Aggregate((a, b) => string.Format("{0}, {1}", a, b)),
Institution = string.Empty
});
 
but error appears:
 
LINQ to Entities does not recognize the method 'System.String Aggregate[String](System.Linq.IQueryable`1[System.String], System.Linq.Expressions.Expression`1[System.Func`3[System.String,System.String,System.String]])' method, and this method cannot be translated into a store expression.
Oleksandr Kulchytskyi at 25-Jul-12 9:03am View
   
I have been looking into some push notification services , but for this moment i didn't find any framework on NET...
As option one person advices to me, look into Zend-Framework, but it's on PHP...
I look for some managed solution on NET
Oleksandr Kulchytskyi at 17-Jul-12 7:22am View
   
Yep, sorry for my incorrectness, i'm really writing to file =)
Oleksandr Kulchytskyi at 1-Jul-12 8:26am View
   
public IQueryable GetJob_Allowance()
{

return this.ObjectContext.Job_Allowance.Where(ds => ds.Job_ID>=1 && ds.Job_ID<=3);
}
Oleksandr Kulchytskyi at 29-Jun-12 14:41pm View
   
Yep, i didn't think about breaking capabilities of .NET interoperability in differ OS. Again, thanks =)
Oleksandr Kulchytskyi at 29-Jun-12 9:28am View
   
Thanks for your reply.
I also look forward for similar solution of using some kind of collection , where i could store entered data and check for duplication.
But also i'm interesting other solution, for example of using native WinApi(P/Invoke), which can help handle last entered line to console)
But anyway, thank for your time)
Oleksandr Kulchytskyi at 18-Jun-12 11:20am View
   
Only WsHttpBinding, NetTcpBinding and NetNamedPipeBinding support sessions.
So you can look forward to implement sessioning environment using WSHttp...
Oleksandr Kulchytskyi at 17-Jun-12 4:03am View
   
Ok =) Sorry for my inattention. I will try to move forward, to find out solution , which you expect.
Oleksandr Kulchytskyi at 15-Jun-12 13:09pm View
   
thanks)
Oleksandr Kulchytskyi at 11-Jun-12 15:48pm View
   
My 5 to your answer , As always, you are giving a very informative answers and advices. Codeproject must proud , that have such experienced people like you !
Oleksandr Kulchytskyi at 11-Jun-12 15:46pm View
   
I do not use Thread.Abort. This can corrupt workflow state.
I use CancellationtokenSource and IsCancelled property for monitoring whether cancellation is requested,
thread run in infinite loop and periodically , say one time in 5 minute must run process.
Oleksandr Kulchytskyi at 8-Jun-12 7:14am View
   
Do you call from your service any unmanaged code/resources??
Oleksandr Kulchytskyi at 7-Jun-12 1:44am View
   
Yep sorry)) it's my fault. I wrote this code on the fly)
Oleksandr Kulchytskyi at 6-Jun-12 3:21am View
   
What are you talking about???
Maybe you mean how to host WCF service in WPF application???
Oleksandr Kulchytskyi at 5-Jun-12 4:44am View
   
Graceful implementation, my 5 to U!)
Oleksandr Kulchytskyi at 5-Jun-12 4:24am View
   
What about timeouts for sending/receiving data ??
Oleksandr Kulchytskyi at 5-Jun-12 4:10am View
   
Solution above is a very tough for implementation, but very robust in practice.
Also it's possible to implement such functionality via WinApi method
WTSEnumerateProcesses, implementation of logic by using this WinApi methods seems much easier. But I'm not use it in practice ;)
Oleksandr Kulchytskyi at 4-Jun-12 10:20am View
   
Since invention of Vista OS, all service , which running in Local System account, run in separate session, and has differs from your currently logged on user desktop. So you could change service account to run in appropriate user enviroment.
Oleksandr Kulchytskyi at 4-Jun-12 8:08am View
   
On which account NT service running? (Local system / or from user name)
 
And on which OS it running?
Oleksandr Kulchytskyi at 3-Jun-12 3:18am View
   
Man, i already did it in Solution 1 , look at second code snippet!!
As you can see , i wrapped yours StreamReader objstream in scope of using(..){...} . After performing file reading, streamreader will automatically close file handle.
 
Read carefully about using on MSDN http://msdn.microsoft.com/en-us/library/yh598w02(v=vs.80).aspx.
 
Also i could add that, if you disassemble my code, you will find,
that using observed in next manner
 
StreamReader objstream=null;
try
{
objstream=new new StreamReader(Properties.Settings.Default.url);
richTextBox1.Text = objstream.ReadToEnd();
}
finally
{
objstream.Dispose(); //in this case Dispose method responsible for closing file handle.
}
Oleksandr Kulchytskyi at 2-Jun-12 10:29am View
   
Yes, of course you will get an error if you performs doubleclick on richtextbox1.
If we will follow your logic, in event handler on button1 click, you create streamreader object,with help of which you read the content to richtextBox1, and forget to close file handle.
 
So, when you tries to save data, you will get an error, because the file handle
on which you tries to perform save action wiil fail , because it had already been opened. so as a result do not forget to close a handle on opened streams!!!!
Oleksandr Kulchytskyi at 2-Jun-12 3:30am View
   
This NT service was written by you? If yes , a you injected any logging capabilities?
If not, move in such way which was described by Mehdi Gholam.
Oleksandr Kulchytskyi at 1-Jun-12 17:59pm View
   
Is it any unclear moments ?
Oleksandr Kulchytskyi at 1-Jun-12 17:54pm View
   
=)) You should implement some class whith this method)
 
public static class NativeMethods
{
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
}
Oleksandr Kulchytskyi at 1-Jun-12 17:51pm View
   
=) Now issue became more clearly)
NativeMethods is a third-party class , which is not related to .NET environment.
Oleksandr Kulchytskyi at 1-Jun-12 17:48pm View
   
Yep ) it's an interesting article. Thanks for share link)
Oleksandr Kulchytskyi at 1-Jun-12 17:45pm View
   
Deleted
I'm glad that i helped you ;)
Oleksandr Kulchytskyi at 1-Jun-12 16:12pm View
   
Please, provide us with your internal implementation of SendMsg method.
Oleksandr Kulchytskyi at 1-Jun-12 15:20pm View
   
Great explanation =) I see you are very comfortable in server\client architecture, especially in net sphere.
It's a big pleasure to read you posts and solutions =)
Oleksandr Kulchytskyi at 1-Jun-12 14:15pm View
   
Using word periodically, i mean that client needs the data in interval of 3 to 1 second.
Oleksandr Kulchytskyi at 1-Jun-12 11:02am View
   
Величезне дякую ;-))
Oleksandr Kulchytskyi at 1-Jun-12 11:01am View
   
Yep, that is an amazing and astonishing answer =))
Thanks a lot to you =) My 5 points to you!!!!
Oleksandr Kulchytskyi at 1-Jun-12 10:45am View
   
Thanks a lot Tim, you gave me a useful links !!! my 5 to you ;)
Oleksandr Kulchytskyi at 1-Jun-12 8:01am View
   
SharpZilLib have ablity to compress multiple folders in parent.
Oleksandr Kulchytskyi at 1-Jun-12 7:26am View
   
Are you sure that The OpenFileDialogue opens the file ?))
As far as i know, it just return path of picked file.
The problem is not in that.
Better look how he is using StreamReader object.
Oleksandr Kulchytskyi at 1-Jun-12 3:59am View
   
In which format your data preserves??
Oleksandr Kulchytskyi at 1-Jun-12 3:39am View
   
You can do it by using xml serialization mechanism in NET environment. See link
http://msdn.microsoft.com/ru-ru/library/system.xml.serialization.xmlserializer%28v=vs.90%29.aspx
Oleksandr Kulchytskyi at 1-Jun-12 3:16am View
   
Well, it seems like your remote machine doesn't have ability to connect remotely via rdc. try to handle such issue by settings appropriate settings to rdc.
Oleksandr Kulchytskyi at 31-May-12 15:54pm View
   
Please provide us with some code fragment.
It's very difficult to figure out issue only with help of words....
Oleksandr Kulchytskyi at 31-May-12 15:51pm View
   
It's great that you mentioned about string concatenations.
Often it became a big punch for beginners, while they operate with string data.
Oleksandr Kulchytskyi at 31-May-12 12:19pm View
   
Yep , sorry it is my fault.
Depend on platform invoking from Advapi32.dll DuplicateToken method can return both int and bool.
In int implementation in case of success it returns 0;
So you can replace definition to follow:
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern int DuplicateToken(IntPtr hToken,int impersonationLevel,out IntPtr hNewToken);
 
or just change in code this snippet
if(DuplicateToken(admin_token, 2, out dupToken) != 0)
to this
if(DuplicateToken(admin_token, 2, out dupToken))
Oleksandr Kulchytskyi at 31-May-12 9:24am View
   
What about m_timer.Dispose() method?)
Read MSDN carefully) As far as you must know,in all classes which implement IDisposable must you must manually invoke Dispose() or incorporate it in statement using(m_timer) { ... }. This rule relate to classes which havn't Finalizators.
sasha4as05 at 30-May-12 11:13am View
   
Thanks for useful link , it content seems to be very helpful.
I am already using JpegBitmapEncoder, but i had some doubts about that)
sasha4as05 at 30-May-12 10:54am View
   
Yep, i can.
Undo() is not the same as CloseHandle. CloseHandle, release unmanaged resources which you created with LogonUser().
 
#region consts
const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
const int LOGON32_PROVIDER_DEFAULT = 0;
#endregion

#region Windowns API
[DllImport("advapi32.DLL", SetLastError = true)]
public static extern int LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);
 
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static extern bool CloseHandle(IntPtr handle);
 
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern bool DuplicateToken(IntPtr hToken,int impersonationLevel,out IntPtr hNewToken);
#endregion

IntPtr admin_token = default(IntPtr);
IntPtr dupToken = default(IntPtr);
WindowsIdentity wid_current = WindowsIdentity.GetCurrent();
WindowsIdentity wid_admin = null;
WindowsImpersonationContext wic = null;
string[] split = new string[1];
split[0] = "\\";
string[] temp = ServerName.Split(split, StringSplitOptions.RemoveEmptyEntries);
string domain = String.Empty;
string userName = ServerUserName;
string password = Password;
if (LogonUser(userName, domain, password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref admin_token) != 0)
{
if(DuplicateToken(admin_token, 2, out dupToken) != 0)
{
try
{
wid_admin = new WindowsIdentity(dupToken);
wic = wid_admin.Impersonate();
// do your thing
}
catch { } // if case of you do something with excepions
finally
{
if (wic != null)
{
wic.Undo();
}
if(admin_token!=default(IntPtr))
CloseHandle(admin_token);
 
if(dupToken!=default(IntPtr))
CloseHandle(dupToken);
}
}
}
sasha4as05 at 30-May-12 9:55am View
   
Nice solution, but you are not pointed to a few crucial moments.
First of all , admin_token needs to be released by calling WinApi method CloseHandle.
Second one, WindowsImpersonationContext implements IDisposable, so you should call Dispose() method.
sasha4as05 at 30-May-12 9:22am View
   
Deleted
First of all, you are performs such action in context of current running user on your local PC!! For user impersonation you should be looked at WinApi methods, and with help of P\Invoke use it.WinApi methods list see below:
- LogonUser;
- DuplicateToken;
- RevertToSelf;
- CloseHandle;
sasha4as05 at 30-May-12 8:10am View
   
All this stuff is intended to transfer the image that consist of remote user desktop capture. So as you understand , quality is mandatory requirement.
sasha4as05 at 30-May-12 7:29am View
   
As i know, Png image is more smaller than jpeg. Is it right?
sasha4as05 at 30-May-12 7:05am View
   
Oh, one more hint to increase application performance with method Freeze() ;) Thanks, i'll move forward to use that anyway.

Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid