VB or C# for SQL Server

W

William \(Bill\) Vaughn

You'll have to explain what that means when we meet in Redmond at the end of
September... ;)

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
S

Scott M.

Hold on a sec Bob. There are several things that you've written here that
I'm not sure are accurate or presented in the correct context. Please see
responses inline below:


Bob said:
Hello All:

Ok, sorry for the remark. I understand lang barriers as I'm American and
my wife is Indonesian.

My remark had nothing to do with that.

I spent days with Cor going round with a past issue I had and I did state
that did'nt want to use the bindingcontext(ds, "table").position to
achieve my goal. After a week of clarifying my question, he finaly
responded with a different way of using row positioning that would result
with the same issue as bindingcontext.

In any case, I found out on my own when I drove to NJ last weekend and
stayed at friends house who has a friend who has been programing VB since
mid 90's.

BindingContext is not something that was part of VB in the mid 90's, so why
would a freind of a friends prior experience with VB help solve a
BindingContext question?
I admit that my experiance only goes back to VB 6 (and very limited at
that) which began right before VB.NET came out.

Actually VB 6.0 came out about 6 years before VB .NET.

You also mention in your previous to this post that you seem to be having
trouble finding VB .NET answers but seem to be able to more readily find C#
answers. You are then supplying some possible reasonse for why you are
having a hard time finding VB .NET answers.

