Hi,
I have done following: Add new item - Dataset, then add DataTable, and
add a few fields (VS2005) because this seems the only way to let a
Crystalreport recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I
populate the dataTable in code ? I don't need a connection to a
database and so.
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz 6 1477
Hi Wilfried,
Here's a simplified example:
"How To: Fill a DataSet with Data": http://msdn2.microsoft.com/en-us/lib...20(VS.80).aspx
--
Dave Sexton
"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
Hi,
I have done following: Add new item - Dataset, then add DataTable, and add a
few fields (VS2005) because this seems the only way to let a Crystalreport
recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I populate
the dataTable in code ? I don't need a connection to a database and so.
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz
Hi Wilfried,
I'm sorry, I just realized you wrote "don't" need a connection to a database.
In that case, here's a simple example. Assuming that you have a strong-typed
DataSet named, "PeopleData" that contains a single DataTable named, "People",
which only contains a single column named, "Name" of type System.String, you
could do the following:
PeopleData data = new PeopleData();
data.People.AddPeopleRow("Joe");
data.People.AddPeopleRow("Fred");
data.AcceptChanges();
HTH
--
Dave Sexton
"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
Hi,
I have done following: Add new item - Dataset, then add DataTable, and add a
few fields (VS2005) because this seems the only way to let a Crystalreport
recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I populate
the dataTable in code ? I don't need a connection to a database and so.
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz
Heya Wilfried,
Daft question - but re your Crystal Report - Are you attempting to
dynamically alter the design and such of the CrystalReport proper? If so a
heads up of a headache that I had to find out the hard way - You can't with
the API and CrystalReports namespace that is shipped with VS2005...
If not ignore me :)
Brendon
"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
Hi,
I have done following: Add new item - Dataset, then add DataTable, and add
a few fields (VS2005) because this seems the only way to let a
Crystalreport recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I populate
the dataTable in code ? I don't need a connection to a database and so.
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz
Hy Brendon,
Yes and no, but I just discovered ReportViewer witch seems very much
simpler to work with. Also it understand Object Data Sources, which I
think this is improvement. Now I have to learn these things too :)
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz
Brendon Bezuidenhout wrote:
Heya Wilfried,
Daft question - but re your Crystal Report - Are you attempting to
dynamically alter the design and such of the CrystalReport proper? If so
a heads up of a headache that I had to find out the hard way - You can't
with the API and CrystalReports namespace that is shipped with VS2005...
If not ignore me :)
Brendon
"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
>Hi,
I have done following: Add new item - Dataset, then add DataTable, and add a few fields (VS2005) because this seems the only way to let a Crystalreport recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I populate the dataTable in code ? I don't need a connection to a database and so.
-- rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz
Here is an alternate way (not using strongly typed):
DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("TEST");
DataRow row ;
for(int i = 0;i<3;i++)
{
row=dt.NewRow();
row["TEST"] ="Howdy " +i.ToString();
dt.Rows.Add(row);
}
ds.Tables.Add(dt);
Done! Cheers,
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"Wilfried Mestdagh" wrote:
Hi,
I have done following: Add new item - Dataset, then add DataTable, and
add a few fields (VS2005) because this seems the only way to let a
Crystalreport recognize a datatable in the project.
Now the problem, should be simple but I cannot find it. How can I
populate the dataTable in code ? I don't need a connection to a
database and so.
--
rgds, Wilfried [MapPoint MVP] http://www.mestdagh.biz This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mico |
last post by:
I would be very grateful for any help with the following problem:
I use a DataAdapter to fill a DataSet in the Page_Load method.
Later, I use this DataSet to construct a DataTable, then create...
|
by: Ricardo Luceac |
last post by:
HI all..
I have a huge table that I want to display in a datagrid, the problem is
that if I make a dataset, the entire table must go to the dataset to the
data begin to display, and it takes...
|
by: Robert |
last post by:
I'm sure this is a fairly basic question, but I've been looking all over the
web for days for suggestions on how to do this.
I've got a datagrid that's bound to a dataset on my form. It includes...
|
by: Chris Leuty |
last post by:
I am populating a multiselect Listbox from a dataset, with the content of
the listbox filled by one table, and the selections determined from another
table. So far, I have been keeping the dataset...
|
by: MicroMoth |
last post by:
I know that this is probably a simple question, but I can't seem to find out
how to populate the form fields I have with the results from my stored
procedure, which I have stored in a datase. I...
|
by: Bob Davies |
last post by:
Hi
I have a webservice that retrieves data from a database, this is then
returned to the calling client application built in windows forms within a
dataset, however upon attempting to create...
|
by: babu17 |
last post by:
hi ,
I have a database table with 3 columns
table1:
eid ename parentid
0 root 0
1 child1 0
2 child2 0
|
by: JordanMartz |
last post by:
''' <summary>
''' Populates the DataGridView
''' </summary>
Private Sub PopulateDataGridView()
' Set the column header names.
userAccessGrid.ColumnCount = 5
...
|
by: Brock |
last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The
reason for this is that I want the user to be able to change values
without updating the database, but still have their report...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |