473,408 Members | 1,735 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,408 software developers and data experts.

I have used this code in ASP.NET. what is the same for VB.Net

Expand|Select|Wrap|Line Numbers
  1. Public Sub FillDdl(ByVal str1 As String, ByRef dt As Data.DataTable, ByVal ddl As ComboBox)
  2.         Try
  3.             cmd.CommandText = Data.CommandType.Text
  4.             cmd.CommandText = str1
  5.             da.SelectCommand = cmd
  6.             da.SelectCommand.Connection = con
  7.             dt.Rows.Clear()
  8.             da.Fill(dt)
  9.             If dt.Rows.Count > 0 Then
  10.                 Dim dv As New Data.DataView(dt)
  11.                 ddl.DataSource = dv
  12.                 ddl.DataTextField = "Name"
  13.                 ddl.DataValueField = "Code"
  14.                 ddl.DataBind()
  15.             End If
  16.         Catch ex As Exception
  17.         End Try
  18.     End Sub
  19.  
Im getting error in this section:
Expand|Select|Wrap|Line Numbers
  1.                 ddl.DataTextField = "Name"
  2.                 ddl.DataValueField = "Code"
  3.                 ddl.DataBind()
  4.  
Jul 23 '10 #1
1 1146
PsychoCoder
465 Expert Mod 256MB
Well the VB.NET you use with ASP.NET is the same as you would use for a WinForms application. Without knowing the exact error message you're receiving it's nearly impossible for us to help formulate a resolution ;)
Aug 1 '10 #2

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

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
6
by: John Ortt | last post by:
Hi there everyone, I have a part info form which has a faded image of our company logo as a background. I want to replace the faded image with a bright red warning image on items which have run...
20
by: Tim Mulholland | last post by:
This thread is intended to be more of a discussion thread - because i value the opinions of the posters in this newsgroup, and especially the MVPs like Nicholas Paladino and Jon Skeet (thanks to...
6
by: Jéjé | last post by:
Hi, I have a custom aspx page which access RS (Reporting Services) using the webservice interface. I'm using the delegation (defautcredentialcache) to send the user authentication to RS. RS...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
3
by: Tim_Mac | last post by:
Hi, i have this in my web.config: <pages validateRequest="false" > <controls> <add tagPrefix="uc1" src="/Whatever.ascx" tagName="Whatever"/> i have this in Login.aspx: <uc1:Whatever id="Blah"...
3
by: pradeep | last post by:
Hello, Can any one tell me different functions or properties of javascript which are gives different outputs on different browsers ? Thanks in advance. Bye
3
by: Hanoodah | last post by:
Good morning all, Please I need help in a form that I have designed to fill user information. This form needs two drop-down list about specific date, one about contract date, and the other about...
4
by: =?GB2312?B?1ty8w8rHxLjAz8rz?= | last post by:
Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) Result 1:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.