title: Wrap code in a datarow function
body: <p>I have the following code which assigns values to a datarow and and adds to the datatable. I want to write function which returns a datarow which enables me to write less code. Please check the code below and provide me any suggestions</p>
  
  <pre><code>            objRow = dtTODO.NewRow
              objRow.Item("Item") = "Test"
              objRow.Item("Message") = "Test"
              objRow.Item("ButtonText") = "Add"
              dtTODO.Rows.Add(objRow)
  
              objRow = dtTODO.NewRow
              objRow.Item("Item") = "Test2"
              objRow.Item("Message") = "Test2"
              objRow.Item("ButtonText") = "Add"
              dtTODO.Rows.Add(objRow)
  </code></pre>
  
  <p>Assume that I am adding the above records. I want to create a function which returns a datarow as, </p>
  
  <pre><code>Public Function ItemRow(ByVal strItem As String, ByVal strMessage As String, ByVal strButtonText As String, ByVal strUrl As String) As DataRow
  
  End Function
  </code></pre>
  
  <p>And add this as,</p>
  
  <p>dtTODO.Rows.Add(ItemRow(item, msg,bttext,url))</p>
  
  <p>Hope I am not confusing too much :). </p>