|
Not sure why you got downvoted so I countered it with an upvote.
I haven't used EF yet. I had some code that was partial EF and partial plain ADO.Net and I removed the EF and replaced with out sql helpers classes.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
In my experience, if your application is using OOD then I would prefer EF.
|
|
|
|
|
I'm old school so I refuse to work with EF, every time I see it used by other developers I see situations where they simply state that they cannot do something because of the way EF is wired up.
Using multiple databases in one app tends to be a bit of a nightmare as well.
I use a class that was created in the 90s and has had a number of minor modifications (not including change of language 3 times) since. It is lighter weight, more flexible and I know PRECISELY what is happening so I control my data interface.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
shiv Mohan wrote: Many Experts including Martin Fowler hates ORM , what's your say on this ? I think you should ask "why does Martin hate ORM". Hate is a too strong emotion that kills objectivity. ORM's can add value sometimes, for a price. We got some members that passionately hate triggers - but they will not say that they should be avoided at all costs!
As for the DAL, this is very often a layer that functions merely a a door, without adding any value. SQL is already an abstraction layer; you work with an abstraction of records and relations, not with flat files on the system.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: We got some members that passionately hate triggers Guilty
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I successful converted my project from VB to C# than I deleted an Equipment form from my C# project but when I run my C# project the form appeared in debug mode, How to solve this problem?
|
|
|
|
|
Probably, you didn't compile it after removing the form, or the compilation failed.
Did it say something along the lines of "do you want to run the last successful build instead?" and you said "yes"?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
It says "do you want to run the last successful build instead?";
then I press "Yes";
|
|
|
|
|
So...you try to compile it, it can't do it completely because of errors, then you run the "last successful" build and expect it to have your latest changes in it?
Tell me, if you go the the supermarket and don't have any money on you when you try to pay, does the checkout person say "would you like the previous customer to pay for you?" - because that is what you are trying to get the system to do.
When you compile a program, any errors prevent the system from producing a new executable file - so the exe that is run is the last version of your code that had no errors, not the latest version with your changes. In order to run your code with your changes included, you have to look at and fix the errors that the compiler found and told you about.
So what errors did you get?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
WOW Thanks ORIGINALGRIFF;
It's sorted now thanks hey....
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi all,
i have a .dotx file with some custom property that i have to change by C#. I have downloaded OpenXml sdk library and i just found a way to find all custom properties in a word document but i don't know how edit their value. For example : custom property "Author" with value "Sam" become "Simon".
Any ideas?
Thank you
|
|
|
|
|
|
hello experts,
i am appreciating some help in if then else statement in crystal report.
numbervar x:={ev1.Hpronunciation};
if({ev1.class}="LKG" OR {ev1.class}="UKG") then
(
if(x>=9 and x<=10 )
then
"A+"
else if(x>=6 and x<=8 )
then
"A"
else if(x>=4 and x<=5 )
then
"B+"
else if(x>=3 and x<4 )
then
"B"
else if( x<3 )
then
"C"
else if( x=999 )
then
"AB"
else if( x=0 )
then
"*"
else
"")
else
(
if(x=5 )
then
"A+"
else if(x=4 )
then
"A"
else if(x=3 )
then
"B+"
else if(x=2 )
then
"B"
else if( x<2 )
then
"C"
else if( x=999 )
then
"AB"
else if( x=0 )
then
"*") ;
i am getting correct result for first condition ,but blank result for else ,can any one help me figure out where i am wrong
|
|
|
|
|
You should not be doing this processing in the report, it should be part of your dataset and supplied in the source query/procedure.
A report should only do grouping and totally on a processed data source. there are exception but this is not one of them.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
please check your last condition part in Else that is
Correct code - New code
else
(
if(x=5 ) then
"A+"
else if(x=4 ) then
"A"
else if(x=3 ) then
"B+"
else if(x=2 ) then
"B"
else if( x<2 ) then
"C"
else if( x=999 ) then
"AB"
else "*") ;
instead of
Error in your code - Old code
else
(
if(x=5 ) then
"A+"
else if(x=4 ) then
"A"
else if(x=3 ) then
"B+"
else if(x=2 ) then
"B"
else if( x<2 ) then
"C"
else if( x=999 ) then
"AB"
else if( x=0 ) then
"*") ;
Don't use then in last else portion and remove last else condition that is if(x=0).
|
|
|
|
|
I don't have any conditions but the OP may still have.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have .NET WinForm application in C# and I will make Web application for it using PHP.
I would like to ask what's the best way to encrypt / decrypt user authentication so it wll work on both WinForm and PHP portal?
I am currently using this in C#:
user_password = cipher_utility.Encrypt<RijndaelManaged>(result, "xxxx", "xxxxxxxxx");
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace Application_Class_Library
{
public class cipher_utility
{
public static string Encrypt<T>(string value, string password, string salt) where T : SymmetricAlgorithm, new()
{
DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt));
SymmetricAlgorithm algorithm = new T();
byte[] rgbKey = rgb.GetBytes(algorithm.KeySize >> 3);
byte[] rgbIV = rgb.GetBytes(algorithm.BlockSize >> 3);
ICryptoTransform transform = algorithm.CreateEncryptor(rgbKey, rgbIV);
using (MemoryStream buffer = new MemoryStream())
{
using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Write))
{
using (StreamWriter writer = new StreamWriter(stream, Encoding.Unicode))
{
writer.Write(value);
}
}
return Convert.ToBase64String(buffer.ToArray());
}
}
public static string Decrypt<T>(string text, string password, string salt) where T : SymmetricAlgorithm, new()
{
DeriveBytes rgb = new Rfc2898DeriveBytes(password, Encoding.Unicode.GetBytes(salt));
SymmetricAlgorithm algorithm = new T();
byte[] rgbKey = rgb.GetBytes(algorithm.KeySize >> 3);
byte[] rgbIV = rgb.GetBytes(algorithm.BlockSize >> 3);
ICryptoTransform transform = algorithm.CreateDecryptor(rgbKey, rgbIV);
using (MemoryStream buffer = new MemoryStream(Convert.FromBase64String(text)))
{
using (CryptoStream stream = new CryptoStream(buffer, transform, CryptoStreamMode.Read))
{
using (StreamReader reader = new StreamReader(stream, Encoding.Unicode))
{
return reader.ReadToEnd();
}
}
}
}
}
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
As has been explained in your previous question, you should never encrypt passwords. Use a one-way hash with a salt value and store that in your database. When someone tries to login you compare the hashed value with what is stored. In that way the passwords are much more secure because they cannot be decrypted. See Secure Password Authentication Explained Simply[^] for details on how it should be done.
|
|
|
|
|
I don't understand why my code snippet below won't find "14" and set the .SelectedIndex? The .Selectindex is always -1.
comboBoxLSKFontSize.Items.Add("10";);
comboBoxLSKFontSize.Items.Add("11";);
comboBoxLSKFontSize.Items.Add("12";);
comboBoxLSKFontSize.Items.Add("13";);
comboBoxLSKFontSize.Items.Add("14";);
comboBoxLSKFontSize.Items.Add("15";);
comboBoxLSKFontSize.Items.Add("16";);
stringLSKFontSize = "14";
i = 0;
foreach (string str in comboBoxLSKFontSize.Items)
{
if (stringLSKFontSize == str)
{
comboBoxLSKFontSize.SelectedIndex = i;
break;
}
i++;
}
|
|
|
|
|
Your code would work if you cleaned up the many obvious syntax errors in it so it would compile without error !
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
As Bill says: if you fix the syntax errors by removing the spurious semicolons:
comboBoxLSKFontSize.Items.Add("10");
comboBoxLSKFontSize.Items.Add("11");
comboBoxLSKFontSize.Items.Add("12");
comboBoxLSKFontSize.Items.Add("13");
comboBoxLSKFontSize.Items.Add("14");
comboBoxLSKFontSize.Items.Add("15");
comboBoxLSKFontSize.Items.Add("16");
stringLSKFontSize = "14";
i = 0;
foreach (string str in comboBoxLSKFontSize.Items)
{
if (stringLSKFontSize == str)
{
comboBoxLSKFontSize.SelectedIndex = i;
break;
}
i++;
}
Then that code should work, assuming that stringLSKFontSize and i have been declared. But with the errors, it won't compile, which means that it doesn't produce an executable file, so you will be running the last version that did compile correctly and your changes do not have effect.
If once it compiles you still have the problem, then use the debugger by putting a breakpoint on the line:
stringLSKFontSize = "14";
And step though your code to find out exactly what it is doing.
And you do realise that you don't have to do that at all, right?
comboBoxLSKFontSize.Items.Add("10");
comboBoxLSKFontSize.Items.Add("11");
comboBoxLSKFontSize.Items.Add("12");
comboBoxLSKFontSize.Items.Add("13");
comboBoxLSKFontSize.Items.Add("14");
comboBoxLSKFontSize.Items.Add("15");
comboBoxLSKFontSize.Items.Add("16");
comboBoxLSKFontSize.SelectedItem = "14";
Will do exactly the same thing...
BTW: It's not considered good practice to put the type of the variable as part of the variable name: you should consider using just LSKFontSize and LSKSelectedFontSize instead. Visual Studio will tell you the type of a variable if you just wave your mouse over the variable name.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks for taking the time to detail your response Griff...!!!
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
hi guys ;
how to add a image to header of exportinf pdf in devexpress gridview
|
|
|
|