Click here to Skip to main content
15,918,889 members
Home / Discussions / Database
   

Database

 
GeneralRe: Adding a new row to a DataTable Pin
dptalt22-Aug-06 3:37
dptalt22-Aug-06 3:37 
GeneralRe: Adding a new row to a DataTable Pin
Keith Malwitz22-Aug-06 4:53
Keith Malwitz22-Aug-06 4:53 
GeneralRe: Adding a new row to a DataTable Pin
dptalt23-Aug-06 16:52
dptalt23-Aug-06 16:52 
GeneralRe: Adding a new row to a DataTable Pin
Keith Malwitz23-Aug-06 17:33
Keith Malwitz23-Aug-06 17:33 
GeneralRe: Adding a new row to a DataTable Pin
dptalt25-Aug-06 3:11
dptalt25-Aug-06 3:11 
AnswerRe: Adding a new row to a DataTable [modified] Pin
Stephen McGuire22-Aug-06 7:12
Stephen McGuire22-Aug-06 7:12 
GeneralRe: Adding a new row to a DataTable Pin
dptalt22-Aug-06 16:34
dptalt22-Aug-06 16:34 
GeneralRe: Adding a new row to a DataTable Pin
Stephen McGuire23-Aug-06 5:34
Stephen McGuire23-Aug-06 5:34 
Dim MyTable As DataTable
MyTable = New DataTable("MyTable")

Dim myDataColumn As DataColumn

'Create and add columns
'An Integer column
myDataColumn = New DataColumn
With myDataColumn
.DataType = System.Type.GetType("System.Int32")
.ColumnName = "Quantity"
.DefaultValue = 1
End With
tempChargesTable.Columns.Add(myDataColumn)

'A String column
myDataColumn = New DataColumn
With myDataColumn
.DataType = System.Type.GetType("System.String")
.ColumnName = "Description"
.DefaultValue = "My default text..."
End With
tempChargesTable.Columns.Add(myDataColumn)

'And so on...

'Add table to your dataset
MyDataSet.Tables.Add(MyTable)

That's how to do it in a table...
You could set the default values in your query but if you have hundreds of fields I suppose you are using a 'SELECT *' statement.

If your query is returning hundreds of fields, it is not very efficient. I assume your datasource is not normalised? If it isn't, your best solution would be to sort that out...

Where is the data coming from?
What are you going to do with the data?

Steve
GeneralRe: Adding a new row to a DataTable Pin
dptalt23-Aug-06 16:48
dptalt23-Aug-06 16:48 
QuestionAddnew not working inside a Class Library Pin
Charleboy21-Aug-06 5:53
Charleboy21-Aug-06 5:53 
AnswerRe: Addnew not working inside a Class Library Pin
Colin Angus Mackay21-Aug-06 9:01
Colin Angus Mackay21-Aug-06 9:01 
GeneralRe: Addnew not working inside a Class Library Pin
Charleboy21-Aug-06 14:03
Charleboy21-Aug-06 14:03 
GeneralRe: Addnew not working inside a Class Library Pin
Charleboy22-Aug-06 1:40
Charleboy22-Aug-06 1:40 
AnswerRe: Addnew not working inside a Class Library Pin
Keith Malwitz21-Aug-06 17:51
Keith Malwitz21-Aug-06 17:51 
QuestionAbout Begin and commit transaction in SQL Server 2000 Pin
selvaraj S.Kaliyappan20-Aug-06 23:07
selvaraj S.Kaliyappan20-Aug-06 23:07 
AnswerRe: About Begin and commit transaction in SQL Server 2000 Pin
Colin Angus Mackay20-Aug-06 23:41
Colin Angus Mackay20-Aug-06 23:41 
GeneralRe: About Begin and commit transaction in SQL Server 2000 Pin
selvaraj S.Kaliyappan21-Aug-06 0:53
selvaraj S.Kaliyappan21-Aug-06 0:53 
QuestionTip about Queries ? Pin
faviochilo20-Aug-06 16:07
faviochilo20-Aug-06 16:07 
AnswerRe: Tip about Queries ? Pin
Eric Dahlvang21-Aug-06 7:59
Eric Dahlvang21-Aug-06 7:59 
GeneralRe: Tip about Queries ? Pin
i.j.russell22-Aug-06 2:58
i.j.russell22-Aug-06 2:58 
QuestionOnline articles on Data warehousing Pin
WillemM20-Aug-06 8:44
WillemM20-Aug-06 8:44 
QuestionSqlDateTime overflow Pin
Paddy Boyd20-Aug-06 0:44
Paddy Boyd20-Aug-06 0:44 
Questionstore picture as binary Pin
Mohammed Elkholy19-Aug-06 7:44
Mohammed Elkholy19-Aug-06 7:44 
AnswerRe: store picture as binary [modified] Pin
Colin Angus Mackay19-Aug-06 8:06
Colin Angus Mackay19-Aug-06 8:06 
GeneralRe: store picture as binary Pin
Jerry Hammond19-Aug-06 18:44
Jerry Hammond19-Aug-06 18:44 

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.