|
did u read the content within those bracket?
|
|
|
|
|
I've done more reading than you apparently. What is your point? Just because you are more comfortable with one database or edition over another does not make it the "best" choice. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
best choice for me yar... i didnt say for all... ok u want in access? right? i wil send u via mail...
|
|
|
|
|
hi biscoito ur mail id pls. i wil mail u the porgram from which i learnt. its i access...
|
|
|
|
|
1) you should be responding to the op
2) the op is a fool if they take advice or examples from you since you can't even respond to the correct post and don't know what c# is or which database edition to choose let alone the other posts you have made I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i just said i'm confortable with it man.. thats all dont start scolding me..
|
|
|
|
|
Noone in their right mind is going to give you their email address.
|
|
|
|
|
how should i take it as?
A compliment?
|
|
|
|
|
sidhu hacks wrote: best choice for me yar
Are you the one that's going to be running the code? Storing the information? No. Your application requirements dictate the database you use, NOT your confort level with it.
|
|
|
|
|
since he asked for db connection i thoguht he s a noob like me.. and so i told him wat i felt thats all.... chill out...
|
|
|
|
|
you've got a new fan!
|
|
|
|
|
required
using System.Data.OleDb;
Declaration part
string id;
string sqlQRY;
OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/Data.mdb");
OleDbCommand cmd = new OleDbCommand();
OleDbDataReader dr;
Open the connection in this statement
cn.Open();
its like database items loading in a list
cmd.CommandText = "SELECT * FROM tbladmin ORDER BY ID ASC";
cmd.Connection = cn;
dr = cmd.ExecuteReader();
while (dr.Read())
{
ListViewItem list = new ListViewItem(dr[0].ToString());
list.SubItems.Add(dr[1].ToString());
list.SubItems.Add(dr[2].ToString());
listView1.Items.AddRange(new ListViewItem[] { list });
}
dr.Close();
this is wat i can help for now.. it tedious cant post the whole code here.. sending ur mail id wil help....
others pls gimme a break .. stop pulling my leg...
|
|
|
|
|
I have added a Text File to my project. Can somebody please tell me what the code is to send, modify and retrieve information - say from text boxes - to that file?
|
|
|
|
|
Have a look at the TextReader , TextWriter and File classes all in the System.IO namespace. They contain everything you need.Dave
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks
|
|
|
|
|
Hi,
I would like to loop through the DataSet at runtime to retrieve selected values and store them in local variables but i am not sure how i could do this using DataSet that is generated using the inbuilt wizard. I am using SQL Server Compact. My database has "*.sdf" extension. I created a strongly typed DataSet using the wizard. So in the solution explorer i can see the DataSet and it has an extension of "*.xsd".
At the moment i am doing this:
foreach(DataGridViewRow dgvrow in CustomerGridView.Rows)
{
String Surname = dgvrow.Cells[2].Value.ToString();
}
Wouldnt it be more efficient if i looped through the DataSet that I have created? If so, how would i go about doing this based on the above code.
If anybody could assist me with this, it would be much appreciated.
Thanks,
|
|
|
|
|
use something like:
ds.TableName[RowIndex].ColumnName;
|
|
|
|
|
Hi,
Thanks but do i not need to modify what is in between the brackets?
foreach(DataGridViewRow dgvrow in CustomerGridView.Rows)
Also how would i access the value from the specified index?
Thanks,
|
|
|
|
|
well offcourse you do.
Either you loop the dvg or the ds.
foreach (DataRow r in ds.Tables["TableName"].Rows)
{
String surname = r.ItemArray[2].ToString();
}
but I'm really not sure that it will be faster.
If you want fast forget about ds and dvg(sure use one for the UI display) and
use a List<MyClass> set the dgv.DataSource = myList;
and then Loop throuh the List or use linq or ....
[Added] the DataRow.ItemArray returns an array of objects => many casts/boxing/unboxim => poor perf
On the other hand if you load the data in a List<myclass> using a datareader => no casting and faster
when loading data, and especially faster when looping/searching/whatever on the List/Datas.[/Added]modified on Wednesday, March 10, 2010 6:40 PM
|
|
|
|
|
Not really. You can loop through properties of your tables since you have typed dataset.
foreach(MyTableRow row in MyTable.Rows)
string surname = row.SurName;
|
|
|
|
|
Hi,
Just a quick question regarding best practice, is it best to loop through the rows like you have stated instead of looping through the datagridview?
Thanks for the input all.
|
|
|
|
|
Basically depends on what you want to achieve.
In case it is looping through all visible rows in datagridview (In case you are using DataView) then DataSet is of no help.
In case it is a basic looping through all the rows, why bother going to datagridview? you need to cast the object back to your datatype. Better would be to loop through TYPED datarow through a TYPED datatable... typed datarow already takes care of the conversion.
|
|
|
|
|
Hi, this is my first posting at this forum and I need some help with my project. I am new to c# and still confused at times ...
My application is as follow:
I have main MDI_ParentForm, from which I open a ChildForm. I use ChildForm as drawing area for my graph.
I am dividing ChildForm up into smaller areas (rectangles). This is done by creating new object:
myDivisionClass myGDI = new myDivisionClass(this) ;
In my class definition for myDivisionClass I create object for each reactangle (for example: first rectangle represents grid area, second title, third labels for traces and so on ...)
myGraphGridClass myGrid = new myGraphGridClass(myRectangle);
myGraphTitle myTitle = new myGraphTitle(myRectangle);
myGraphLabels myTitle = new myGraphLabels(myRectangle);
etc...
Now I want to add a setup form (shown when pressing button on ChildForm), from which I could change properties of my myGrid object from myGraphGridClass .
I would also like to be able to open any number of ChildForms and change properties for each individual ChildForm object (so each could display graph with different settings ) ...
tnx, Pata
|
|
|
|
|
peropata wrote: I would also like to be able to open any number of ChildForms and change properties for each individual ChildForm object (so each could display graph with different settings ) ...
just put the this.Owner == toYourMDIParent for each of the child.
peropata wrote: Now I want to add a setup form (shown when pressing button on ChildForm), from which I could change properties of my myGrid object from myGraphGridClass.
There are many options:
One would be to Create a Custom/User Control that encapsuletes your graph form and in that control put the comboboxes textboxes, etc to alter/modify different properties of the graph
Or if you want a setup/properties button create a new form that deals with the different properties
and in the ctor pass in your graph
eg:
SetupForm sf = new SetupForm(this.myGraph)
or something like this.
|
|
|
|
|
Or if you want a setup/properties button create a new form that deals with the different properties
and in the ctor pass in your graph:
SetupForm sf = new SetupForm(this.myGraph)
This code would work for setting properties defined in myDivisionClass class, and not for properties defined in myGraphGridClass . In this case I would have to transfer values from myDivisionClass object to myGraphGridClass object which is created in myDivisionClass . I want ro know if there is a way to directly change properties defined in myGraphGridClass .
Pata
|
|
|
|