473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to display data into a message box from database

i wanT to disply username which is in my database column3
my code:
Expand|Select|Wrap|Line Numbers
  1. Dim cmd As New SqlCommand
  2.  
  3.  
  4.         cmd = con.CreateCommand()
  5.  
  6.         cmd.CommandText = "select * from plane where startdate=@sdate"
  7.         cmd.Parameters.AddWithValue("@sdate", Date.Today())
  8.         Dim rd As SqlDataReader
  9.         rd = cmd.ExecuteReader()
  10.         MsgBox(" USER" &rd(3).ToString.Trim()& "PACKAGE IS END TODAY")
  11.  rd.Close()
  12.  
Attached Images
File Type: jpg Untitled.jpg (34.8 KB, 460 views)
Dec 30 '12 #1
3 5938
Rabbit
12,516 Expert Mod 8TB
And what's the problem? Are you getting an error message? What's the message? Is it not doing what you want? What is it doing instead?

You should also be aware that column numbering starts at 0.
Dec 30 '12 #2
on msgbox line code errror: Invalid attempt to read when no data is present.
Dec 30 '12 #3
Rabbit
12,516 Expert Mod 8TB
That error means you didn't call the read method of the datareader. You have to call that first before trying to access any of the data.
Dec 31 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike | last post by:
Hi I have been tasked with converting my pulp and paper mills weekly projected and actual contractor hrs excel spreadsheet into a an Access 97 database. So far my design has been to use a...
3
by: Schapopa | last post by:
Hello, I have form where I want to display data from one record. So I created stored procedure with parameter and I populated some dropdown boxes with data, and now I would like to display that...
8
by: lli | last post by:
Hi Guys, I have designed a web application. In its one window I put a form. User can click submit button of this form to run a pathon script to get data from database. Then User get a new window...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
6
by: geeteshss | last post by:
hi all, i am using C#.NET(.NET 2003 version 1.1) with oracle as database (TOAD is the software for the database). I am a beginner so i was trying to display my data in the database screen...
7
by: nma | last post by:
Hi I'm trying to display data in a table list format but error message like this appear. What is wrong with the code? "Parse error: syntax error, unexpected '<' in C:\htdocs\...\MB2movieinfo.php...
1
by: ganesh22 | last post by:
Hi, my requriment is i want to display data from database in ms.word? Iam using asp.net with C# bcoz iam inserting resume in sqlserver, so i want to display that resume in word
4
by: JuAn2226 | last post by:
Hi, can anyone help me . when my program starts there is numbers and time will be display in the form of visual basic. it will run continuesly .My problem here is i dont know how to display the data...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.