|
I understand that article is from 2007, but I'd completely disregard it. It was completely bad practice even "back then". Definitely is horrible practice today. Use a proper data access layer like EF, nHibernate, etc. At the very least, if you use barebones ADO.NET, you should not write queries in the C# code like that. Completely vulnerable to a script kiddie who knows SQL injection.
|
|
|
|
|
SledgeHammer01 wrote: Completely vulnerable to a script kiddie who knows SQL injection
Bullshit -- it fully and easily supports parameters so there's no reason a developer has to leave himself open to that.
SledgeHammer01 wrote: EF, nHibernate, etc
And what do you think they do in the background? Exactly the same things I do. Everything has to go through a command and connection eventually; I cut out the middle man. Additionally, those tools may not support whatever database the OP has to use, whereas there is probably an ADO.net connector for it.
|
|
|
|
|
SledgeHammer01 wrote: It was completely bad practice even "back then".
Nonsense.
SledgeHammer01 wrote: you should not write queries in the C# code like that. Completely vulnerable to a script kiddie who knows SQL injection.
You and I must have completely different definitions of SQL injection then.
I don't see anything in there that suggests anything at all like that.
|
|
|
|
|
Most of the ORM providers are bult upon ADO.NET.
but personally I dont think there is anything wrong with using ADO.NET, SQL Injection is only possible when there is a lack of parameterised queries.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Just do a search in the articles section on this site.
There are a number of good samples and articles here.
|
|
|
|
|
Actually i have one local area map i want to mark my location in one particular area in that local map.....How can i mark my location????
Pls give article or coding related this concept.
For Example i have America map means i want to specific my location in new work...how we can do this????
|
|
|
|
|
Not google maps so which mapping system?
What are you using to query the map? C#, JavaScript etc?
Are you stuck? If so where and what have you tried?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
i had america map(dynamic map) in my web page. In this map ,while i'm moving mouse to some states position , want to shows like that state information in chat box or some message box i.e. state name, weather-condition,etc...
I'm doing this project in c#.net....so pls guide me....
|
|
|
|
|
chat application in asp.net c# workflow
|
|
|
|
|
with that little help on what your problem is or what help you need to start this project I would recommend that you have a read here
Just another chat application using SignalR[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I am developing an c# application and it uses many .net assemblies. For some reason i need to move a dll to program files folder and that dll depends on many other assembly present in the application folder and this makes me to copy all dependent dlls to programfiles folder. This will cause duplication of dll in both application and programfiles directory. I know that moving dependent assembly to GAC will resolve this issue but i shound not put many assembly in GAC. So please suggest a way to make .Net dll to reference its dependent dlls.
modified 23-Dec-12 0:22am.
|
|
|
|
|
whoever reading this actually i am into a project where we have to make an application that should generate a website as per the requirements of the user. its kind of web-portal. so if any body coould help.
|
|
|
|
|
What is your actual question? Do you have code that you are having a problem with or are you just fishing for someone to give you code?
|
|
|
|
|
I actually want to build a CMS for simple dynamic web pages as per user requirement. but i dont know from where to start but i have to do this with .net and i am a beginner in .net and i have been assigned this project. so if some one can give me any idea about what i have to do then it will be really helpful,i don't need the code but i need a direction that from where should i begin.
|
|
|
|
|
hi all,
i am working on a basic challenege for my course in C#, i have got to the point where i need the loop to do its actions until 2 statements become true but my program runs through the loop once and one statement becomes true and other false and then it jumps out of loop so i need to know what i have done wrong with the code or any advice please?
int z = 2;
if (remaindernum != 0 & remainderden != 0)
{
while (z <= totala)
{
while (remaindernum != 0 & remainderden != 0)
{
remaindernum = (newfraction % z);
remainderden = (totala % z);
z += 1;
}
}
}
just to clarify pretending my first line of code is 0,
it runs through fine till line 15 then goes back into loop at line 7 but then jumps down to line 16 and sticks in neverending loop
|
|
|
|
|
I suspect you want OR rather than AND. You may also want to use the Logical operators rather than the Bitwise ones.
|
|
|
|
|
basically its a loop to simplify a fraction , so i need that loop to keep running until both statements are true?
|
|
|
|
|
also should i be using a do statement for this kind of thing?
|
|
|
|
|
|
You are using the wrong operator, it should be the double ampersand thus:
if (remaindernum != 0 && remainderden != 0)
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello,
I have a table consisting of following columns and data
Msg_count Latitude Longitude Utc_Time
16 56.6650356667 12.8772211667 142640
24 56.6650415 12.8772395 142640.25
35 56.6650475 12.8772581667 142640.5
26 56.665053 12.8772778333 142640.75
23 56.6650593333 12.8772976667 142641
26 56.6650656667 12.8773183333 142641.25
25 56.665072 12.8773388333 142641.5
15 56.6650785 12.8773598333 142641.75
i need to find out sum of messages transmitted every second.
For eg. when i group (142640, 142640.25, 142640.5, 142640.75) it makes 1 sec and total number of messages sent during this interval are
16+24+35+26=101
I don't know how can do this.
I am using PostgreSQL and C#.net
Does anyone have suggestion
Regards..
Tasha
|
|
|
|
|
This isn't really a C# question, it would have been better to post in the SQL forum, but:
One solution (the one I'd use is
- round the
Utc_time to the second, the rounding function you need depends whether you want to round up, down or to the nearest value - Group by the value from step 0, getting the count
|
|
|
|
|
I am doing hospital project(desktop application)
I am using SAP crytal reports for prescription & certificates.
Here is my code:
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(@"D:\Paranjpe_Hospital\Paranjpe_Hospital\CrtlRpt_OPD_pres_gen.rpt");
cryRpt.SetDataSource(ds.Tables[0]); //check it by writing only ds
Print_All_Certificates opd_pres = new Print_All_Certificates();
opd_pres.crystalReportViewer_all_certificates.Refresh();
opd_pres.crystalReportViewer_all_certificates.DataBindings.Clear(); //check it
opd_pres.crystalReportViewer_all_certificates.ReportSource = cryRpt;
opd_pres.Show();
Here problem is that ,when I printing prescription,it is always showing 1st prescription.
So,everytime I have to click on > ("Go to last page") in cryatal report viewer then it shows current prescription & then I am printing it.
How can I print current prescription without clicking on > ("Go to last page") in cryatal report viewer?
Please tell me solution of this problem.
|
|
|
|
|
Did you fill that table with just the one record you want to print or did you fill it with ALL the perscriptions in the table? Hint, hint.
|
|
|
|
|
Yes. I filled that table with just the one record I want to print.
In other words I am saving one prescription as one record in a table.
|
|
|
|