Click here to Skip to main content
15,868,016 members
Home / Discussions / Database
   

Database

 
QuestionAdvanced string manipulation - MS Access Pin
alect11-Feb-07 8:52
alect11-Feb-07 8:52 
AnswerRe: Advanced string manipulation - MS Access Pin
andyharman11-Feb-07 23:37
professionalandyharman11-Feb-07 23:37 
QuestionAssign value of one column to other Pin
TrooperIronMan11-Feb-07 7:44
TrooperIronMan11-Feb-07 7:44 
AnswerRe: Assign value of one column to other Pin
Bassam Saoud11-Feb-07 19:51
Bassam Saoud11-Feb-07 19:51 
Questionsql query analyzer Pin
Member 381773811-Feb-07 4:47
Member 381773811-Feb-07 4:47 
AnswerRe: sql query analyzer Pin
tommyligo11-Feb-07 5:27
tommyligo11-Feb-07 5:27 
AnswerRe: sql query analyzer Pin
Rob Graham11-Feb-07 5:35
Rob Graham11-Feb-07 5:35 
QuestionFilling a dataset not working Pin
Blekk10-Feb-07 14:03
Blekk10-Feb-07 14:03 
Hi,

I need a little help. I have created an untyped dataset on my form called dataSet1 and am trying to create a parent/child relationship with a datagrid displaying the data. But I am getting a weird exception on the code:

da.Fill(dataSet1);


The exception says: "Incorrect syntax near '*'"

I don't understand this exception atall.

Please help me,

Any reply is appreciated.

P.S. here is the full code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace NorthwindTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string strConnect = @"server = (local)\SQLEXPRESS; integrated security = sspi; database = C:\SQL\NORTHWND.MDF";
            string strQuery1 = @"SELECT * FROM employees";
            string strQuery2 = @"SELECT * FROM orders";
            string strQuery = strQuery1 + strQuery2;


            SqlConnection conn = new SqlConnection(strConnect);
            SqlDataAdapter da = new SqlDataAdapter(strQuery, conn);
            da.TableMappings.Add("Table", "employees");
            da.TableMappings.Add("Table1", "orders");
            da.Fill(dataSet1);
            DataRelation relation = new DataRelation("employeeorders", dataSet1.Tables[0].Columns["employeeid"], dataSet1.Tables[1].Columns["employeeid"]);
            dataSet1.Relations.Add(relation);
            dataGridView1.DataBindings.Add("datasouce", dataSet1, "employees");
        }


    }
}

AnswerRe: Filling a dataset not working Pin
Rocky#10-Feb-07 21:02
Rocky#10-Feb-07 21:02 
GeneralRe: Filling a dataset not working Pin
Blekk11-Feb-07 2:25
Blekk11-Feb-07 2:25 
GeneralRe: Filling a dataset not working Pin
Rocky#11-Feb-07 5:22
Rocky#11-Feb-07 5:22 
AnswerRe: Filling a dataset not working Pin
Sushant Duggal11-Feb-07 23:02
Sushant Duggal11-Feb-07 23:02 
Questiongrouping data in terms of time (weeks, months, year etc) Pin
Rocky#10-Feb-07 5:43
Rocky#10-Feb-07 5:43 
AnswerRe: grouping data in terms of time (weeks, months, year etc) Pin
Bassam Saoud10-Feb-07 5:49
Bassam Saoud10-Feb-07 5:49 
AnswerRe: grouping data in terms of time (weeks, months, year etc) Pin
M.H.1.2.310-Feb-07 6:24
M.H.1.2.310-Feb-07 6:24 
GeneralRe: grouping data in terms of time (weeks, months, year etc) Pin
Rocky#10-Feb-07 6:30
Rocky#10-Feb-07 6:30 
GeneralRe: grouping data in terms of time (weeks, months, year etc) Pin
Rocky#10-Feb-07 6:36
Rocky#10-Feb-07 6:36 
GeneralRe: grouping data in terms of time (weeks, months, year etc) Pin
M.H.1.2.310-Feb-07 11:50
M.H.1.2.310-Feb-07 11:50 
GeneralRe: grouping data in terms of time (weeks, months, year etc) Pin
Rocky#10-Feb-07 20:55
Rocky#10-Feb-07 20:55 
QuestionSQL Pattern Matching Pin
ug95rxp10-Feb-07 5:28
ug95rxp10-Feb-07 5:28 
AnswerRe: SQL Pattern Matching Pin
Krish - KP12-Feb-07 17:09
Krish - KP12-Feb-07 17:09 
Questionquery problem: specially for Colin [modified] Pin
Saira Tanwir10-Feb-07 2:55
Saira Tanwir10-Feb-07 2:55 
AnswerRe: query problem Pin
Colin Angus Mackay10-Feb-07 4:05
Colin Angus Mackay10-Feb-07 4:05 
GeneralRe: query problem Pin
Saira Tanwir10-Feb-07 4:15
Saira Tanwir10-Feb-07 4:15 
GeneralRe: query problem Pin
Colin Angus Mackay10-Feb-07 4:37
Colin Angus Mackay10-Feb-07 4:37 

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.