|
Runtime error: Syntax Error in FROM clause
|
|
|
|
|
Why are you using typed datasets?
Can you use System.Data.DataSet datasets???
|
|
|
|
|
|
|
I have a web application where I need to take an object I created and return the value to a list.
For example, one of the samples I was referencing was from a blog app (dotnetblogengine). This code was to return all blog posts created within a specific date range. The code looked like this:
List<post> list = Posts.FindAll(delegate(Post p)
{
return (p.DateCreated.Date >= dateFrom && p.DateCreated.Date <= dateTo);});
}
</post>
I now need to do something similar however I need to take all sales from our sales reps and return their total amount earned into the list. So for example, here's some sample data:
Employee ID | Employee Name | Sales Transaction Amount
---------------------------------------------------
1 | John | 18.47
2 | Beth | 27.67
1 | John | 12.04
1 | John | 10.50
3 | Allen | 34.87
2 | Beth | 19.12
I would then need to return to the list, the following:
Beth: $46.79
John: $41.01
Allen: $34.87
How could I do this using something like the following:
List<sales> list = Sales.FindAll(delegate(Sales s)
{
}
</sales>
Any ideas or where I could look to find some similar samples?
Thanks.
-Goalie35
|
|
|
|
|
If you are not averse to using LINQ you could do something like
List<product> products = GetProductList();
var categories =
from p in products
group p by p.Category into g
select new { Category = g.Key, TotalUnitsInStock = g.Sum(p => p.UnitsInStock) };
ObjectDumper.Write(categories);
</product>
For context this is pasted directly from the 'Sum - Group' example from MSDN[^].
If you investigate and decide that it is a usable approach, any follow-up questions might be better asked in the 'Linq and .NET 3.5' forum.
Please don't ask me. I've only just started learning LINQ myself.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
need a prog to send messages to administrator or account holder's mobile through bluetooth or any other means when an unauthorised person tries to access any system login or user account or any sort of login form.
|
|
|
|
|
So start coding.
If you want someone to do it for you then go to Rent-A-Coder. If you have a specific question then post it here.
|
|
|
|
|
Go away. You're obviously a moron.
|
|
|
|
|
hey i'm sorry fi the prob is not cited properly, but i dont understand why u get rude to me.....
i'm askin is it possible to write code for me to the mentioned problem....
|
|
|
|
|
You've been a "member" for one day, and within about one hour you cross posted into five different forums (everything from ASP.NET to Python to hardware) just stating that you "need" a program. This isn't rentacoder. This site is for helping people who actually make an effort.
|
|
|
|
|
oh okie sorry for inconvenience mate. i thought this helps me to solve my prob. i actually dont have any idea regarding the renting of coders... i jst thought tht i can pay here and solve my prob direct after takin to coders thts it
sorry mate
|
|
|
|
|
If you're willing to learn and do it yourself then Google's a very valuable friend. I searched for: send message to mobile via bluetooth C#... and it gave me literally millions of results... I can see that there are already a fair few examples out there that'll do what you need.
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
I am prigramming a new "language" o programming
The user writes in the new "language" and then I translate it into c#
the translation is a string
how do the sing becomes a code that can be executed?
|
|
|
|
|
|
there must be a way to do this!
for example:
textbox1.text="button1.backcolor=system.drawing.color.red"
how will it become red???
|
|
|
|
|
I think you can take the text that user written in your new language and translate into C#, then write it to a .cs file and compile it with csc.exe. CSharp Compiler is available in every machine which has .NET Framework installed in it. And of course user will have .NET Framework installed.
OR
You can use Microsoft.CSharp.CSharpCodeProvider to compile and run code in real-time.
Run-Time Code Generation I: Compile C#-Code using Microsoft.CSharp and System.CodeCom.Compiler[^]
|
|
|
|
|
this program in the link is not running.
o I can not relly understand
and I need to know it in "emergency"
is there any ggod example?
|
|
|
|
|
I tried it now and I couldn't get it worked too. But I will try some more, if it works I will let you know.
|
|
|
|
|
Thank you!
I apiciate and hope!
|
|
|
|
|
I researched about this topic a little and written a program which is I think enough for you to understand how CodeProvider works.
Just run the project and enter
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("IS IT WORKING!!");
Console.ReadLine();
}
}
}
to the textbox. Then press Generate. The compiled executable will be in the same direcory as your program is, as "product.exe"
http://rapidshare.com/files/227199842/RealTime_Csharp_Code_Compiler.rar[^]
Let me know what you think.
|
|
|
|
|
It works for me!
|
|
|
|
|
|
There is an ApplicationSettingsBase.Save method. Don't know if it will help you but it has to be worth a look.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, I encountered a problem with refreshing my Datagridview from a MySQL database.
Basically, my Datagridview is placed in a TabPage. This TabPage is toggled visually by a MenuStripItem. When the menu item is clicked, it will either open or close the TabPage. When it opens the TabPage, I have set an event handler to refresh the Datagridview with new data from the MySQL database.
These are the 2 event handlers for the MenuStripItem.
private delegate void Update_Delegate(DataTable input);
private void db_list_update(DataTable input){
db_list.EndEdit();
db_list.Refresh();
db_list.DataSource = input;
}
private void db_toggle(object sender, EventArgs e){
if (db_shown){
tab_control.TabPages.Remove(db_tab);
num_tabs_shown--;
check_tab_visibility();
db_shown = false;
db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
}
else if (!db_shown){
tab_control.Visible = true;
tab_control.TabPages.Insert(0,db_tab);
tab_control.SelectedTab = db_tab;
num_tabs_shown++;
check_tab_visibility();
Show_DB_List();
db_list.Invoke(new Update_Delegate(this.db_list_update), new object[] {db_test.mysql_query(db_query)});
db_shown = true;
}
db_test = null;
}
The problem is that the data in the DataGridView refuses to be refreshed after the second click. That is, when I open the DataGridView, it loads from the database. Then I close it and it refreshes itself. When I open it again, it does not refresh thereafter.
Also, I have put in a HitTest to track the DataSource values of the DataGridView. The DataSource values are being updated but the DataGridView does not reflect the updated values from the DataSource despite my attempts to refresh it and reload the DataSource.
Any help will be much appreciated
|
|
|
|