Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > .NET Framework > Forum > ไวยกรณ์ มันผิดนะครับ ไม่รู้ตรงไหนมันผิด พี่ๆช่วยตรวจให้เด็กน้อยหน่อยนะครับ


 

[.NET] ไวยกรณ์ มันผิดนะครับ ไม่รู้ตรงไหนมันผิด พี่ๆช่วยตรวจให้เด็กน้อยหน่อยนะครับ

 
Topic : 073445



โพสกระทู้ ( 537 )
บทความ ( 0 )

Hall of Fame 2012

สถานะออฟไลน์



Code (C#)
01.private void get3month()
02.        {
03.            string strd, strd1, strd2, strd3, strm, stry, strdt;
04.            strd1 = "/31/";
05.            strd2 = "/30/";
06.            strd3 = "/29/";
07.            strd = cb_date.EditValue.ToString().Substring(3, 2);
08.            strm = cb_date.EditValue.ToString().Substring(0, 2);
09.            stry = cb_date.EditValue.ToString().Substring(6, 4);
10. 
11.            if(autoquery)
12. 
13.            {
14.            }
15.            strdt = strm + strd + stry;
16.            txtdate.EditValue = strdt;
17. 
18.              DT = (Convert.ToInt32(StrMount) - Mount);month now - month select = month show
19.              if ((DT < 0))month show < 0
20.              {
21.                  DT = 0;month show = 0
22.                  DT = (Mount - Convert.ToInt32(StrMount));month show = month select - month now
23.                  Str3 = cbdate_str.Text.Substring(6, 4);year now
24.                  DT2 = (12 - DT);//12 - montn show = month show2
25.                  DT3 = (Convert.ToInt32(Str3) - 1);year now - 1 = year show
26.                  X = DT2.ToString().Length;
27.                  if ((X == 1))
28.                  {
29.                      Dateback = ("0" + DT2.ToString());
30.                      Str2 = (Dateback
31.                                  + (cbdate_str.Text.Substring(2, 4) + DT3.ToString()));
32.                  }
33.                  else
34.                  {
35.                      Str2 = (DT2.ToString()
36.                                  + (cbdate_str.Text.Substring(2, 4) + DT3.ToString()));
37.                  }
38.                  MessageBox.Show(Str2);
39.                  dsca = ojsql2.GetDataSet("select month(ddate) dmonth,sum(iquantity) qty,sum(isum )amt from salebillvouch a inner join salebillvouchs b on a.sbvid=b.sbvid where cinvcode='" + txtpd_code.Text + "' and ddate>='" + cbdate_str.EditValue + "' and ddate<='" + Str2 + "' group by month(ddate)", "data");
40.                  gvFile.DataSource = dsca.Tables[0];
41.                               }
42.              else
43.              {
44.                 Str3 = cbdate_str.Text.Substring(6, 4);
45.                  DT3 = (Convert.ToInt32(Str3) - 1);
46.                  X = DT.ToString().Length;
47.                  if ((X == 1))
48.                  {
49.                      Dateback = ("0" + DT.ToString());
50.                      if ((Dateback == "00"))
51.                    {
52.                         Str2 = ("12"
53.                                      + (cbdate_str.Text.Substring(2, 4) + DT3.ToString()));
54.                      }
55.                  else
56.                     {
57.                          Str2 = (Dateback
58.                                      + (cbdate_str.Text.Substring(2, 3) + cbdate_str.Text.Substring(5, 5)));
59.                    }
60.                  }
61.                  else if ((DT.ToString() == "00"))
62.                 {
63.                      Str2 = ("12"
64.                                  + (cbdate_str.Text.Substring(2, 4) + DT3.ToString()));
65.                 }
66.                  else
67.                {
68.                    Str2 = (DT.ToString()
69.                                  + (cbdate_str.Text.Substring(2, 3) + cbdate_str.Text.Substring(5, 5)));
70.                 }
71.                MessageBox.Show(Str2);
72.                dsca = ojsql2.GetDataSet("select month(ddate) dmonth,sum(iquantity) qty,sum(isum )amt from salebillvouch a inner join salebillvouchs b on a.sbvid=b.sbvid where cinvcode='" + txtpd_code.Text + "' and ddate>='" + Str2 + "' and ddate<='" + cbdate_str.EditValue + "' group by month(ddate)", "data");
73.                 gvFile.DataSource = dsca.Tables[0];
74.              }
75.        }




Tag : .NET, Ms SQL Server 2008, Win (Windows App), C#

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-08 08:55:39 By : time.toon View : 1079 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Error Line ไหนครับ ทำไมไม่ใช้การ Build หรือ Debug ดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-08 09:02:03 By : webmaster
 

 

No. 2



โพสกระทู้ ( 537 )
บทความ ( 0 )

Hall of Fame 2012

สถานะออฟไลน์


ERROR
Code (C#)
1.strd = cb_date.EditValue.ToString().Substring(3, 2);
2.strm = cb_date.EditValue.ToString().Substring(0, 2);
3.stry = cb_date.EditValue.ToString().Substring(6, 4);

ครับพี่
พี่วิน ครับ ตามไปดู กระทู้นี้ให้ที ครับผมติดแค่นิดเดียวเองครับ

https://www.thaicreate.com/dotnet/forum/073407.html

ขอบคุณล่วงหน้าครับ อิๆๆ


ประวัติการแก้ไข
2012-02-08 09:09:31
2012-02-08 09:10:58
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-08 09:09:07 By : time.toon
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ไวยกรณ์ มันผิดนะครับ ไม่รู้ตรงไหนมันผิด พี่ๆช่วยตรวจให้เด็กน้อยหน่อยนะครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่