Please help I keep getting the following error: "Object reference not set to an instance of an object." for the code DataRow myRow = myTable.NewRow(); string connectionString = @"data source = GERHARDVDM28-PC; initial catalog = RacerUI; integrated security=SSPI"; string commandString = @"SELECT * FROM Entries";SqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, connectionString); SqlCommandBuilder scb = new SqlCommandBuilder(dataAdapter);DataSet racerUIDataSet = new DataSet(); DataTable myTable = racerUIDataSet.Tables["Entries"];this.entriesTableAdapter.Fill(this.racerUIDataSet.Entries);DataRow myRow = myTable.NewRow(); myRow[0] = RacerName; myRow[1] = BikeManufacturer; myRow[2] = RaceNumber; myRow[3] = Team; myTable.Rows.Add(myRow); dataAdapter.Update(racerUIDataSet, "Entries"); racerUIDataSet.AcceptChanges();
Welcome to the forums For me it looks more like a C# problem than the SQL, if you are able to connect to the SQL instance via other tools then its for sure a C# driver issue. See KBA http://support.microsoft.com/kb/810098 is any help.