|
Sonia Gupta wrote: j = ++i;
in the above code , specially in the last line,i am thinking that the variable j will get the value first , then valiable i will get the value.
No, that's not correct. First the variable i is incremented, then the new value of i is assigned to the j variable.
Sonia Gupta wrote: and normally the execution goes from right to left.But in this case of prefix the exexcution goes from left to right
No, in an assigment the value is always calculated before it's assigned to the variable.
Consider this statement:
j = i++;
First the variable i is incremented, then the previuos value of i is assigned to the j variable. The value of the expression i++ is the previous value of the variable, although the variable is incremented before the value of the expression is used.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Thanks.....
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
What's the meaning of primitive type here?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
your statement is wrong.
Primitive types datatypes are basic system defined data types.It includes Object and string also and both are reference type.
and if you look at Value type, the value type variables directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined (structs), or enumerations (enums).
|
|
|
|
|
why are u asking so many basic questions that u can answer urslef by reading a book on C#
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Presumably they're homework questions, and actually learning the subject matter would be too much effort.
|
|
|
|
|
yes why put soo much effort when u have CP
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
i am declaring two classes
class A
{
virtual void abc()
{
}
}
class B:A
{
override void abc()
{
}
}
now i create an object for both the classes
A d = new A();
B e =new B();
d.abc();
or
e.abc();
in case of e.abc() abc() function is of class A or B
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
|
What is this?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Hi all,
I had 2 tab.
each tab had a table and a update btn.
User after updating the cell in the table. he will press the update btn before pressing the other tab.
it is possible tat?
everytime the user updated the cell, and he press the tab, the application will promote him to press the update 1st?
how was it done with the coding?
this are the call event.
private void dgScore_CellEndEdit(object sender, DataGridViewCellEventArgs e)
private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
any other event I can use to make it possible?
|
|
|
|
|
I suggest you should change the interface model. Basically tab control is not meant to work like that. It might be possible to use it that way but it would definately be v confusing for the user.
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Is there a way to cancel the event to change tab?
So it will remain at the same page.
|
|
|
|
|
Hi,
I have a Datagrid in my windows form to which i am entering data like name,roll no.,class...its working fine.but when i close this window and reopen it i cannot find the date that i have entered.
I want the data grid to display the previous data also everytime when i enter the new data
the form looks like this::
DATAGRID
Textboxes ot enter values
Upgrade button
How can i do this......
Requesting help.
Thanking You
C#
|
|
|
|
|
Did u use data base for it
Happy Programming
-----
Abhijit
|
|
|
|
|
No i am not using any database for this....
so is it not possible to do it without a database.....
what i am trying to do is that the details am entering should be permanently be in datagrid and the new details should keep on enetring to the database
Thanking You
C#
|
|
|
|
|
No, you have store data to store and retrive from it.
You can use CSV, XML and Registry and Also Database to store data .
and you have to use any one of them to permanently store data!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Hi With Out Database If u close that screen and reopen it,It wont display pre records what u have entered...,
Y u cant use a temp table for that?????,
If u like thuis reply rate thsi msg...,
Regards,
Magi
|
|
|
|
|
Insted of Temp table, XML will be better
Happy Programming
-----
Abhijit
|
|
|
|
|
|
hi again,
one more doubt on this issue....
i want another form(form2) with text boxes to accept all the details and when i click on an update button on tis form the details should be shown on the data grid that is present on the form1....
ie i should have two forms:first form with data grid and form2 with text boxes for name ,roll number and classes ...
what is the logic ie how can i make theses two forms communicate....
thanks again guys
C#
|
|
|
|
|
|
sure Abhijit i will explain:
i have two windows form form1 and form2
in form one i have a datagrid and a "show button"
when i click on the show button the second from ie form2 will pop up....
in this form2 i have text boxes and a "update button"....and when i enter the details on the text box and click on the update button in form2 all the details will get updated on to the datagrid in form1
do i need to use delegates for this purpose.....
how cn do this....
Thanking you
C#
|
|
|
|
|
Thanks for Explining,
I am asuming your database has Roll, Name , Address , Marks fields
And Create a Load_Grid() Function on form_load()
Load_Grid()
{
Load data to grid();
}
Now see, in your datagrid there may be multiple records ? is it ?
Now read the key value from that row, and pass the value in the next form.
Supoose u select row 2 and roll=5, pass this to form 2, u can easily access the controls of other form just creating the object and access.
Now in Form2,
There is Three Text box,
Roll : txtroll
Name: txtName
Address : txtAddress
Now,
SQLCommand cmd=new sqlcommand("select * from student where roll='_RollVal',conn) // _RollVal is passed value
SqlDataReader dr=new Sqldatareader();
dr= cmm.executenonquery();
now u can get the value
txtRoll.Text=dr[0].text
txtName.Text=dr[0].text
Now change the vale in text box, and on click on UpdateButton .... Update database [ Just use Update Command to Update] and back to the Form1..... , and all refresh data will come to you grid, cause , load_grid() will call on Form Load.
Hope You like This..... And for any query ask me
Good luck
Happy Programming
-----------------
Abhijit Jana
Noida, India
|
|
|
|
|