Forgive me, I'm trying

  • Thread starter Thread starter James Woody
  • Start date Start date
J

James Woody

Hello friends.

I would like to pull the value of one field from a local database and
display it on a page.
I spent an hour looking for the solution. I feel that is more than enough
dues to pay to the computer in the sky.

I don't want to use a dataReader or a sqlDepleter or a gridViewRepeater or a
SqlAdapterDefeater or listView or a FormViewDeleter or WebSplitterDataPart
or a dataGridViewForm or a FormGridDataCheater or BeechaMeaterRepeater or a
saladShooter or a validityDecoder or a DataGridRepeatForm or DataChair or an
UnfoldingWebFormPart or a lightWeightPewterRepeater or a JavaMagnet or
beanPoleGiantWigHoleBananaShoeHornWebBlowHorn or a
CatchOfTheDayPress1forWhatTheHeckCommand or a
ExceptionWebFormInstanceSplitter or an FoldingSeatBackChairResourceToolKit.

Is there anyway I can play the "Show me how this is less code" card and just
be shown how I can get this info and stick it, yes stick it, in a label or a
Hello World Message box?

Thanks for letting me play too.
 
I did, Dick.

Now answer the question or get out of the way. Put on some pants and go do
somehing
 
Imagine if you will, Jimbo, some jester posting a question to a newsgroup
along the lines of "How do I drive a car?". It's really quite simple to
drive a car, but to try to explain to a person who hasn't a slightest clue
would be an ominous task. There are so many basics that most of us drivers
take for granted, that you just wouldn't be able to assume was in place when
dealing with such an imbecile. You couldn't assume the guy had eyes, arms
and legs, or an I.Q. above 50. I mean, where would you even start?
 
Sorry, Rick that I Called you Dick. I meant to say Rick. Honest.

Now here's something that I found. It's just like i said, only in VB.
I explained it well enough the first time
imports system.data
imports system.data.sqlclient


Dim cnn As New SqlConnection("User Id=MyUserID;Password=MyPassword;Initial
Catalog=DBName;Server=255.255.255.255")

'Modify the SQL string to match your criteria
Dim cmd As New SqlCommand("Select Name From TableName where Id = 0", cnn)

label.Text = cmd.ExecuteScalar

'Don't forget to clean up your connection and cmd objects by setting them to
nothing
 
Nothing is NOT enough.
If there IS a .dispose in ANY object, it's really recommended you call that.
Nothing does not close the connection perse in this object.
(I can tell :) )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top