Click here to Skip to main content
15,892,298 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Creating aspx Page Dynamically Pin
Christian Graus23-Feb-09 9:07
protectorChristian Graus23-Feb-09 9:07 
AnswerRe: Creating aspx Page Dynamically Pin
Colin Angus Mackay23-Feb-09 9:10
Colin Angus Mackay23-Feb-09 9:10 
GeneralRe: Creating aspx Page Dynamically Pin
Aman Bhullar23-Feb-09 19:13
Aman Bhullar23-Feb-09 19:13 
GeneralRe: Creating aspx Page Dynamically Pin
Colin Angus Mackay23-Feb-09 21:04
Colin Angus Mackay23-Feb-09 21:04 
AnswerRe: Creating aspx Page Dynamically [modified] Pin
Kariem Soudy23-Feb-09 20:56
Kariem Soudy23-Feb-09 20:56 
QuestionGridView Row not collapsing while clicking on any node on the treeview Pin
meeram39523-Feb-09 5:05
meeram39523-Feb-09 5:05 
QuestionParser Error Message: Child nodes not allowed. Pin
khuzwayom23-Feb-09 4:55
khuzwayom23-Feb-09 4:55 
QuestionAdding Concatenated Column to DataTable [modified] Pin
Steve Skelton23-Feb-09 4:51
Steve Skelton23-Feb-09 4:51 
This should be a common need but I haven't found a method so far. What i want to do is, in a result from a SQL Query, define some columns to be, say, Full Name on load to the datagrid rather than 3 cols for first, mid and last name. so, no joins, just select from db, manipulate data, bind to datagrid.

Currently i am using DataTable as I only need read-only to the data. this code looks like it might work:

Dim resultsDataSet As New DataTable()

Dim FullName() As DataColumn = { _
resultsDataSet.Columns("FIRST_NAME"), _
resultsDataSet.Columns("MID_NAME"), _
resultsDataSet.Columns("LAST_NAME")}

Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(cmd)
myDataAdapter.Fill(resultsDataSet)


DisplayResults.DataSource = resultsDataSet
resultsDataSet.Columns.Add(FullName(2))
DisplayResults.DataBind()

But I get the error "'column' argument cannot be null." when i try to load the datagrid. also, i don't know what i should but in the declared array FullName() during bind - 2 is a guess based on the fact that there are 3 columns defined for this one. In addition, it's *OK* to have the new table be null if First, Mid and Last (name) is in fact not given in the data source.

TIA

Issue resolved - I did the concatenated table in the db instead.

modified on Monday, February 23, 2009 11:03 AM

AnswerRe: Adding Concatenated Column to DataTable Pin
ToddHileHoffer23-Feb-09 5:08
ToddHileHoffer23-Feb-09 5:08 
GeneralRe: Adding Concatenated Column to DataTable Pin
Steve Skelton23-Feb-09 5:10
Steve Skelton23-Feb-09 5:10 
GeneralRe: Adding Concatenated Column to DataTable Pin
ToddHileHoffer23-Feb-09 5:19
ToddHileHoffer23-Feb-09 5:19 
GeneralRe: Adding Concatenated Column to DataTable Pin
Steve Skelton23-Feb-09 5:25
Steve Skelton23-Feb-09 5:25 
QuestionASP.NET application load Pin
alexfromto23-Feb-09 3:50
alexfromto23-Feb-09 3:50 
AnswerRe: ASP.NET application load Pin
ToddHileHoffer23-Feb-09 4:09
ToddHileHoffer23-Feb-09 4:09 
QuestionNeed VB/ASP equivalent of PHP's fie_get_contents to retrieve URL contents Pin
Doug Coughler23-Feb-09 3:48
Doug Coughler23-Feb-09 3:48 
QuestionResource for understanding working of web application Pin
Vishnu Nath23-Feb-09 3:35
Vishnu Nath23-Feb-09 3:35 
AnswerRe: Resource for understanding working of web application Pin
ToddHileHoffer23-Feb-09 4:00
ToddHileHoffer23-Feb-09 4:00 
QuestionSession in classes Pin
mehrdadc4823-Feb-09 3:26
mehrdadc4823-Feb-09 3:26 
AnswerRe: Session in classes Pin
Vimalsoft(Pty) Ltd23-Feb-09 3:32
professionalVimalsoft(Pty) Ltd23-Feb-09 3:32 
AnswerRe: Session in classes Pin
Greg Chelstowski23-Feb-09 3:34
Greg Chelstowski23-Feb-09 3:34 
AnswerRe: Session in classes Pin
ToddHileHoffer23-Feb-09 4:00
ToddHileHoffer23-Feb-09 4:00 
Questionshoe Euro sign in gridView Items Pin
mehrdadc4823-Feb-09 3:23
mehrdadc4823-Feb-09 3:23 
AnswerRe: shoe Euro sign in gridView Items Pin
Anurag Gandhi23-Feb-09 3:37
professionalAnurag Gandhi23-Feb-09 3:37 
QuestionRadio Button Selection Pin
Sarfaraj Ahmed23-Feb-09 2:50
Sarfaraj Ahmed23-Feb-09 2:50 
AnswerRe: Radio Button Selection Pin
Sneha Bisht23-Feb-09 2:54
Sneha Bisht23-Feb-09 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.