[dba-Tech] VS.NET equivalent of single-row form

Arthur Fuller fuller.artful at gmail.com
Sun Mar 9 08:52:41 CDT 2008


I'm making big progress on this little toy! I'm writing a Sudoku problem
solver. Actually I have already written the solver code -- in TSQL no less
LOL), and I just need a test and display harness for it. I've tracked down
some allegedly difficult problems and the hardest one I've found so far
takes under 3 minutes to solve. No doubt the code can be optimized
significantly, but I wanted to see whether I could do it in TSQL rather than
simply using arrays, which would obviously be way more efficient.

Anyway, here's my current problem: I have a pair of forms, almost identical.
One addresses the Problems table, the other the Solutions table. The
Problems table has an Identity key. The stored procedure that does all the
magic creates a row in the Solutions table having the FK pointing to the
problem it solves.

I have a button on the Problems form that opens the Solutions form. I need
to pass it the ProblemID and have it do one of two things:

1. If the solution exists, open the form and display it.
2. If the solution doesn't exist, solve the problem, then open the form and
display the solution.

There is a potential wrinkle down the road, but I'm prepared to postpone
that part of the problem. (A given problem could have more than one
solution; this is generally considered bad form in posing the problem in the
first place, but that aside....)

Actually, there is a second problem, too, which I have thus far avoided
because I'm taking my problems from web sites and newspapers, so they all
contain problems with solutions. But in theory, a problem could be posed
that obeys the setup rules but has no solution. So eventually I will need a
timer so I stop looking after a while. I think. I'm not sure whether I can
prove that problem X is unsolvable, but that can wait for a while too.

Anyway, I'm way ahead of myself here. I just need to open the Solution form
on the right solution (identified by ProblemID), and to detect before I open
the form whether there is a solution -- a simple SELECT COUNT(*) but I'm not
sure how to code that and obtain the result in a variable for inspection so
I can act accordingly.

One more question: can I mix languages in a single module? e.g. write one
method in C# and another in VB and a third in Python? Not that I'd want to,
necessarily, it's more a theory question.

TIA,
Arthur

On 3/9/08, Arthur Fuller <fuller.artful at gmail.com> wrote:
>
> C# but I found it already. But I am going to do some parts of this thing
> in Python, if only for the exercise. I've been teaching myself Python, and
> have installed Iron Python, but haven't tried it out yet to explore the
> differences between it and classic Python.
> A.
>
> On 3/9/08, Rocky Smolin at Beach Access Software <rockysmolin at bchacc.com>
> wrote:
> >
> > Are you using VB.NET?  ASP.NET?  Something else?
> >
> > Rocky
> >
>
>



More information about the dba-Tech mailing list