|
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");
}
}
}
Please Help.
Nitin Raj Bidkikar
Nitin Raj Bidkikar
|
|
|
|
|
You have 2 options.
1. Don't use INNER JOIN in your query. Get both tables separately and make relation between them at .NET level. Here you can select like a INNER JOIN only related records in both tables.
2. Don't generate and get INSERT or UPDATE command from Command Builder. Build manually INSERT or UPDATE commands for the ADAPTER.
For more information on these approaches GOOGLE.
Regards
|
|
|
|
|
Hi
I am trying to write a windows services(first time).
I want it to write the name of each file opened in a notepad document.
I have written some code for it and I do have a service now which makes entry in the event log whenever it is started or stopped.
From where can I get a code understand what should be done next?
I dont want exact code; just a help to understand services
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
|
hello every one ,
i create user in sqlserver and when i create form in c# contain the username and password . i can't connect the user to data base .
how i can mack this .the spicifec preoplem in connection and compare user name and password
alhemyary
-- modified at 3:54 Monday 26th November, 2007
|
|
|
|
|
Could you be a bit more specific? Which area is causing you the problem? The connection string? The stored procedure?
|
|
|
|
|
Well, you need to fix your code. Do you mean you have a login with SQL Server that goes in your connection string, or a table with usernames and passwords which the user needs to use to use your application ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How do I populate my dropdownlist with data from SQL?
|
|
|
|
|
It has properties to tell it which column to use for the value and which to display. Set those and set the datasource to be your data from the DB. Call DataBind if this is ASP.NET
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
WebControl can use ListItem for DropDownList add a Item with Text and value.
WinForm how to do for Combobox?
Thanks.
|
|
|
|
|
Set the data source as your datatable.
And then
Combo1.DisplayMember="Name";
Combo1.ValueMember="Id";
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Hi guys,
I wonder whether this is the correct place for this post.
However, I'm looking for a C# 2.0 grammar or C# 2.0 language specification which I can use to write the specification for a parser which I am hoping to generate using ANTLR.
The ANTLR grammar for C# 2.0 is still not complete as I know so far. Therefore, if any of you guys have a grammar or language spec for this version of C# (eventhough incomplete), please fill me in.
Regards,
Ara
|
|
|
|
|
You can download the C# 3.0 language specification from here[^]. Not sure about the 2.0 specification.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
how can i call the store procedure for saving record into database , in C#?
please help...
saeed ghanavat
|
|
|
|
|
first set
SQLCommand.CommandType = CommandType.StoredProcedure
then
call the ExecuteReader method
for better understanding plz see the following article
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx
|
|
|
|
|
I have developed a windows service that creates .jpeg file.Is it possible to save that .jpeg file in the network path.Generally it shows GDI+ error message in network path but saves in my local drive.
|
|
|
|
|
Usually windows services are running under an account that doesn't have access to network paths (i.e. mapped network drives). You could try UNC paths, though, but even then the account the service is being executed under has to have sufficient rights to write to the path.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
how can I convert
1.html file to image file
2.image file to pdf file
I need c# code
thanks in advance
harry
|
|
|
|
|
1 - render in a web browser and do a screenshot
2 - buy a third party library or find a free one
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Guys.
I created a Windows Application. We made use of Crystal Reports XI release 2 for our reports. When I am running the setup on the users machine and try to view the reports, I am getting the following error.
An error has occurred while attempting to load the Crystal Reports runtime.
Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.
Anybody know what I am suppose to do? Help will really be appreciated.
Kind Regards,
Elizma
|
|
|
|
|
please make sure that u added all the crystal report related dll's from
common folder that is placed in program files folder
|
|
|
|
|
Hi There,
Thanx for the reply. I have added all the required dll's. The program adds it automatically when I add the Project's Output to the Setup.
I also installed the Crystal Report Runtime on the client machine, but I am still getting this error.
Kind Regards,
Elizma
|
|
|
|
|
hello,elizma
there are many error that mack your problem .i think you can chek the path of crystal report the path shoud be the same path in the application .in adition if your report with the odbc you must create odbc in the other computer.the other problem idont know about it
alhemyary
|
|
|
|
|
Hi.
Thanx for you reply. Well, I made use of Dataset when I created my reports, in code I fill this dataset and set the datasource of the Report. The thing is, this all works fine on my machine, but the moment I deploy it, I get the message above. I need to find a solution on what I need to distribute these reports with the runtime for Crystal Reports XI Release 2. I dont get this problem if I only use the build-in version of .NET, but then I cant make use of Digital Images. This functionality is in the Release 2 version, that is why I made use of this feature.
I dont know what to do anymore. I have tried all possible situations. I am now reverting back to the old version which worked properly.
Kind Regards,
Elizma
|
|
|
|
|
when u r making a setup of your project u have to set the property i'm not sure what was that let u know in 24 hours.
|
|
|
|