|
|
Hi Guys
k here is what's happening.I am supposed to check in the STUDENT table if a student exists and then check if a module exists in the MODULE table.If they exist in both tables I am supposed to add the student(studentNumber) and the module(ModuleCode) to the STUDENTMODULE table(register them for the module).this is to avoid registering students that do not exist in the database.
How do i do this? plz help
|
|
|
|
|
You may want to ask this in this[^] forum instead.
|
|
|
|
|
|
I have an application that needs to create SQL statements based on user selection criteria. Therefore, the specific items in the SQL query must be variables. Unfortunately, I'm seeing a problem with a variable that has a quotation mark in it, such as Mark's Fish Market. When the application puts Mark's Fish Market into a query structured something like the following SQL snippet, the application generates an error. What's the best way to encode this variable as a string literal?
AND Owner = '" + strOwner + "'
Thanks.
|
|
|
|
|
polishprogrammer wrote: I have an application that needs to create SQL statements based on user selection criteria. Therefore, the specific items in the SQL query must be variables. Unfortunately, I'm seeing a problem with a variable that has a quotation mark in it, such as Mark's Fish Market. When the application puts Mark's Fish Market into a query structured something like the following SQL snippet, the application generates an error. What's the best way to encode this variable as a string literal?
AND Owner = '" + strOwner + "'
Well, I wouldn't do that for a start. You've just opened yourself to a whole host of problems because of the potential of SQL Injection Attacks. Use parameterised queries instead - you can create dynamic queries with parameterised queries you know, so have a go at that instead.
|
|
|
|
|
OK. So, if I set this up as a parameterized query, will that automatically eliminate the problem with single quotation marks?
|
|
|
|
|
|
Then that's what I'll do. Thanks.
|
|
|
|
|
|
Yes, it will.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
You should really not use string concatenation in your SQL statements. This opens up to serious injection attacks. Do go the parameterized query route.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
I would like to create a proxy that communicates between C# and a Non-COM programming language (its DXL if interested).
What I want is to be able to get a c# application to call DXL methods and for a DXL script to call c# classes and methods. I know there is a way of doing it, and I know it is quite complicated and involved but for the life of me I can't remember the method.
Therefore, I was wondering if anyone on here would have any ideas.
Ta
Jon
ps DXl cannot interact with COM and is *NOT* an object orientated language.
|
|
|
|
|
So, I've essentially implemented a folder browser with a TreeView, and what I'm doing is trying to get it to remove flickering. Here's how it works:
Initially, say my folder structure starts like this, and the node that I want to refresh (folder nodes labeled with dots except for root) is indicated:
Root
|
|__. (node to be refreshed)
| |
| |__.
| |
| |__.
|
|__.
When I try to do the refresh, it ends up like this after I delete all the subnodes:
Root
|
|__. (in the process of being refreshed)
|
|__.
Then, it ends up like the initial diagram again. The problem is, I'm getting screen flickering everytime I do this operation. I've tried using TreeView.BeginUpdate() before calling the refresh, then TreeView.EndUpdate() after the refresh is done. Even when no folders have changed at all (i.e. the treeview ends up looking exactly the same in my Winforms application), I get the flicker. My assumption was that if the image on-screen didn't change, then nothing would have to be redrawn (thereby avoiding flicker). If not, then what assumptions can I make, and would there be any tips on solving this problem? Also, note that TreeView.DoubleBuffered doesn't actually do anything for this control.
|
|
|
|
|
Well, calling BeginUpdate should stop all drawing and I don't think there's much more you could try. The best thing I can think of is to create a new, temporary node and use that to do all the 'refreshing' on, then simply replace the old node. To be honest though I don't think it will be much help.
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Thanks for the reply. I found a way to do it by overriding WndProc, so I may use that, even though it doesn't seem like the nicest solution.
|
|
|
|
|
Hi,
Is there any .NET open source code or module available to check an email ID exist or not.
Like say domain name exist
emailid exist in that domain ...
Thanks in advance
|
|
|
|
|
You need to be clearer about what you want. Do you want to validate that the email address is properly formed or that it is a real address at the destination?
If you just want to validate it is properly formed there are a lot of different ways to do this, including using some of the built-in .NET classes or regular expressions. If you want to make sure it is a real address at the destination, the only real way to do this is to actually try sending a test message.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Best thing to do is to try sending the email, and if it comes back as undeliverable, then it probably doesn't exist.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello everybody,
I want to implement auto generated time table in my asp.net application
please help me out.
thanks and regards
susan
|
|
|
|
|
That's nice, do you have a specific problem?
|
|
|
|
|
thanks for your reply
can u know me the algorithm of time table and how to implement it.
|
|
|
|
|
Ill show you an algorithm of sorts...
you.GotHelp == false;
while(you.IsLazy)
{
string myStupidQuestion = "plz s3nd codeZ, urgentz";
you.GotHelp == RequestHelpOnCodeProject(myStupidQuestion);
if(you.PulledYourHeadOutYourAss & you.FeelLikeThinkingForYourself)
{
break;
}
}
string myBetterQuestion = "I have a program that needs to do A, B and C, ive tried X, Y and Z";
you.GotHelp == RequestHelpOnCodeProject(myBetterQuestion );
Get the picture? Go read this[^] before you post here again cause you'll only get flamed.
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Actually I had a similar question.
(I'll try to be as specific as possible)
- Here's what exactly I need to try to do - I want a table with 8 columns (one for each day and an extra for the time slots in each day). And I need 25 rows. I've tried using the TableLayoutPanel control but I'm not so sure how (or even if) I can edit the contents of the each cell in the table. I first thought that I'd add a textbox to each cell that the user can edit, but that seems to be a sort of brute force method and I was wondering if there was a simpler, less tedious method of doing the same thing. Possibly inserting an excel spreadsheet into the app, but I'm quite confused with the system behind that as well.
|
|
|
|
|
Hi,
I want to create an instance of a control from knowing its type:
Im using the following line of code which compiles (type is Type of user control):
Control control = (Control)Activator.CreateInstance(type);
But at runtime it gives the error:
Exception has been thrown by the target of an invocation
inner:
Input string was not in a correct format
source:
mscorlib
Anyone see what im doing wrong?
Thanks,
Chas
|
|
|
|