15,796,299 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Grant Mc (Top 17 by date)
Grant Mc
14-Feb-23 18:07pm
View
Thanks Graeme. This works so I have marked it as accepted solution. No real reason for changing it from orders to movies, just was trying this as a solution and it worked, so now I can apply it to my products list. Realise now I have made it more confusing, sorry.
Grant Mc
13-Feb-23 0:18am
View
Thanks @Member15627495 and @Gerry Schmitz. Will check out these options
Grant Mc
13-Feb-23 0:11am
View
Hi Graeme. I really appreciate your time taken for this, however this is not what I am looking for.
Your solution lists the order ID, Date, and Total Cost, and then lists all the products underneath it.
What I am looking for is a solution that displays on each line, all of the data.
Order ID | Order Date | Total Cost | Product ID | Name | Qty | Cost
001 | 13/02/2023 | $59.23 | PID001 | Spkr | 1 | $24.93
001 | 13/02/2023 | $59.23 | PID002 | Creme | 1 | $34.30
002 | 12/02/2023 | $63.18 | PID001 | Spkr | 1 | $24.93
002 | 12/02/2023 | $63.18 | PID005 | Donut | 1 | $28.88
The reason for this is that 90% of the orders will only have 1 product, so would prefer them on the one line.
My apologies if I was not clear in my question.
Grant Mc
28-Oct-22 5:02am
View
Your right, this works well.
Spent three hours looking for this, and the answer is soo simple.
Appreciate your assistance.
Grant Mc
2-Feb-20 4:40am
View
Going great so far.
Once again, thank you very much TheRealSteveJudge
Grant Mc
30-Jan-20 15:54pm
View
Thanks for this, looks like a great starting point for me.
Grant Mc
5-Mar-19 3:45am
View
Thank you, your answer is very well written.
The reason I was to display an image is to show how I want columns to appear in a datagrid or treelist.
I will try and find a way to word my question later on in the week.
Thank you.
Grant Mc
3-Nov-14 22:38pm
View
Many thanks Sergey
Grant Mc
3-Nov-14 22:20pm
View
Would the only other alternative be SQL?
Grant Mc
3-Nov-14 17:15pm
View
The database is on a network drive. Copied to a local drive and the time reduced to 1 minute and 1 second.
I am using System.Data.OleDb.OleDbDataAdapter, would you suggest using something else?
public OleDbDataAdapter products_Adapter;
public OleDbDataAdapter batches_Adapter;
public DataTable products_Table;
public DataTable batches_Table;
public OleDbCommandBuilder builder;
public OleDbConnection connection;
public Database()
{
connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.mdb");
connection.Open();
products_Table = new DataTable();
batches_Table = new DataTable();
products_Adapter = new OleDbDataAdapter("SELECT * FROM TblProducts", connection);
products_Adapter.Fill(products_Table);
builder = new OleDbCommandBuilder(products_Adapter);
products_Adapter.UpdateCommand = builder.GetUpdateCommand();
products_Adapter.InsertCommand = builder.GetInsertCommand();
products_Adapter.DeleteCommand = builder.GetDeleteCommand();
batches_Adapter = new OleDbDataAdapter("SELECT * FROM TblBatches", connection);
batches_Adapter.Fill(batches_Table);
builder = new OleDbCommandBuilder(batches_Adapter);
batches_Adapter.UpdateCommand = builder.GetUpdateCommand();
batches_Adapter.InsertCommand = builder.GetInsertCommand();
batches_Adapter.DeleteCommand = builder.GetDeleteCommand();
}
public void Save()
{
products_Adapter.Update(products_Table);
batches_Adapter.Update(batches_Table);
}
Grant Mc
27-Sep-13 3:44am
View
Hi Bill, I would love to see what you think what would work better.
It would be great to see how how to synchronize the values, even if I don't use it for this project. Just to learn what can be done
Thanks.
Grant
Grant Mc
26-Sep-13 8:13am
View
Your help is really appreciated.
Thank you very much
Grant Mc
26-Sep-13 6:40am
View
I have tried this, but it does not seem to work.
public class MyGrid
{
public List<column> Columns = new List<column>();
public int DefaultColumnWidth = 64;
public void Test()
{
Columns.Add(new Column());
int x;
x = Columns[0].Width; // returns 64
DefaultColumnWidth = 10;
x = Columns[0].Width; // returns 64
}
}
public class Column : MyGrid
{
private int width = -1;
public int Width
{
get
{
if (width >= 0)
return width;
else
return base.DefaultColumnWidth;
}
set
{
width = value;
}
}
}
Grant Mc
15-Sep-13 15:25pm
View
I really appreciate this, thank you very much.
Grant Mc
28-Mar-13 6:40am
View
Figured it out.
I thought that because it was static that I did not have to do
Database = new FileInfo()
Thanks for everyone's assistance.
I have learned something for today.
Grant Mc
28-Mar-13 6:22am
View
OK, still a little confused. I now have this
public partial class Form1:Form
{
public void Test()
{
Settings.Database.Location = "Test"; // This produces a error
}
public static class Settings
{
public static FileInfo Database;
public static XmlDocument Document;
private static XmlElement Element;
}
public class FileInfo
{
public string Location = "Test";
public DateTime Date;
}
But it produces a runtime error
System.NullReferenceException
Why is it doing this please?
Grant Mc
28-Mar-13 5:59am
View
So why am I allowed to to create an instance of the XmlDocument etc?
Thanks for your assistance.
Show More