Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to pass multiple parameter SqlParameter in one? Pin
TheShihan22-Nov-07 22:41
TheShihan22-Nov-07 22:41 
AnswerRe: How to pass multiple parameter SqlParameter in one? Pin
pmarfleet22-Nov-07 21:56
pmarfleet22-Nov-07 21:56 
AnswerRe: How to pass multiple parameter SqlParameter in one? Pin
Joe22-Nov-07 23:08
Joe22-Nov-07 23:08 
Questionho to add right-click to a "Console" object ? Pin
carabutnicolae123422-Nov-07 21:34
carabutnicolae123422-Nov-07 21:34 
AnswerRe: ho to add right-click to a "Console" object ? Pin
leppie22-Nov-07 21:58
leppie22-Nov-07 21:58 
AnswerRe: ho to add right-click to a "Console" object ? Pin
Andrei Ungureanu22-Nov-07 22:03
Andrei Ungureanu22-Nov-07 22:03 
GeneralRe: ho to add right-click to a "Console" object ? Pin
carabutnicolae123422-Nov-07 23:45
carabutnicolae123422-Nov-07 23:45 
Questionupdating database Pin
Nitin.raj22-Nov-07 21:30
Nitin.raj22-Nov-07 21:30 
hi,

I have fetched two database tables "MTQABenchMarks" and "Users" in the datagridview. This is a windows application. Now I have to update the "MTQABenchMark" database after making changes to the datatable present in the application. When I run the code it is throwing an exception "Dynamic SQL generation is not supported against multiple base tables." How to solve this. the code is

public Form1()
{
InitializeComponent();
}
static SqlConnection Con = new SqlConnection("Data Source= 192.168.100.234; Initial Catalog=gishyd; User ID=sa; password=gis*2005");

SqlDataAdapter Da = new SqlDataAdapter("SELECT dbo.Users.UserID, dbo.MTQABenchMark.Id as EmpID, dbo.Users.FirstName + ' ' + dbo.Users.LastName AS Name, dbo.MTQABenchMark.NoofMinPerDay,dbo.MTQABenchMark.PerMonth FROM dbo.Users INNER JOIN dbo.MTQABenchMark ON dbo.Users.UserID = dbo.MTQABenchMark.EID ", Con);
DataSet Ds = new DataSet();

private void Form1_Load(object sender, EventArgs e)
{
Da.Fill(Ds, "MTQABenchMark");
dataGridView1.DataSource = Ds.Tables["MTQABenchMark"];
}

private void button2_Click(object sender, EventArgs e)
{
SqlCommandBuilder CmdBld = new SqlCommandBuilder(Da);

Da.InsertCommand = CmdBld.GetInsertCommand();
Da.Update(Ds, "MTQABenchMark");

MessageBox.Show(" Database is Updated");
}

}
}



Nitin Raj Bidkikar

AnswerRe: updating database Pin
Andrei Ungureanu22-Nov-07 21:34
Andrei Ungureanu22-Nov-07 21:34 
GeneralRe: updating database Pin
Nitin.raj22-Nov-07 21:50
Nitin.raj22-Nov-07 21:50 
GeneralRe: updating database Pin
Andrei Ungureanu22-Nov-07 21:58
Andrei Ungureanu22-Nov-07 21:58 
GeneralRe: updating database Pin
Andrei Ungureanu22-Nov-07 22:07
Andrei Ungureanu22-Nov-07 22:07 
QuestionGenerics question Pin
calendarw22-Nov-07 21:04
calendarw22-Nov-07 21:04 
AnswerRe: Generics question Pin
Andrei Ungureanu22-Nov-07 21:15
Andrei Ungureanu22-Nov-07 21:15 
GeneralRe: Generics question Pin
calendarw22-Nov-07 21:39
calendarw22-Nov-07 21:39 
GeneralRe: Generics question Pin
Andrei Ungureanu22-Nov-07 21:45
Andrei Ungureanu22-Nov-07 21:45 
GeneralRe: Generics question Pin
calendarw22-Nov-07 21:57
calendarw22-Nov-07 21:57 
GeneralRe: Generics question Pin
Andrei Ungureanu22-Nov-07 22:12
Andrei Ungureanu22-Nov-07 22:12 
GeneralRe: Generics question Pin
calendarw22-Nov-07 22:14
calendarw22-Nov-07 22:14 
Questionadd text drag and drop for a console application [modified] Pin
carabutnicolae123422-Nov-07 20:20
carabutnicolae123422-Nov-07 20:20 
AnswerRe: add text drag and drop for a console application Pin
Vasudevan Deepak Kumar22-Nov-07 20:26
Vasudevan Deepak Kumar22-Nov-07 20:26 
GeneralRe: add text drag and drop for a console application Pin
carabutnicolae123422-Nov-07 20:31
carabutnicolae123422-Nov-07 20:31 
GeneralRe: add text drag and drop for a console application Pin
Vasudevan Deepak Kumar22-Nov-07 20:48
Vasudevan Deepak Kumar22-Nov-07 20:48 
GeneralRe: add text drag and drop for a console application Pin
carabutnicolae123422-Nov-07 21:22
carabutnicolae123422-Nov-07 21:22 
QuestionDisplaying data one by one using timer Pin
jacklynn_mei22-Nov-07 20:18
jacklynn_mei22-Nov-07 20:18 

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.