|
Obligatory chocolate covered bacon post:[^]
Couldn't find the coffee covered bacon; chocolate will do.
Oh, and the chocolate coffee beans have been around since the dinosaur days. Just saying...
|
|
|
|
|
Did you try bacon covered coffee?
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|
Being a student, I am now able to understand the pain students have to go through because of their professors. I am currently having my exams and my teacher was teaching us web development. There is a question, "write the procedure to connect to database".
Rings some bells? Of course it should, at first I thought it was a question from a non-Googling-OP. No framework given, no guidance on what framework we are talking about, no name of database. Teachers really are sneaky suns o' beaches! Besides, he wouldn't care about anything, and will say, it was your duty.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I think you have gone some way to answering the question in noticing that no specifics are given.
It's a good opportunity to show your skills for designing a 'framework' for connecting to a database that is agnostic with regards to the database it is creating a connection for.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Nah, too hard. Play Project Manager and call for a meeting inviting as many people as possible, and the more of them that have no relevance to the issue the better.
Sin tack ear lol
Pressing the any key may be continuate
|
|
|
|
|
YES!!! I like your thinking outside of the box. It could be a team building exercise
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: It could be a team building exercise
Like Paintball, but with real guns!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
GuyThiebaut wrote: YES!!! I like your thinking outside of the box. It could be a team building exercise
Because "getting people into a BOX" is the first step in thinking outside of one?
|
|
|
|
|
It is a question in exam. We either can get full marks, or get a zero.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: There is a question, "write the procedure to connect to database". Procedural web-development? Yup, sounds like a "professor".
In the modern world, the framework provides interfaces to connect. Set the factory in the config file and of you are.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
If only it was that simple.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
If you are using .NET, it is. As long as your SQL is SQL92 compliant, you'll be able to talk to most databases using simply some configuration.
Documented on MSDN
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I guess the word procedure is meant in its literal format, if so my answer would be the script/code to connect to mysql via php using your own db table username and password, and an explanation of what the arguments are for in the connection code. You might get extra marks for inferring about a stored procedure and need a connection to access the SP.
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: No framework given, no guidance on what framework we are talking about, no name of database.
void Connect(IDb db, string dbName)
{
db.Connect(dbName);
}
Done!
Marc
|
|
|
|
|
That's a method, not a procedure
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: That's a method, not a procedure
Well, SQL Server can run C# code.
Marc
|
|
|
|
|
|
PIEBALDconsult wrote: con.
let us debate the use of meaningful names in one's code. con | cnx | cn or my favorite connection.Open()
or not.
|
|
|
|
|
Maybe his framework doesn't allow names more than four characters long.
|
|
|
|
|
public void CheckDatabaseConnection()
{
try
{
using (new MyDbContext())
{
return true;
}
}
catch (Exception ex)
{
return false;
}
} I think that should be it, from the top of my head
Of course I had to make some assumptions regarding language, framework and database, but they weren't mentioned
|
|
|
|
|
void or bool on your method signature return type?
|
|
|
|
|
Uhhh... Yes, that was the homework!
Spot the error.
You passed the test.
Good work, young padawan.
|
|
|
|
|
|
1) open an editor
2) start typing the code
3) when coding ready, compile it
... 3a) If compiling errors, solve them
... 3b) If no errors, go to next point
4) test the application and search for runtime errors
... 4a) If runtime errors, solve them
... 4b) If no error, go to next point
5) deploy
is the procedure clear enough?
I'll go get my coat
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
it's like real life!!
your clueles boss comes up with vague spec.
You need to discuss with him for some possible solution...
|
|
|
|