Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: Numeric formatting question Pin
Ennis Ray Lynch, Jr.27-Feb-09 8:13
Ennis Ray Lynch, Jr.27-Feb-09 8:13 
GeneralRe: Numeric formatting question Pin
PIEBALDconsult27-Feb-09 9:11
mvePIEBALDconsult27-Feb-09 9:11 
AnswerRe: Numeric formatting question [modified] Pin
PIEBALDconsult28-Feb-09 9:03
mvePIEBALDconsult28-Feb-09 9:03 
QuestionOne Assembly Versus Multiple Assemblies Pin
MarkB12327-Feb-09 6:46
MarkB12327-Feb-09 6:46 
AnswerRe: One Assembly Versus Multiple Assemblies Pin
led mike27-Feb-09 7:17
led mike27-Feb-09 7:17 
GeneralRe: One Assembly Versus Multiple Assemblies Pin
Dan Neely27-Feb-09 7:53
Dan Neely27-Feb-09 7:53 
GeneralRe: One Assembly Versus Multiple Assemblies Pin
MarkB12327-Feb-09 8:07
MarkB12327-Feb-09 8:07 
QuestionVS2005 C# error message 1)"starting a second loop on a single thread is not a valid operation" or 2)"Child list for field Authors cannot be created" (many-to-many relationship) Pin
Diana Rhoades27-Feb-09 6:44
Diana Rhoades27-Feb-09 6:44 
VS2005 C# This is my first C# project.
I have books, authors and a bkauthlink table linking the other two tables creating a many-to-many relationship. I get an error in Program.cs: one is a problem with the way I'm calling my main form; the other error may mean I have program.cs correct but there's a problem in my data class--specifically with the data relations involving a many-to-many relationship.

Program.cs class:

namespace BooksAuthors

{
static class Program
{
// The main entry point for the application.
[STAThread]

static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

//error re single thread if use this
//"Starting a second message loop on a single thread is not a valid operation.
//Use Form.ShowDialog instead."
//Application.Run(new BooksAuthors.MainForm());

//error "Child list for field Authors cannot be created"
Application.Run(new MainForm()); }
}
}

Here's the class for the data:
namespace BooksAuthors
{
internal class ClassDataHandling
{
public void MainDataClass()
{
string connString = @"Server=RHOADESD;Integrated Security=True;" +
"Database=BOOKS";

SqlConnection conn = new SqlConnection(connString);
SqlDataAdapter booksAdapter = new SqlDataAdapter(
"Select * from books", conn);

SqlDataAdapter bkauthlinkAdapter = new SqlDataAdapter(
"Select * from bkauthlink", conn);

SqlDataAdapter authorAdapter = new SqlDataAdapter(
"Select * from authors", conn);

conn.Open();


DataSet BookAuthDataSet = new DataSet("BookAuthors");
booksAdapter.Fill(BookAuthDataSet, "books");
bkauthlinkAdapter.Fill(BookAuthDataSet, "bkauthlink");
authorAdapter.Fill(BookAuthDataSet, "authors");

conn.Close();

DataRelation book = BookAuthDataSet.Relations.Add(
"BookRel", BookAuthDataSet.Tables["books"].Columns["booksID"],
BookAuthDataSet.Tables["bkauthlink"].Columns["booksID"]);

DataRelation author = BookAuthDataSet.Relations.Add(
"AuthRel", BookAuthDataSet.Tables["authors"].Columns["authorsID"],
BookAuthDataSet.Tables["bkauthlink"].Columns["authorsID"]);

New to C#

modified on Friday, February 27, 2009 2:31 PM

AnswerRe: VS2005 C# error message 1)starting a second message on a single thread or 2)"Child list for field Authors cannot be created" Pin
led mike27-Feb-09 7:27
led mike27-Feb-09 7:27 
GeneralRe: VS2005 C# error message 1)starting a second message on a single thread or 2)"Child list for field Authors cannot be created" Pin
Diana Rhoades27-Feb-09 8:40
Diana Rhoades27-Feb-09 8:40 
GeneralRe: VS2005 C# error message 1)starting a second message on a single thread or 2)"Child list for field Authors cannot be created" Pin
led mike27-Feb-09 10:35
led mike27-Feb-09 10:35 
QuestionDirectory.GetDirectories/ GetFiles Exception Pin
mirko8627-Feb-09 6:26
mirko8627-Feb-09 6:26 
AnswerRe: Directory.GetDirectories/ GetFiles Exception Pin
Luc Pattyn27-Feb-09 6:55
sitebuilderLuc Pattyn27-Feb-09 6:55 
GeneralRe: Directory.GetDirectories/ GetFiles Exception Pin
mirko8627-Feb-09 7:09
mirko8627-Feb-09 7:09 
AnswerRe: Directory.GetDirectories/ GetFiles Exception Pin
Luc Pattyn27-Feb-09 7:12
sitebuilderLuc Pattyn27-Feb-09 7:12 
QuestionUsing Windows Live Maps Pin
cdpace27-Feb-09 5:05
cdpace27-Feb-09 5:05 
AnswerRe: Using Windows Live Maps Pin
EliottA27-Feb-09 5:06
EliottA27-Feb-09 5:06 
GeneralRe: Using Windows Live Maps Pin
cdpace27-Feb-09 5:15
cdpace27-Feb-09 5:15 
QuestionAdd Active Directory User to Local Group Pin
svh198527-Feb-09 4:56
svh198527-Feb-09 4:56 
AnswerRe: Add Active Directory User to Local Group Pin
svh198527-Feb-09 6:04
svh198527-Feb-09 6:04 
GeneralRe: Add Active Directory User to Local Group Pin
lane0p23-Mar-09 6:28
lane0p23-Mar-09 6:28 
QuestionConverting an Octet string into a string Pin
lane0p227-Feb-09 4:52
lane0p227-Feb-09 4:52 
AnswerRe: Converting an Octet string into a string Pin
Curtis Schlak.27-Feb-09 6:10
Curtis Schlak.27-Feb-09 6:10 
GeneralRe: Converting an Octet string into a string Pin
lane0p227-Feb-09 10:39
lane0p227-Feb-09 10:39 
GeneralRe: Converting an Octet string into a string Pin
Curtis Schlak.27-Feb-09 11:39
Curtis Schlak.27-Feb-09 11:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.