Click here to Skip to main content
15,887,464 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating Point-of-Sale with integrated Kitchen Display System Pin
jschell31-Jan-12 13:59
jschell31-Jan-12 13:59 
QuestionC# UnauthorizedAccessException Pin
Habekeinen29-Jan-12 2:08
Habekeinen29-Jan-12 2:08 
AnswerRe: C# UnauthorizedAccessException Pin
OriginalGriff29-Jan-12 3:02
mveOriginalGriff29-Jan-12 3:02 
GeneralRe: C# UnauthorizedAccessException Pin
Habekeinen29-Jan-12 3:49
Habekeinen29-Jan-12 3:49 
GeneralRe: C# UnauthorizedAccessException Pin
OriginalGriff29-Jan-12 3:53
mveOriginalGriff29-Jan-12 3:53 
AnswerRe: C# UnauthorizedAccessException Pin
Abhinav S29-Jan-12 19:04
Abhinav S29-Jan-12 19:04 
AnswerRe: C# UnauthorizedAccessException Pin
Bernhard Hiller29-Jan-12 20:44
Bernhard Hiller29-Jan-12 20:44 
QuestionQuestion about Chart in C# Pin
pongpanut28-Jan-12 20:31
pongpanut28-Jan-12 20:31 
i need to create chart with data from my database by select product from checkbox in listbox and between date from datetimepicker bet when click the button for generate graph value in graph show same data for every series i don't know how to fix this problem

this is my code

C#
if (row.Cells[1].Value != null && (bool)row.Cells[1].FormattedValue)
                {                       
                        String idtoselect = row.Cells[0].Value.ToString();
                        String str1 = idtoselect.ToString();
                        
                        try
                        {
                            string sql2 = "select NAME_Product from Product where  Product.ID_Product = '"+str1+"' ";
                            SqlCommand testcommand2 = new SqlCommand(sql2, conn);
                            rdr = testcommand2.ExecuteReader();

                            while (rdr.Read())
                            {
                                test = rdr["NAME_Product"].ToString();

                            }
                            rdr.Close();

                            try
                            {
                                CultureInfo ci = new CultureInfo("th-TH");
                                string sql = "SELECT * FROM Order1 where ID_Product = '"+str1+"' AND DATE_Order BETWEEN '" + dateTimePicker1.Value.ToString("s") + "' AND '" + dateTimePicker2.Value.ToString("s") + "' ";
                                da = new SqlDataAdapter(sql, conn);
                                ds = new DataSet();
                                da.Fill(ds, "Order1");
                                chart1.DataSource = ds.Tables["Order1"];
                                chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
                                
                                chart1.Series.Add(test);
                                chart1.Series[test].ChartArea = "ChartArea1";
                                chart1.Series[test].BorderWidth = 4;
                                chart1.Series[test].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;                                
                                chart1.Series[test].YValueMembers += "QUANTITY_Order";
                                chart1.Series[test].XValueMember += "DATE_Order";

                                chart1.DataBind();
                                MessageBox.Show("test :" );
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("test :" + ex);
                            }
       
                        }
                        catch
                        {
                            MessageBox.Show("exception");
                        }


and this my output

http://image.ohozaa.com/view/80v2q]

i'm so sorry if i type a wrong word because my english is not good

Thank you for answer
AnswerRe: Question about Chart in C# PinPopular
OriginalGriff28-Jan-12 21:06
mveOriginalGriff28-Jan-12 21:06 
GeneralRe: Question about Chart in C# Pin
pongpanut28-Jan-12 21:47
pongpanut28-Jan-12 21:47 
GeneralRe: Question about Chart in C# Pin
OriginalGriff28-Jan-12 21:49
mveOriginalGriff28-Jan-12 21:49 
GeneralRe: Question about Chart in C# Pin
pongpanut28-Jan-12 22:20
pongpanut28-Jan-12 22:20 
AnswerRe: Question about Chart in C# Pin
Luc Pattyn28-Jan-12 22:38
sitebuilderLuc Pattyn28-Jan-12 22:38 
GeneralRe: Question about Chart in C# Pin
pongpanut29-Jan-12 0:10
pongpanut29-Jan-12 0:10 
GeneralRe: Question about Chart in C# Pin
OriginalGriff28-Jan-12 23:08
mveOriginalGriff28-Jan-12 23:08 
GeneralRe: Question about Chart in C# Pin
pongpanut29-Jan-12 1:58
pongpanut29-Jan-12 1:58 
GeneralRe: Question about Chart in C# Pin
OriginalGriff29-Jan-12 2:06
mveOriginalGriff29-Jan-12 2:06 
GeneralRe: Question about Chart in C# Pin
pongpanut29-Jan-12 2:16
pongpanut29-Jan-12 2:16 
GeneralRe: Question about Chart in C# Pin
OriginalGriff29-Jan-12 2:58
mveOriginalGriff29-Jan-12 2:58 
AnswerRe: Question about Chart in C# Pin
Luc Pattyn29-Jan-12 8:35
sitebuilderLuc Pattyn29-Jan-12 8:35 
GeneralRe: Question about Chart in C# Pin
Luc Pattyn28-Jan-12 22:12
sitebuilderLuc Pattyn28-Jan-12 22:12 
GeneralRe: Question about Chart in C# Pin
pongpanut28-Jan-12 22:23
pongpanut28-Jan-12 22:23 
QuestionWriting source code in seperate files Pin
Fred 3427-Jan-12 22:27
Fred 3427-Jan-12 22:27 
AnswerRe: Writing source code in seperate files Pin
Richard MacCutchan27-Jan-12 22:37
mveRichard MacCutchan27-Jan-12 22:37 
GeneralRe: Writing source code in seperate files Pin
Eddy Vluggen27-Jan-12 23:44
professionalEddy Vluggen27-Jan-12 23:44 

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.