The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by vuphillip]

Hi Fergal,
I tried to run the example on chapter 4. It seems work pretty well but the
last one with 3-tier client. It connects to the database but doesn't save the
game. Could you please help me out with this problem ? Thanks.
Phhillip.
here is the part of codes

Console.WriteLine(bet.Message + 'u0009'); // Ring bell
Hand dealHand = machine.Deal(); // Deal a new game
Console.WriteLine("{0}", dealHand);
Console.Write("Enter card numbers (1 to 5) to hold: ");
string holdCards = Console.ReadLine();
Hand drawHand =
machine.Draw(dealHand.ToString(), holdCards, uiBet);
import-bot (20211) [Avatar] Offline
#2
Re: ConPok Database
[Originally posted by fgrimes]

Hi Phillip,

>> It connects to the database but doesn't save the game.

Are you sure it connects? I ask this because the first thing to check
would be the connect string in conpok.exe.config:

value="server=(local)NetSDK;database=poker;trusted_connection=yes"

You may need to change this to match your setup.

If you still have problems, I suggest you make the problem simpler by
writing a short test program that connects to the poker database and
inserts a record. (Just copy the code from the SaveGame method in bank.cs.)
If it fails on insertion copy the exception message and post it here, if
necessary.

Fergal
import-bot (20211) [Avatar] Offline
#3
Re: ConPok Database
[Originally posted by fgrimes]

Oooops... backslash trouble again. String should be:

value="server=(local)NetSDK;database=poker;trusted_connection=yes"