473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

autogeneration

Autogeneration is set to particular field.example group code.
after i delete or update that rows. the group code is not updated.
Apr 7 '08 #1
4 1485
balame2004
142 100+
Hi Shalini,

We can not explicitly set the value to a field which is declared as autogenration key. Value is automatically generated by the database itself.

Regards,
Balaji U
Apr 7 '08 #2
hi

I need to populate the respective states from the states dropdownlist when a user chooses a country from the country dropdownlist. Similary when the state is selected from the states dropdownlist the corresponding cities should get displayed in the cities dropdownlistbox. Pls provide me with the coding? Here is the following code which i developed.

example(c#.net)
Expand|Select|Wrap|Line Numbers
  1. Private Sub fillcountry()
  2.         ddlcountry.Items.Add("India")
  3.         ddlcountry.Items.Add("UK")
  4.         ddlcountry.Items.Add("USA")
  5.         ddlcountry.Items.Add("Germany")
  6.     End Sub
  7.     Private Sub fillstate()
  8.         'list of states in india
  9.         ddlstate.Items.Add("Tamilnadu")
  10.         ddlstate.Items.Add("AndhraPradesh")
  11.         ddlstate.Items.Add("Kerela")
  12.         ddlstate.Items.Add("MadhyaPradesh")
  13.         'list of states in UK
  14.         ddlstate.Items.Add("Yorkshire")
  15.         ddlstate.Items.Add("London")
  16.         ddlstate.Items.Add("Surrey")
  17.         ddlstate.Items.Add("Manchestershire")
  18.         'list of states in USA
  19.         ddlstate.Items.Add("Florida")
  20.         ddlstate.Items.Add("California")
  21.         ddlstate.Items.Add("Atlanta")
  22.         ddlstate.Items.Add("Chicago")
  23.         'list of states in Germany
  24.         ddlstate.Items.Add("Berlin")
  25.         ddlstate.Items.Add("Hamberg")
  26.         ddlstate.Items.Add("Frankfurt")
  27.         ddlstate.Items.Add("Munich")
  28.     End Sub
  29.     Private Sub fillcity()
  30.         'list of cities in india
  31.         ddlstate.Items.Add("Mumbai")
  32.         ddlstate.Items.Add("Chennai")
  33.         ddlstate.Items.Add("Kolkatta")
  34.         ddlstate.Items.Add("Delhi")
  35.         'list of cities in UK
  36.         ddlstate.Items.Add("Yorkshire")
  37.         ddlstate.Items.Add("London")
  38.         ddlstate.Items.Add("Surrey")
  39.         ddlstate.Items.Add("Manchestershire")
  40.         'list of cities in USA
  41.         ddlstate.Items.Add("Florida")
  42.         ddlstate.Items.Add("California")
  43.         ddlstate.Items.Add("Atlanta")
  44.         ddlstate.Items.Add("Chicago")
  45.         'list of cities in Germany
  46.         ddlstate.Items.Add("Berlin")
  47.         ddlstate.Items.Add("Hamberg")
  48.         ddlstate.Items.Add("Frankfurt")
  49.         ddlstate.Items.Add("Munich")
  50.     End Sub
pls help me
Apr 15 '08 #3
balame2004
142 100+
hi

I need to populate the respective states from the states dropdownlist when a user chooses a country from the country dropdownlist. Similary when the state is selected from the states dropdownlist the corresponding cities should get displayed in the cities dropdownlistbox. Pls provide me with the coding? Here is the following code which i developed.

example(c#.net)

Private Sub fillcountry()
ddlcountry.Items.Add("India")
ddlcountry.Items.Add("UK")
ddlcountry.Items.Add("USA")
ddlcountry.Items.Add("Germany")
End Sub
Private Sub fillstate()
'list of states in india
ddlstate.Items.Add("Tamilnadu")
ddlstate.Items.Add("AndhraPradesh")
ddlstate.Items.Add("Kerela")
ddlstate.Items.Add("MadhyaPradesh")
'list of states in UK
ddlstate.Items.Add("Yorkshire")
ddlstate.Items.Add("London")
ddlstate.Items.Add("Surrey")
ddlstate.Items.Add("Manchestershire")
'list of states in USA
ddlstate.Items.Add("Florida")
ddlstate.Items.Add("California")
ddlstate.Items.Add("Atlanta")
ddlstate.Items.Add("Chicago")
'list of states in Germany
ddlstate.Items.Add("Berlin")
ddlstate.Items.Add("Hamberg")
ddlstate.Items.Add("Frankfurt")
ddlstate.Items.Add("Munich")
End Sub
Private Sub fillcity()
'list of cities in india
ddlstate.Items.Add("Mumbai")
ddlstate.Items.Add("Chennai")
ddlstate.Items.Add("Kolkatta")
ddlstate.Items.Add("Delhi")
'list of cities in UK
ddlstate.Items.Add("Yorkshire")
ddlstate.Items.Add("London")
ddlstate.Items.Add("Surrey")
ddlstate.Items.Add("Manchestershire")
'list of cities in USA
ddlstate.Items.Add("Florida")
ddlstate.Items.Add("California")
ddlstate.Items.Add("Atlanta")
ddlstate.Items.Add("Chicago")
'list of cities in Germany
ddlstate.Items.Add("Berlin")
ddlstate.Items.Add("Hamberg")
ddlstate.Items.Add("Frankfurt")
ddlstate.Items.Add("Munich")
End Sub

pls help me

Hi,

Try this:

Expand|Select|Wrap|Line Numbers
  1. //Global Variable
  2. private static DataTable CountryStateCityTable=new DataTable();
  3.  
  4.  
  5. page_load(...)
  6. {
  7.  
  8. //Setting autopostback property to true so page is posted back to the server whenever an event is being fired.
  9. this.CountryListBox.AutoPostBack=true;
  10. this.StateListBox.AutoPostBack=true;
  11. this.CityListBox.AutoPostBack=true;
  12.  
  13. //City,State,Country
  14.  
  15. CountryStateCityTable.Columns.Add("Country");
  16. CountryStateCityTable.Columns.Add("State");
  17. CountryStateCityTable.Columns.Add("City");            
  18.  
  19. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Chennai"});
  20. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Vellore"});
  21. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Koimbotore"});
  22. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Madurai"});
  23. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Thiruchy"});
  24. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Cochin"});
  25. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Ernakulam"});
  26. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Kolikode"});
  27. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Bangalore"});
  28. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mysore"});
  29. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mangalore"});
  30.  
  31. CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","New York"});
  32. CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","North Carolina"});
  33. CountryStateCityTable.Rows.Add(new string[]{"United States","Colambia","Colambia City"});
  34. CountryStateCityTable.Rows.Add(new string[]{"United States","Washington","Washington"});
  35. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Sindhu","Islamabad"});
  36. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Peshavur"});
  37. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Hyderabad"});
  38. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Punjab","Karachi"});
  39.  
  40.  
  41. this.CountryListBox.DataSource=new DataView(this.CountryStateCityTable).ToTable(true,"Country").DefaultView;
  42. this.CountryListBox.ValueMember="Country";
  43. this.CountryListBox.DisplayMember="Country";
  44.  
  45. }
  46.  
  47.  
  48.  
  49.  
  50. private void StateListBox_SelectedValueChanged(...)
  51. {
  52.     try
  53.     {
  54.         DataView view=new DataView(this.CountryStateCityTable);
  55.         view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"' AND State='"+this.StateListBox.SelectedItem.Text+"'";            
  56.         this.CityListBox.DataSource=viewToTable(true,"City").DefaultView;;
  57.         this.CityListBox.DisplayMember="City";
  58.         this.CityListBox.ValueMember="City";
  59.     }
  60.     catch(Exception exc)
  61.     {
  62.               Responce.Write(exc.Message);
  63.     }
  64. }
  65.  
  66. private void CountryListBox_SelectedValueChanged(...)
  67. {
  68.        try
  69.     {
  70.         DataView view=new DataView(this.CountryStateCityTable);
  71.             view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"'";        
  72.         this.StateListBox.DataSource=view.ToTable(true,"State").DefaultView;
  73.         this.StateListBox.DisplayMember="State";
  74.         this.StateListBox.ValueMember="State";
  75.     }
  76.     catch(Exception exc)
  77.     {
  78.            Responce.Write(exc.Message);
  79.     }
  80. }
  81.  
  82.  

- Balaji U
Apr 16 '08 #4
balame2004
142 100+
I have added IsPostBack condition here.



Expand|Select|Wrap|Line Numbers
  1. //Global Variable
  2. private static DataTable CountryStateCityTable=new DataTable();
  3.  
  4.  
  5. page_load(...)
  6. {
  7.  
  8. if(!IsPostBack)
  9. {
  10. //Setting autopostback property to true so page is posted back to the server whenever an event is being fired.
  11. this.CountryListBox.AutoPostBack=true;
  12. this.StateListBox.AutoPostBack=true;
  13. this.CityListBox.AutoPostBack=true;
  14.  
  15. //City,State,Country
  16.  
  17. CountryStateCityTable.Columns.Add("Country");
  18. CountryStateCityTable.Columns.Add("State");
  19. CountryStateCityTable.Columns.Add("City");            
  20.  
  21. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Chennai"});
  22. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Vellore"});
  23. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Koimbotore"});
  24. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Madurai"});
  25. CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Thiruchy"});
  26. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Cochin"});
  27. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Ernakulam"});
  28. CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Kolikode"});
  29. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Bangalore"});
  30. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mysore"});
  31. CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mangalore"});
  32.  
  33. CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","New York"});
  34. CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","North Carolina"});
  35. CountryStateCityTable.Rows.Add(new string[]{"United States","Colambia","Colambia City"});
  36. CountryStateCityTable.Rows.Add(new string[]{"United States","Washington","Washington"});
  37. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Sindhu","Islamabad"});
  38. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Peshavur"});
  39. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Hyderabad"});
  40. CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Punjab","Karachi"});
  41.  
  42.  
  43. this.CountryListBox.DataSource=new DataView(this.CountryStateCityTable).ToTable(true,"Country").DefaultView;
  44. this.CountryListBox.ValueMember="Country";
  45. this.CountryListBox.DisplayMember="Country";
  46. }
  47. }
  48.  
  49.  
  50.  
  51.  
  52. private void StateListBox_SelectedValueChanged(...)
  53. {
  54.     try
  55.     {
  56.         DataView view=new DataView(this.CountryStateCityTable);
  57.         view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"' AND State='"+this.StateListBox.SelectedItem.Text+"'";            
  58.         this.CityListBox.DataSource=viewToTable(true,"City").DefaultView;;
  59.         this.CityListBox.DisplayMember="City";
  60.         this.CityListBox.ValueMember="City";
  61.     }
  62.     catch(Exception exc)
  63.     {
  64.               Responce.Write(exc.Message);
  65.     }
  66. }
  67.  
  68. private void CountryListBox_SelectedValueChanged(...)
  69. {
  70.        try
  71.     {
  72.         DataView view=new DataView(this.CountryStateCityTable);
  73.             view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"'";        
  74.         this.StateListBox.DataSource=view.ToTable(true,"State").DefaultView;
  75.         this.StateListBox.DisplayMember="State";
  76.         this.StateListBox.ValueMember="State";
  77.     }
  78.     catch(Exception exc)
  79.     {
  80.            Responce.Write(exc.Message);
  81.     }
  82. }
  83.  
  84.  

- Balaji U
Apr 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
20
by: Ilias Lazaridis | last post by:
" A cooperation between Sun Microsystems and IBM&Co. in conjunction with liberal & high evolutive communities would result in an nearly unbeatable programming platform. My evaluation has shown:...
9
by: Gomaw Beoyr | last post by:
Two question about the "partial classes" (in the next wersion of ..NET). Question 1 ========== Will partial classes (in the next version of C#) have to be declared "partial" in ALL places. ...
12
by: dlf | last post by:
In this case, I am trying to perfom a math function on a byte value with another byte value returned by a function. There appears to be no way to convince the compiler to do this even with explicit...
0
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
As soon as an insert button clicked it should take it to the insert form there Docket no text box should be in the filled state and to be in the disabled state.using ASP and Access Now my exact...
1
by: imthiyas | last post by:
hai all, i would like to autogenerate serial number in datagrid... can anyone help me with this.. its too urgent .. plz with Regards, Imthiyas Ahamed.A
3
by: silpa | last post by:
Hi, i have a windows based aplication in that A field named EmployeeID (textbox) is there.Its value should be autogenerated from the sql server database. the condition is that 1) The...
5
by: varunapj | last post by:
HI , im using mysql express 2005 , Autogeneration of numbers is possible ?
1
by: =?Utf-8?B?U3VtaXQgUmF3YXQgSW5kaWE=?= | last post by:
What I have seen in Asp.net applications that if i put two Asp buttons on the web form(Aspx page) it generates multiple name attribute of input tag on the client side. for eg. <asp:Button...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.