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

Vb-Net How to bind a datalist?

Hi all,

Tel me a coding to bind the datalist.Is it same as that of gridview?
PLS Help.

Thanks
Jeen
Oct 11 '07 #1
2 1546
HI...

To bind a datalist is same as binding a datasource in datagrid....

Me.DataList1.DataSource = contDs
Me.DataList1.DataBind()

First, you have to edit the template by right clicking the dataitem control..
select the Item Templates and add a label control (for example)
select the label control and open its property.. go to databindings
select the custom binding expression.
there you type the code below and click ok:

DataBinder.Eval(Container.DataItem,"Name")
assuming one of your the fields in you table1 is "Name"

ok regards,
Ruel




================================================== =====

Hi all,

Tel me a coding to bind the datalist.Is it same as that of gridview?
PLS Help.

Thanks
Jeen
Oct 15 '07 #2
HI...

To bind a datalist is same as binding a datasource in datagrid....

Me.DataList1.DataSource = contDs
Me.DataList1.DataBind()

First, you have to edit the template by right clicking the dataitem control..
select the Item Templates and add a label control (for example)
select the label control and open its property.. go to databindings
select the custom binding expression.
there you type the code below and click ok:

DataBinder.Eval(Container.DataItem,"Name")
assuming one of your the fields in you table1 is "Name"

ok regards,
Ruel




================================================== =====
Thank U Ruel for ur solution.

Jeen
Oct 15 '07 #3

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

Similar topics

17
by: Simon Foster | last post by:
I am meeting with a potential client next week to discuss starting a new project. His preference is for VB whereas I would prefer Python for obvious reasons ;-) Could anybody come up with a...
1
by: vinuta | last post by:
I have three vb classes. First one has a variable whose value i want to use in a function in third vb class which is called by the second vb class. e:g; first.aspx.vb second.aspx.vb third.vb...
5
by: thomas | last post by:
Hello, I wonder if it is possible to include visual basic class to a C++ project within a solution. Thanks Thomas
3
by: Kaypee | last post by:
Howdy all am trying to convert c# app to VB so change alter parts of it. But am getting confused by a couple of bits... at least ;-) a) private point path1(point p1, point p2) { int minX...
6
by: Ryan | last post by:
I have 2 forms, Form1.vb and Form2.vb. In Solution Explorer, Form2.vb no longer shows a Form icon nor do I have the option to open Form2.vb in the main explorer window where usually I have the...
3
by: =?Utf-8?B?Q2luZHk=?= | last post by:
Hi all, I am trying to connect to a electromyograph machine for my thesis project, and I have a VB DDE client whose DDE functionality I want to convert to VC++. However I can't make my VC++...
25
by: Andy B | last post by:
How hard/easy is it to use/learn VB compared to c#?
4
by: EricW | last post by:
Hi, I found the following code in a FAQ about the datagridview. But I am having a hard time translating it to VB, so I would like to ask via here for someone more experienced to translate this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
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...

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.