.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to show following format in listbox control?

Posted By: sheeba     Posted Date: April 29, 2011    Points:5   Category :ASP.Net
Hi

I want to show my listbox control like that


BatchNo : 008 - Partno : 003
BatchNo : 008 - Partno : 004
BatchNo : 008 - Partno : 005
BatchNo : 008 - Partno : 006
BatchNo : 008 - Partno : 007
BatchNo : 008 - Partno : 008

iam using the query like this

c.selectdb(oitem);
oitem.open();
dt = new DataTable();
Ada = new OleDbDataAdapter("SELECT DISTINCT A.BATCHNO,B.PARTNO FROM BATCHCODE A JOIN DETAIL B ON A.BATCH_CODE=B.BATCH_CODE WHERE B.REMARKS='REW.' AND A.BATCH_CODE='"+BatchCode+"'" , oitem.con);
Ada.Fill(dt);
lstRework.DataSource = dt;
lstRework.DataTextField = "BATCHNO";
lstRework.DataValueField = "PARTNO";
lstRework.DataBind();
oitem.close();

how to do...

thanks

Responses
Author: Mahesh             
Posted Date: May 03, 2011     Points: 20   

hi,
use following query rest all is fine,

SELECT DISTINCT
'BatchNo : ' + convert(varchar,A.BATCHNO) + '- Partno : ' + convert(varchar,B.PARTNO) as 'BATCHNO' ,
B.PARTNO FROM BATCHCODE A JOIN DETAIL B ON A.BATCH_CODE=B.BATCH_CODE WHERE B.REMARKS='REW.' AND A.BATCH_CODE= ..

hope this helps

Thanks
Mahesh




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend