|
Hi,
for a database table having a foreign key refered to
another table, what advantage will it gain to have
the foreign key ? Will it faster in joining the refered
and referring table ? or something else ?
Thanks
|
|
|
|
|
Typically they are used for inner joins to prevent cartesian products
|
|
|
|
|
foreign keys are used for checking references between records in different tables. With a constraint defined a record cannot be removed as there is a reference to a record in an another table.
'A programmer ist just a tool which converts caffeine into code'
|
|
|
|
|
Thanks.
So what will happen in the database if the foreign key relation
are violate in MySQL, will the database return an exception or something else ?
|
|
|
|
|
In that case database suppose to give constraint error.
- ashish
|
|
|
|
|
Hi
For the database reader e.g. dr.GetInt32(column0),
what will it get if the database record value is null for the column ?
Will it get 0 ?
Thanks
|
|
|
|
|
It should throw an InvalidCastException if the column is null. You need to check for null before attempting the cast.
|
|
|
|
|
sorry,
I just mean that the cell in database is null, but not the column is null, so will it return zero ?
|
|
|
|
|
You'll get an exception. 0 is a perfectly valid value, and NULL means no value at all. So, you have to use the IsDBNull method to determine if a field is null .
int ordAge = rdr.GetOrdinal("Age");
if(!rdr.IsDBNull(ordAge))
{
Console.WriteLine("Age: {0}", rdr.GetInt32(ordAge));
}
else
{
Console.WriteLine("No age specified.");
} -- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
|
Since I have no idea what the application is, why it needs to generate a file (why not just hold the sensitive data in memory?), or any other detail I can only speculate on what security options are available. As I said, a file lock does not secure the contents of the file. You need to actually use security to do that. There is plenty of documented stuff on principals, NTFS file permissions and other stuff (encryption on the application and file system level). Since I don't know what you are trying to do I can't tell what is best.
|
|
|
|
|
Hi everybody,
I have a form with a listview, among other stuff, and a "print" button. What i want to do is like having a template, and each time i print something, depending in what i've selected from the listview, i have to replace some text in that document with the value of the selected item in the list view. Of course, i have to make sure that the formatting part is also done (spaces between lines, titlesand so on). Can you recomand me the best way?
Thank you!
|
|
|
|
|
sir i'm somasekhar working as a s.w.engg in a small comp.i saw dynamic menu creation in codeproject .com by krishna_accent.pls send a src code without use menu.js.pls send how to create menus using sqlquery and dataset .my database tables is same as what u provided a xmldata schema.pls help me sir.iam a fresher and new to .net.pls sir understand my problem.my mail id is
sekhar.gunta@gmail.com
|
|
|
|
|
Hi - if you're trying to talk to someone who wrote a specific article, you should post to the forum for that article.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm running into a program successfully sharing a C# program with a fellow developer. We're each working on separate aspects of an application on our local drives, but sharing updates via a network. When we upload the C# application from the network, the DataAdapters for our projects need to be reconnected through the 'Configure Data Adapter' despite the fact that we hold the database for the project in the same location on our local drives. Is there a way to avoid that?
|
|
|
|
|
You should consider making the "location of the database" a config file setting. You can have a layered approach to config files such that there is a generic application config file and your user settings config file.
|
|
|
|
|
Hi Everybody!
I need to hide some running program from the taskbar. I explain better..
From the active processes list, i must select one of this and hide its bar from the taskbar!is it possible??
Any suggestion??
How can i do it?
Thank you!
I'm sure you can help me!
Enrico
-- modified at 11:22 Wednesday 26th October, 2005
|
|
|
|
|
|
ehm...if u want really know i explain to u!
im a student and when the teacher come to check what i am doing, i want to hide all the application not allowed
if i'm watching internet explorer i must be able to hide it by a key press
If u have any suggestion...
|
|
|
|
|
Come si chiama il tuo prof?
|
|
|
|
|
è il mio prof di informatica lol
si kiama rossi...
ma qua non mi vogliono dire niente uffa
|
|
|
|
|
I have a suggestion: don't abuse computer resources you don't own. Easier and more cost effective than any code we can give you. Since you want the solution cheap, this is all the advice I can afford to give you.
|
|
|
|
|
nice words but...that's not the only reason..
i'm curious and i want learn the C#..
i think the first step is to make the programs which i need (i'm speaking generally).
so if u want to to help me i'll be glad..on the contrary no problem..
|
|
|
|
|
What you want is probably impossible without using low level API calls. This is not a good way to learn a language, even if you were already familiar with the relevant api from C/C++ work.
|
|
|
|
|
ventomito wrote: If u have any suggestion...
2 keystrokes instead of one. Alt-f4.
|
|
|
|