Help Please: SQLCommand.CommandText Question

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

The question is that I created a SQLConnection and SQLCommand (by dragging
them onto the form), configured the commandtext property of the SQLCommand
and bound it to a DataList control and away it went. It's great. Except...

I'm "developing", and I use the term losely because you need a scanning
electron microscope to see any of the results, some ASP.NET pages with
Visual Studio .NET 2003.

I would like to programatically change what the commandtext is, but it's
like hidden up in this area that was generated by Visual Studio. So, I
guess the question is, how do I do that "the Microsoft way". All the
examples I've seen don't involve Visual Studio, and unless you drag the
objects out onto the form like it likes, Visual Studio just complains.

A little background, I'm really pretty new to ASP.NET, I'm trying to convert
an app that I had in ASP, converted it to PHP because it had the features I
was looking for, and now struggling to come back to Microsoft land. I've
got the majority of it functioning in asp.net, it's getting the data from
the database, populating a datalist control with my test query that I
manually typed into the property of the control, but now I can't seem to
figure out how to programatically build my SQL statement.

Please help me turn off my Linux box (which so far was easier to figure out
Linux, compile Apache and PHP and get working.)

I think one of the things I'm struggling with is Visual Studio. It has done
nothing but make my life harder. So, if anyone has any tips or books, or
sites that help with that tool I'd be ever so grateful.

Thanks,
Jeff
 
One good book for data access is "ADO.NET" by David Sceppa, Microsoft
Press. You're better off writing the data access code yourself rather
than relying on VS. Examples are in both C# and VB.NET.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
Thank you, I will check out that book.

It's just been a very frustrating experience so far with Visual Studio .Net.
I was able to get some stuff easily going with the Web Matrix and thought
that Visual Studio would be the better way to do some of these things. I do
like the some of the code behind features (stuff like type ahead features of
objects, that sort of thing) that you get with VS.NET, but it would seem
that VS.NET is making me want to pull out my hair and fighting every step
along the way.
 
I understand your frustration. .NET in general has a high learning
curve. You should also look around for a good ASP.NET book. Amazon.com
is useful because you can search for what you're interested in and
read the reviews other readers have posted for particular books before
buying.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
Back
Top