Update data table using table adapter - stumped

C# newbie here. Can anyone tell me why I'm getting an error at "TextTypeT(0)" in the following line of code: "aanuncio.TextTypeTRow TextType = TextTypeT(0);"?

Here's the entire function:

[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public bool UpdateTextType(int TextTypeID, Nullable<int> SubjectAreaTextTypeID, string TextTypeNmI, string TextTypeNmII, string TextTypeNmIII, string TextTypeNmIV, Nullable<decimal> TextTypeRate, Nullable<decimal> TextTypeLagTime, bool TextTypePub)
        {

            aanuncio.TextTypeTDataTable TextTypeT = Adapter.GetTextTypeByTextTypeID(TextTypeID);

            if (TextTypeT.Count == 0)
            {
                return false;
            }

            aanuncio.TextTypeTRow TextType = TextTypeT(0);

            if (!SubjectAreaTextTypeID.HasValue)
            {
                TextType.SetSubjectAreaTextTypeIDNull();
            }
            else
            {
                TextType.SubjectAreaTextTypeID = SubjectAreaTextTypeID.Value;
            }

            TextType.TextTypeNmI = TextTypeNmI;

            TextType.TextTypeNmII = TextTypeNmII;

            TextType.TextTypeNmIII = TextTypeNmIII;

            TextType.TextTypeNmIV = TextTypeNmIV;

            if (!TextTypeRate.HasValue)
            {
                TextType.SetTextTypeRateNull();
            }
            else
            {
                TextType.TextTypeRate = TextTypeRate.Value;
            }

            if (!TextTypeLagTime.HasValue)
            {
                TextType.SetTextTypeLagTimeNull();
            }
            else
            {
                TextType.TextTypeLagTime = TextTypeLagTime.Value;
            }

            TextType.TextTypePub = TextTypePub;

            int rowsAffected = Adapter.Update(TextType);

            return rowsAffected == 1;
        }

Open in new window

aanuncioAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aanuncioAuthor Commented:
The error in question is an Intellisense error: "Method name expected." This function was translated from VB.
0
plusone3055Commented:
can you provide the original VB.NEt code you attempted to translate ?
0
aanuncioAuthor Commented:
<System.ComponentModel.DataObjectMethodAttribute _
        (System.ComponentModel.DataObjectMethodType.Update, True)> _
    Public Function UpdateTextType _
    (ByVal TextTypeID As Integer, ByVal SubjectAreaTextTypeID As Nullable(Of Integer), ByVal TextTypeNmI As String, _
     ByVal TextTypeNmII As String, ByVal TextTypeNmIII As String, _
     ByVal TextTypeNmIV As String, _
     ByVal TextTypeRate As Nullable(Of Decimal), ByVal TextTypeLagTime As Nullable(Of Decimal), _
     ByVal TextTypePub As Boolean) _
     As Boolean

        Dim TextTypeT As aanuncio.TextTypeTDataTable = _
         Adapter.GetTextTypeByTextTypeID(TextTypeID)

        If TextTypeT.Count = 0 Then
            Return False
        End If

        Dim TextType As aanuncio.TextTypeTRow = TextTypeT(0)

        If Not SubjectAreaTextTypeID.HasValue Then
            TextType.SetSubjectAreaTextTypeIDNull()
        Else
            TextType.SubjectAreaTextTypeID = SubjectAreaTextTypeID.Value
        End If

        TextType.TextTypeNmI = TextTypeNmI

        TextType.TextTypeNmII = TextTypeNmII

        TextType.TextTypeNmIII = TextTypeNmIII

        TextType.TextTypeNmIV = TextTypeNmIV

        If Not TextTypeRate.HasValue Then
            TextType.SetTextTypeRateNull()
        Else
            TextType.TextTypeRate = TextTypeRate.Value
        End If

        If Not TextTypeLagTime.HasValue Then
            TextType.SetTextTypeLagTimeNull()
        Else
            TextType.TextTypeLagTime = TextTypeLagTime.Value
        End If

        TextType.TextTypePub = TextTypePub

        Dim rowsAffected As Integer = Adapter.Update(TextType)

        Return rowsAffected = 1
    End Function

Open in new window

0
aanuncioAuthor Commented:
I figured this out on my own. The offending code should've had brackets instead of parentheses.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aanuncioAuthor Commented:
This was a simple newbie error that I made because I'm not used to looking at C#. I'm surprised C# veterans didn't swoop on it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.