Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Online Members
Raj.Trivedi
baskar
naveensanagasetti
Pawan Awasthi
More...
Forums
»
.NET
»
Visual Studio
»
This code is not working properly
Posted Date:
10 Aug 2012
Posted By::
Nirav Lalan
Member Level:
Silver
Member Rank:
1673
Points
: 5
Responses:
3
this code does not show integer number's data into textbox. not working properly.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex Then
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=D:\softwares\Rental\Rental\Rental.mdf;Integrated Security=True;User Instance=True"
con.Open()
Dim str As String = "select * from Payment where Order_No='" & ComboBox1.Text & "'"
Dim cmd As SqlCommand = New SqlCommand(str, con)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
Dim i As Integer
cmd.ExecuteNonQuery()
For i = 0 To ds.Tables(0).Rows.Count - 1
Order_NoTextBox.Text = ds.Tables(0).Rows(0)(0)
Client_NameTextBox.Text = ds.Tables(0).Rows(0)(1)
Contact_PersonTextBox.Text = ds.Tables(0).Rows(0)(2)
PeriodTextBox.Text = ds.Tables(0).Rows(0)(3)
Total_AmountTextBox.Text = ds.Tables(0).Rows(0)(4)
Bill_NoTextBox.Text = ds.Tables(0).Rows(0)(5)
Bill_DateDateTimePicker.Text = ds.Tables(0).Rows(0)(6)
Bill_AmountTextBox.Text = ds.Tables(0).Rows(0)(7)
PaymentTextBox.Text = ds.Tables(0).Rows(0)(8)
StatusTextBox.Text = ds.Tables(0).Rows(0)(9)
Next
con.Close()
End If
End Sub
Tweet
Responses
#683930 Author:
Prasad kulkarni
Member Level:
Diamond
Member Rank:
8
Date: 10/Aug/2012 Rating:
Points
: 1
What error it gives ?
what output you want exactly ?
Thanks
Koolprasd2003
[DotNetSpider MVM]
#683994 Author:
Kapil
Member Level:
Gold
Member Rank:
50
Date: 12/Aug/2012 Rating:
Points
: 3
Hi,
You have not elaborated what exactly is not working, you should so we can provide the solution for that. But anyways, looking into your code i have some question,
What is your Query returning? Does it return more then one row if yes How you can display all rows in Text Box's or some controls as you are trying to do in for loop.
Your for loop is going to iterate and display only one row in your controls.
If that is not working let us know, if you are just displaying the data here and your query is returning more then one row you should use data controls like DataGrid, Gridview, Repeater and so on based on your requirement.
Hope that will help and let us know what is not working..
Happy Coding
"Please don't forget to Rate this answer if you found it usefull"
http://www.dotnetspider.com/mentors/86-kapil-deo.aspx
My Blog
#684192 Author:
Nirav Lalan
Member Level:
Silver
Member Rank:
1673
Date: 13/Aug/2012 Rating:
Points
: 1
thnx 2 all.. now it's working properly..
Post Reply
You must
Sign In
to post a response.
Tweet
Next :
Create dynamic textbox on tree view node creation
Previous :
Update a access database with sql
Return to Discussion Forum
Post New Message
Category:
Related Messages
visual source safe
* .XmlSerializers.dll
Urgent-Guys-Refreshing Datagrid on the network ?
Urgent-Guys-Refreshing Datagrid on the network ?
How to create Dll fines
Active Members
Today
Pawan Awasthi
(46)
baskar
(22)
naveensanagase...
(21)
Last 7 Days
naveensanagase...
(224)
baskar
(191)
Pawan Awasthi
(190)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John