|
how to retrieve combobox values ,I am unable to do that,could you please help me.i want the combobox values to remain same until the close of main form i.e form1.i am trying from two days ,please help me to come out of it.
|
|
|
|
|
Hi,
We know First time EF loads metadata into memory, that takes a time and it will be faster in the seconed time because the EF metadata was loaded in the memory, my question is:
In the Web Application (MVC or Classic Web Application) is the EF must loaded every request or it is loaded at the first time.
Please let me know the Best way to get the Best Performance of the EF.
Please let me know what is your recommended technology to use in our system (MVC with EF), (Web Application with ADO.Net),...
We need to use a technology with the following criteria:
1- Portability: Run across different platforms
2- Mobility: Mobile application
3- Scalability: Capability to handle growing of work amount (Small, medium, and
large business or data).
4- Security: Protect against malicious attack and other hacker risks
5- Cloud
6- Licensing: License price to use the technology
7- Performance
8- DB independence: Could be used with any Database (MS SQL, Oracle, MySQL)
9-Maintainability: The degree to which an application is understood, repaired, or
enhanced.
10-Product type: desktop, web, mobile.
11-Also what is your recommended 3td party tools such as DevExpress,...etc
Thank You
modified 1-Aug-16 2:31am.
|
|
|
|
|
EF is bootstrapped (the object model is generated) once in service-based applications, and as often as IIS feels like in IIS-hosted applications. On IIS, the system handles memory management and may pop your application at any time based on usage.
As portability, scalability, and interoperability are your key metrics, you'll likely need to roll your own ORM abstraction layer. That layer will need to be able to interface with different platforms (so target .NET Core), and will likely need to be controlled via configuration, and provide an interface that can be implemented across a wide spectrum of technologies (ALL databases also includes document stores, object graphs, and even flat files, just to name a few).
That also means that you'll need to build an interface for every platform that you want to talk to. To my knowledge there is no magic "Anything-to-Anything" ORM.
My suggestion: narrow your focus so that you can pick suitable technologies. You need an architecture and it's pretty clear that you do not have one.
My other suggestion: You have both mobile app and cloud picked as application types. That's inherently nonsensical; that would be at least 2 different applications. One would be a native device app (or possibly several, since you're trying to support multiple platforms) and most likely a RESTful micro-service back-end (which is where your ORM would most likely live).
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
A solution looking for a problem.
|
|
|
|
|
zead jalil wrote: Please let me know the Best way to get the Best Performance of the EF. Use a different tool. As suggested you should probably roll your own ORM/DAL.
What you are asking for is a recommendation for full stack development, not something you can get from a forum post. You need an experienced architect or very senior developer to sit down with you and go over your requirements in detail, probably over a number of days. Then generate a high level design document, that should take a few more days.
You are still going to get that persons preferences/prejudices as no one person is going to have detailed knowledge of all the technologies you have covered.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello, I want to create a calculator, so I need and I want to build a class of Math Parser that good word and functioned buy me, any can help me to do it?
Exm: ( 1 + 3 * 8 ) / 5 + 3 ^ 10 + 9 Mod 2 = ?
please Easy describeو step by step and simple
|
|
|
|
|
|
it was english, do you have a persian document?
|
|
|
|
|
This is an English site: all the documents will be in English.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Im doing some online course, I'm trying to learn C # . It appears to me that i created infinite loop. Any hepl?
class Program
{
public static int Sum(int start, int end)
{
if (start >= end)
{
return 0;
}
else
{
return Sum(start, end);
}
}
static void Main(string[] args)
{
int start, end;
Console.WriteLine("ukucajte prvi broj");
start =Convert.ToInt32(Console.ReadLine());
Console.WriteLine("ukucajte drugi broj");
end = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("suma je: " + Sum(start,end));
Console.Read();
}
}
}
|
|
|
|
|
Well, yes...
public static int Sum(int start, int end)
{
if (start >= end)
{
return 0;
}
else
{
return Sum(start, end);
}
}
If you call Sum with start less than end:
Sum(1, 2); Then it will look at the two values, and see which is the greater.
It's end , so the if test will fail, and it will execute the else clause ... which passes the same values to the Sum method so it does teh same thing again, and again, until it runs out of stack space and fails!
Probably, what you meant to do was
return start + Sum(start + 1, end); But to be honest, a recursive method to do this is a bit overkill!
Why not try it with a simple for loop?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I'm getting unstructured data in a string field. I told the Db guy to put it in a JSON string and I use NewtonSoft to parse it out. I know what I am getting (maybe) and it is different for each Business Unit and even for parts of Business Units. For example, originally I got strings from the Db guy like:
"MCCFL: unique_id=1709", "MCCFL: DetailID=80" and "TCCM: unique_id=1166"
Not too helpful, so for the next business unit, I said I wanted JSON, so I got something like:
{"BU":"MRXE","unique_id":"4208","job_id":"1395","track_number":"9012712162","job_count:1"}
That would make the previous strings look like:
{"BU":"MCCFL","unique_id":"1709"}, {"BU":"MCCFL","DetailID":"80"} and {"BU":"TCCM","unique_id":"1166"}
Notice that all of these represented as a data structure or object, would be quite different, so I parsed it with NewtonSoft thus:
dynamic deserialized = Newtonsoft.Json.JsonConvert.DeserializeObject(strData);
if (deserialized.BU == null)
strError = "BU";
else
{
this.BusinessUnit = deserialized.BU;
strBusinessUnit = this.BusinessUnit;
}
if (deserialized.job_id == null)
strError = "job_id";
else
this.str_job_id = deserialized.job_id;
...
...
Now the point of this is that I had been considering do I want to use NewtonSoft. It's supposed to be light weight, but I could go retro and get my string like this:
BU:MRXE|unique_id:4208|job_id:1395|track_number:9012712162|job_count:1
Then I could use this:
public static string Return_StringValueForString(string strInBarSeperator, string strValueToFind, out string strValueFound, out int iValueFound)
{
strValueFound = String.Empty;
string strError = "Error-";
iValueFound = 0;
if ((strValueToFind == null) || (strInBarSeperator == null))
{
strValueFound = strError;
return strError;
}
string[] strarr = strInBarSeperator.Split('|');
if (strarr.Length < 1)
{
strValueFound = strError;
return strError;
}
int iPositionInString = 0;
for (iPositionInString = 0; iPositionInString < strarr.Length; iPositionInString++)
{
if (strarr[iPositionInString].Contains(strValueToFind) == true)
break;
}
if (iPositionInString == strarr.Length)
{
strValueFound = strError;
return strError;
}
string[] strarr2 = strarr[iPositionInString].Split(':');
if (strarr2.Length < 2)
{
strValueFound = strError;
return strError;
}
strValueFound = strarr2[1];
int ii = 0;
if (Int32.TryParse(strValueFound, out ii) == true)
iValueFound = ii;
else
iValueFound = 0;
return strValueFound;
}
Now there is another version more specialized for getting an integer, but that is a changed line of code:
public static int Return_IntValueForString(string strInBarSeperator, string strValueToFind, out string strValueFound, out int iValueFound)
The point of posting this is what do you think? I think I'm going to remove the NewtonSoft assembly. I have no need for it and this code should be both simpler and more efficient. Partly it is a question about the efficiency of NewtonSoft and partly abous the "dynamic" variable. The method is a bit quick and dirty and cannot be used to return a value of -1, but nothing in the application should be able to generate a negative number anyway... and that would be an easy update if desired. This should be more versatile actually, a bit less coding. Can you see any problems with the plan? I'm going to need this in a lot of places. T'anks. M
|
|
|
|
|
Can you absolutely guarantee that the names and values will never contain either the : or | characters?
If not, then your "retro" approach will need to come up with some way to escape those characters when they appear in a name or value. And suddenly your parsing code becomes significantly more complicated.
With JSON, you can avoid the dynamic overhead by deserializing to a concrete type:
public class YourClass
{
public string BU { get; set; }
public string DetailID { get; set; }
public string unique_id { get; set; }
public string job_id { get; set; }
public string track_number { get; set; }
public int job_count { get; set; }
[JsonExtensionData]
public IDictionary<string, JToken> AdditionalData { get; set; }
}
...
YourClass data = JsonConvert.DeserializeObject<YourClass>(strData);
or to a dictionary:
var data = JsonConvert.DeserializeObject<Dictionary<string, object>>(strData);
The only real way to know which option is more efficient is to profile your code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
There is no way to make an object up front for a concrete type, since I don't know what is going to be required from Business Unit to Business Unit. I suppose I could add and add as it goes along, but...
I may have to play with that dictionary idea though. I wonder if this would work?
var data = JsonConvert.DeserializeObject<Dictionary<string, string>>(strData);
|
|
|
|
|
Michael Breeden wrote: I wonder if this would work?
Yes, that works.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Fazinating... It does work. Didn't know that.
var data = JsonConvert.DeserializeObject<Dictionary<string, string>>(strData);
A. Worked - made dictionary[string,string]
{"BU":"MRXE","unique_id":"4208","job_id":"1395","track_number":"9012712162","job_count":"1"}
B. Worked - made dictionary[string,object]
{"Parts":{"unique_id":"4208","job_id":"1395","track_number":"9012712162","job_count":"1"}}
C. Failed... even with brackets... I bet it could work..
{"Parts":{"unique_id":"4208","job_id":"1395","track_number":"9012712162","job_count":"1"}}, {"Parts":{"unique_id":"4208","job_id":"1395","track_number":"9012712162","job_count":"1"}}
|
|
|
|
|
Example C is some pretty nasty JSON. Even if you put square brackets around it, you would need to deserialize as a List<Dictionary<string, Dictionary<string, string>>> .
var data = JsonConvert.DeserializeObject<List<Dictionary<string, Dictionary<string, string>>>>(strData);
That would give you a list of two dictionaries, each containing a single key called Parts , the value of which would be a dictionary containing the unique_id , job_id , track_number and job_count .
If the source data is that variable, you'll probably be better off sticking with LINQ to JSON[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Well I should never hit that situation anyway and your suggestion did give a solution to the problem without using a dynamic or needing a concrete object. I like Dictionaries.
Thanks for the suggestion, Mike
|
|
|
|
|
Hi every one
I have project made in Ms access contains over 40 forms
is there any way to convert Forms form access to c#.net (just Forms, I don't need any thing else)
can any one help me!!!
thanks to all
|
|
|
|
|
|
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
A very quick search gave over a million hits: convert access forms to c# - Google Search[^]
In future, please try to do at least basic research yourself, and not waste your time or ours.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I know that google is best choice
I spend time to search on google but I didn't find useful answer
so I came to this website
if you think that my question waste your time,simply you could ignore it without answer it
finally thank you for your reply
|
|
|
|
|
I know that google is my best choice
I did search on google but i didn't didn't find useful answer
if you think that my equation waste your time, you could simply ignore it and don't answer it
finally thank you for your answer
|
|
|
|
|
The advice you have been given to post this on a QA forum reflects the fact that traditionally this forum has been more for C# language issues.
Looks to me like you will either have to re-create the Forms/Controls yourself: [^]; perhaps there's a commercial application, but I bet it would be expensive.
Try not to take responses to you here personally; we're here because we wish to assist you and others, and most of us actually enjoy doing that
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
thank very much for your reply
as you said I found commercial tools to do that but again as you said it's expansive
so I was looking if there is another way
thank you again
|
|
|
|
|