My response is "None of the above.". There is absolutely no shortage of VB
..NET documentation/help/newsgroup postings (msdn.microsoft.com, asp.net,
gotdotnet.com, google.com, etc., etc.). There are numerous books (I like
"Programming Microsoft Visual Basic .NET" by Francesco Balena (MS Press) as
it is 1300 pages of well written informaiton spanning a wide range of
topics. I guess I just don't "buy" the premise that VB .NET help is hard to
come by.
 
B

Bob

Scott:
BindingContext is not something that was part of VB in the mid 90's, so why
would a freind of a friends prior experience with VB help solve a
BindingContext question?

I realize BindingContext wasn't part of VB prior to .NET. Do you think this
friend didn't move on to study VB.NET? The fact that he has been using VB
since mid 90's was just a statement. My assumption was that you would assume
he learned VB.NET without me actually saying so. After all, my assumption is
that you studied it.

Actually VB 6.0 came out about 6 years before VB .NET.

I also know that. What I mean is that my experiance with VB 6 began right
before VB.NET came out.

I thought I wrote quite clearly. I think you're looking so hard to find ways
to shoot me down that your letting that get in the way of your own
interpretation of what I say.



Look folks. I have many times admitted that I'm NO great programmer with
loads of experience and the questions I post should make that clear. I make
no claims.



Do a search on Google for "Return Child Record VB.NET" and see what comes
up. I have posted this question in this group.



After 2 days of going round with Cor, all I got was "With a few lines of
code, you can make it work. Well, <G>-- What are those lines of code?
<Thanks for blowing me off>



Finally, someone out of the goodness of their heart who probably saw Cor's
final post, gave me an answer It was bhawin13. I would like to take this
moment to thank him if he is seeing this post and if I didn't already thank
him. Thank you bhawin13. That did the trick.

bhawin13's answer:

Private Sub GetChildRowsFromDataRelation(myTable As DataTable)
Dim myRelation As DataRelation
Dim arrRows() As DataRow
Dim myRow As DataRow
Dim i As Integer
Dim myColumn As DataColumn

For Each myRelation In myTable.ChildRelations
For Each myRow In myTable.Rows
arrRows = myRow.GetChildRows(myRelation,
DataRowVersion.Proposed)
' Print values of rows.
For i = 0 To arrRows.GetUpperBound(0)
For Each myColumn in myTable.Columns
Console.WriteLine(arrRows(i)(myColumn))
Next myColumn
Next i
Next myRow
Next myRelation
End Sub

With some mods, I made it work in my app. He didn't drag me on for 2 days
and finaly blow me off like Cor did. Cor could have at least admitted he
didn't have an answer. But like many, pride gets in the way of productivity.



As for books, I know about that book and I looked it over in a book store
and I think it's great. I couldn't find my answer in the 40 mins I had to
look through it but I have every intention of buying it when I'm through
with Visual Basic Step by Step by Michael Halvorson. Yes a beginners book.
The Francesco Balena synopsis clearly states that it is not a book for
beginners.





Have a nice weekend folks



Bob
 
S

Scott M.

I thought I wrote quite clearly. I think you're looking so hard to find
ways to shoot me down that your letting that get in the way of your own
interpretation of what I say.

Not at all. I think you aren't taking my comments as they were intented.
I'm simply trying to let you know that you might going about your answer
seeking in the wrong way. I wouldn't do a Google search on "Return Child
Record VB.NET" because that is too vauge and could yeild all sorts of
irrelevant topics. I guess I'm simply saying that while you have told us
about your frustrations with this issue and what attempts you've made to
solve the problem yourself and then come to some conclusions about the VB
..NET language, my response is that the types of searches you have done in
the first place were not the best that could have been done. I'm not trying
to insult you in any way, I'm simply saying that the conculsions you may
have reach about VB .NET are (IMHO) misguided because you came to them from
a misguided search for answers in the first place.

A Google search of "data relationships .NET" does yield many relevant pages.
In fact, the second link discusses what ultimately was the solution to your
problem.

As for me asking about your friend who has many years of VB experience, my
point was that while your friend might have VB .NET experience now, whatever
VB 6.0 experience he/she might have had would be irrelevant to solving the
problem you have now and so you asking your question to that friend or here
in this forum would put you in touch with people of the same experience
level.

I *hope* that you can read this and my prior response and understand that
they were intended to help you think about your problem and your post in a
different light. You have admittedly told us that you are new to this and I
think that if you take each piece of constructive criticism or objective
comment as some kind of personal attack on you, you will find it hard to
implement the help, wisdom and experience of others who are just trying to
help you out. Not every answer you'll get will be the solution you are
looking for, but please remember that even those who are *trying* to help
you are still doing it out of "the goodness of their heart" just as much as
the person who actually has the solution you were looking for. Most of us
here are not getting paid to reply to posts and we give of our time to help
others.

Good luck to you in your future endeavors,

-Scott
 
R

RYoung

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Label01.Visible = True
Panel01.Visible = True

Panel02.Visible = False
Label02.Visible = False

Panel03.Visible = False
Label03.Visible = False

Panel04.Visible = False
Label04.Visible = False

Panel05.Visible = False
Label05.Visible = False

Panel06.Visible = False
Label06.Visible = False
End Sub

Can you give some details on that problem? I don't like the way that sub
looks, and maybe can offer something. A screenshot posted on the web would
be nice. I'm thinking a custom usercontrol might be a cleaner way to go.

Ron
 
W

William \(Bill\) Vaughn

And this pertains to ADO.NET how?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
R

RYoung

Well, the VB vs C# issue has been worked over before, many folks probably
have their rhetoric ready in cut and paste mode from older posts on the same
topic. I came across the portion I enquired about in the original poster's
message, and read it as though he were looking for an alternative to what
he's working with now:

<snip>
I've tried a few different ways to move this to a Mod. Mostly nothing
happens. No error no nothing.
</snip>

Sorry you felt your time was wasted, and that you took the time to respond
as such.

Ron
 
B

Bob

Ron:

I'm confused at how your <snip> regarding my Module issue pertains to other
recent posts.

Anyways, My dig at VB.NET and C# was simply a joke. I thought maybe some
people would get a laugh. I've been playing with both and actually like them
both despite the fact that MS fixes sum bugs, creates new ones, chages some
of the minor aspects of VS and says ALL NEW VERSION, when it should be a
service pack.

Those are my feelings on that. If thats what your refering to. If your
unsure about why I feel that way, then think about when the last time is
that MS released a major service pack for any VS.NET version.
Sorry you felt your time was wasted, and that you took the time to respond
as such.

I'm at a loss on that one too. You can elaborate if you wish but quite
frankly, i'm tired of that topic.

If your refering to my dig at Cor, then the fact is, he blew me off on a
completely different topic after two days of making me elaborate on the
problem I was having.

As for my moving the Panels visible property to a module, All I did was
double click the button in designer and begin putting that code in the
bottons click event. When I'm done, I will have 26 panels. I would like to
move the code for the visible = true and such to a Module and out of the
form for better code organization.

I tried the following in the Module:

Module ModPanels

Sub btn1Click()
Dim frm1 As New Form1

frm1.Label01.Visible = True
frm1.Panel01.Visible = True

frm1.Panel02.Visible = False
frm1.Label02.Visible = False

frm1.Panel03.Visible = False
frm1.Label03.Visible = False

frm1.Panel04.Visible = False
frm1.Label04.Visible = False

frm1.Panel05.Visible = False
frm1.Label05.Visible = False

frm1.Panel06.Visible = False
frm1.Label06.Visible = False

frm1.Panel07.Visible = False
frm1.Label07.Visible = False

frm1.Panel08.Visible = False
frm1.Label08.Visible = False

frm1.Panel09.Visible = False
frm1.Label09.Visible = False

End Sub

End Module

Then in my Buttons Click Even, I called btn1Click()

and nothing happens. I don't get an error or anything.

I'm thinking I have to declare each panel and label in Module.

TIA

Bob
 
R

RYoung

Bob,
I was just reading through the posts, and got to the part where you
mentioned the issue of Button_Click, and how nothing was happening when you
moved it to a module. I thought, with a little more detail I could offer a
suggestion, so my post had nothing to do with the original thread, perhaps I
should have made that clear in the subject line, but I thought it was the
best thing to do, since the question was presented under this subject.

I was actually doing something similiar, where I needed to control the
visibility of a group of controls. I used a custom control to encapsulate
that, just setting the visibility of the control to take care of the
visibility of it's child controls.

As for the module, something like so would work:

Module Module1
Public Sub Button_Click(Sender As Object, E As EventArgs )
MessageBox.Show( "clicked" )
End Sub
End Module

Class Form1
Public Sub New()
AddHandler( myButton.Click, AddressOf Module1.Button_Click)
End Sub
End Class

Out of character on my part, my apologies,

Good day, Ron

Then, in code you could wire that to your Button1, and keep that aspect of
the button click in a separate module. Although I feel thats not still not
the best solution.
 
B

Bob

Ron:

Thanks for responding. The info you gave me certainly put me in the right
direction. I guess I have some more studying to do though.

Once I did what you said, I got the MsgBox("click")

I did get the MsgBox

Below that, still the same problem. I guess I have to learn more to figure
out how to access the current instance of Form1

Public Sub Button01_Click(ByVal Sender As Object, ByVal E As EventArgs)

MessageBox.Show("clicked") << Does show when I click the button

Dim frm1 As Form1 <<Gives Object Reference not set to an instance
of an object at frm1.Label01.Visible = True
'If I try
Dim frm1 As New Form1 << Again, Nothing Happens probably because I'm
calling a new instance of Form1 that gets placed in memory.


frm1.Label01.Visible = True
frm1.Panel01.Visible = True

frm1.Panel02.Visible = False
frm1.Label02.Visible = False

frm1.Panel03.Visible = False
frm1.Label03.Visible = False

frm1.Panel04.Visible = False
frm1.Label04.Visible = False

frm1.Panel05.Visible = False
frm1.Label05.Visible = False

frm1.Panel06.Visible = False
frm1.Label06.Visible = False

frm1.Panel07.Visible = False
frm1.Label07.Visible = False

frm1.Panel08.Visible = False
frm1.Label08.Visible = False

frm1.Panel09.Visible = False
frm1.Label09.Visible = False

frm1.Panel10.Visible = False
frm1.Label010.Visible = False


End Sub



I see what you mean when you say it may not be the best method. However,
VB.NET seems to handle late and early binding and things of this nature with
far less of a performance hit than prior versions.

I think your right that I may have to create a user control that has these
methods but, thats probably in another chapter in another book by Francesco
that I've yet to purchase.

Thaks for your help

Bob
 
P

Paul Clement

¤ I tried to avoid to answer here because all the answers where already well
¤ enough in relation to the way you asked the question and was only replying
¤ to Paul, however, the best answer on a question as yours is in my opinion
¤ this one.
¤

Cor,

I was only kidding anyway. I usually don't answer "which is the better language questions" so I just
answered with *my* preference (and a wink).


Paul
~~~~
Microsoft MVP (Visual Basic)
 
B

Bob

This whole thing was too funny. Half the people didn't right click and reply
to the post they intended to respond to.

The other half who did, confused people who they they were responding the
wrong person.

I for one am quite surprised Mr. William (Bill) Vaughn even bothered to
respond to anything that has to do with this topic.

What with no oportunity to throw flowers at himself.
Please note the missing wink----> :)

Bob
 
P

Paul Clement

¤
¤ ¤ > On Thu, 18 Aug 2005 14:37:45 +0200, "Cor Ligthert [MVP]"
¤
¤ > I didn't know VB.NET was a Ferrari. So what is C#, a Hyundai? ;-)
¤ >
¤
¤ C#=Concorde. It crashed only once. Click here for more:
¤ http://www.concorde-jet.com/
¤

Yeah sure, must be because it compiles to its own IL and executes under its own framework. :p

¤ VB=Ford Pinto. It stalled too many times. Ford finally quit making it ! The
¤ world is praying for BG to discontinue this product. Man should quit "dim"
¤ this or dim that. So silly isn't it ! We are in th 21st Cent..

No kidding. Who needs syntactical artifacts such as braces, semi-colons, language case sensitivity,
independent comparison and assignment operators, etc. etc. etc.. ;-)


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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

Top