Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8745391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:00:12+00:00 2026-06-13T12:00:12+00:00

In my C# ASP.Net project I am using a xsd dataset to link to

  • 0

In my C# ASP.Net project I am using a xsd dataset to link to my database. I want to create a function return a single row from the strongly typed datatable but I’m running into a little difficulty doing this in C#. I have previously done this in VB.Net successfully using the code:

Public Function dr() As DataSet1.UsersRow
    Dim ta As New DataSet1TableAdapters.UsersTableAdapter
    Dim dt As DataSet1.UsersDataTable = ta.GetData
    Return dt.Rows(0)
End Function

My C# version of the code is:

public DataSet1.UsersRow dr()
{
    DataSet1TableAdapters.UsersTableAdapter ta = new DataSet1TableAdapters.UsersTableAdapter();
    DataSet1.UsersDataTable dt = ta.GetData;
    return dt.Rows(0);
}

I get the error Cannot implicitly convert type ‘System.Data.DataRow’ to ‘MyProject.DataSet1.UsersRow’. An explicit conversion exists (are you missing a cast?)

How can I return my strongly typed row in C#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:00:14+00:00Added an answer on June 13, 2026 at 12:00 pm

    You should be able to get it strongly typed using

    dt[0];

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MySql in my asp.net project. But I don't want to type every
I create a ASP.net MVC 4 project by using Visual Studio 2010 IDE. I
I am working on an example asp.net project using MVC, but my database is
I'm working on asp.net project using VS2010 . I want to share my project
I create an ASP.NET MVC 3 project and a unit test project using xUnit.net.
I am doing asp.net project using C#.I want to display the contents that are
I want to configure ASP.NET Website Project using WCF Service[NetTcp] (both in c#) for
I have a problem that I suppose comes from my ASP.NET MVC project using
I'm developing an ASP.NET MVC 3 project using NInject to create object instances. It
I have an ASP.Net project using AJAX that I am putting on a server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.