Click here to Skip to main content
15,890,506 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAnchor Pin
Tsunamipudip8-Jan-14 2:13
Tsunamipudip8-Jan-14 2:13 
AnswerRe: Anchor Pin
Dave Kreskowiak8-Jan-14 3:04
mveDave Kreskowiak8-Jan-14 3:04 
QuestionTrouble with IF...Then...ElseIf... Pin
big_D7-Jan-14 11:36
big_D7-Jan-14 11:36 
AnswerRe: Trouble with IF...Then...ElseIf... Pin
Bernhard Hiller7-Jan-14 20:49
Bernhard Hiller7-Jan-14 20:49 
GeneralRe: Trouble with IF...Then...ElseIf... Pin
big_D8-Jan-14 7:43
big_D8-Jan-14 7:43 
AnswerRe: Trouble with IF...Then...ElseIf... Pin
GuyThiebaut7-Jan-14 21:54
professionalGuyThiebaut7-Jan-14 21:54 
GeneralRe: Trouble with IF...Then...ElseIf... Pin
big_D8-Jan-14 7:44
big_D8-Jan-14 7:44 
QuestionDatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 7:41
Biplob Singha Shee6-Jan-14 7:41 
Hi all,

My MySQL table structure is ...
(I am giving you from SQL Query)
SQL
DROP TABLE IF EXISTS `expenditure`;
CREATE TABLE IF NOT EXISTS `expenditure` (
  `ExpId` int(11) NOT NULL AUTO_INCREMENT,
  `ExpDate` date DEFAULT NULL,
  `ExpPurpose` varchar(350) DEFAULT NULL,
  `ExpRefNo` varchar(50) DEFAULT NULL,
  `Expenditure` double(10,2) DEFAULT '0.00',
  `ExpFlag` char(10) DEFAULT NULL,
  PRIMARY KEY (`ExpId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `expenditure`
--

/*!40000 ALTER TABLE `expenditure` DISABLE KEYS */;
INSERT INTO `expenditure` (`ExpId`,`ExpDate`,`ExpPurpose`,`ExpRefNo`,`Expenditure`,`ExpFlag`) VALUES
(1,'2014-01-06','Purchase','ttyu76',15750,'P');
/*!40000 ALTER TABLE `expenditure` ENABLE KEYS */;

My Code is...
VB
Private Sub Generate()
        Dim DateFrom As Date = Convert.ToDateTime(DtpFrom.Value).ToString("yyyy-MM-dd")
        Dim DateTo As Date = Convert.ToDateTime(DtpTo.Value).ToString("yyyy-MM-dd")
        Try
            OpenConnection()
            Dim sb As New StringBuilder
            sb.Append("SELECT ExpDate,ExpPurpose,Expenditure FROM expenditure WHERE ExpDate BETWEEN '" & DateFrom & "' AND '" & DateTo & "'")
            Dim dbcommand As New MySqlCommand
            Dim dbadapter As New MySqlDataAdapter
            Dim stdata As New DataTable
            dbcommand.Connection = conn
            dbcommand.CommandText = sb.ToString
            dbadapter.SelectCommand = dbcommand
            dbadapter.Fill(stdata)
            DgvExp.DataSource = stdata  'DgvExp is the name of DataGridView

        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            CloseConnection()
        End Try
    End Sub

After the execution of the code, my Datagridview is not displaying any Data.

What is wrong ?
AnswerRe: DatagridView not display any data Pin
Dave Kreskowiak6-Jan-14 7:55
mveDave Kreskowiak6-Jan-14 7:55 
AnswerRe: DatagridView not display any data Pin
Ron Beyer6-Jan-14 7:58
professionalRon Beyer6-Jan-14 7:58 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 8:37
Biplob Singha Shee6-Jan-14 8:37 
GeneralRe: DatagridView not display any data Pin
Ron Beyer6-Jan-14 8:58
professionalRon Beyer6-Jan-14 8:58 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 9:24
Biplob Singha Shee6-Jan-14 9:24 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 4:56
Biplob Singha Shee9-Jan-14 4:56 
GeneralRe: DatagridView not display any data Pin
Ron Beyer9-Jan-14 5:13
professionalRon Beyer9-Jan-14 5:13 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 6:28
Biplob Singha Shee9-Jan-14 6:28 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 6:32
Biplob Singha Shee9-Jan-14 6:32 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee9-Jan-14 6:52
Biplob Singha Shee9-Jan-14 6:52 
GeneralRe: DatagridView not display any data Pin
Dave Kreskowiak6-Jan-14 9:21
mveDave Kreskowiak6-Jan-14 9:21 
GeneralRe: DatagridView not display any data Pin
Biplob Singha Shee6-Jan-14 9:27
Biplob Singha Shee6-Jan-14 9:27 
QuestionCOM component Pin
dharmendra113-Jan-14 20:01
dharmendra113-Jan-14 20:01 
AnswerRe: COM component Pin
Richard MacCutchan3-Jan-14 22:38
mveRichard MacCutchan3-Jan-14 22:38 
QuestionIncorporating setup with other EXEs Pin
SPSandy2-Jan-14 20:27
SPSandy2-Jan-14 20:27 
AnswerRe: Incorporating setup with other EXEs Pin
Bernhard Hiller2-Jan-14 21:50
Bernhard Hiller2-Jan-14 21:50 
GeneralRe: Incorporating setup with other EXEs Pin
SPSandy2-Jan-14 23:21
SPSandy2-Jan-14 23:21 

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.