Autogeneration is set to particular field.example group code.
after i delete or update that rows. the group code is not updated.
4 1485
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
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
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: -
//Global Variable
-
private static DataTable CountryStateCityTable=new DataTable();
-
-
-
page_load(...)
-
{
-
-
//Setting autopostback property to true so page is posted back to the server whenever an event is being fired.
-
this.CountryListBox.AutoPostBack=true;
-
this.StateListBox.AutoPostBack=true;
-
this.CityListBox.AutoPostBack=true;
-
-
//City,State,Country
-
-
CountryStateCityTable.Columns.Add("Country");
-
CountryStateCityTable.Columns.Add("State");
-
CountryStateCityTable.Columns.Add("City");
-
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Chennai"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Vellore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Koimbotore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Madurai"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Thiruchy"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Cochin"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Ernakulam"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Kolikode"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Bangalore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mysore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mangalore"});
-
-
CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","New York"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","North Carolina"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","Colambia","Colambia City"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","Washington","Washington"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Sindhu","Islamabad"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Peshavur"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Hyderabad"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Punjab","Karachi"});
-
-
-
this.CountryListBox.DataSource=new DataView(this.CountryStateCityTable).ToTable(true,"Country").DefaultView;
-
this.CountryListBox.ValueMember="Country";
-
this.CountryListBox.DisplayMember="Country";
-
-
}
-
-
-
-
-
private void StateListBox_SelectedValueChanged(...)
-
{
-
try
-
{
-
DataView view=new DataView(this.CountryStateCityTable);
-
view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"' AND State='"+this.StateListBox.SelectedItem.Text+"'";
-
this.CityListBox.DataSource=viewToTable(true,"City").DefaultView;;
-
this.CityListBox.DisplayMember="City";
-
this.CityListBox.ValueMember="City";
-
}
-
catch(Exception exc)
-
{
-
Responce.Write(exc.Message);
-
}
-
}
-
-
private void CountryListBox_SelectedValueChanged(...)
-
{
-
try
-
{
-
DataView view=new DataView(this.CountryStateCityTable);
-
view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"'";
-
this.StateListBox.DataSource=view.ToTable(true,"State").DefaultView;
-
this.StateListBox.DisplayMember="State";
-
this.StateListBox.ValueMember="State";
-
}
-
catch(Exception exc)
-
{
-
Responce.Write(exc.Message);
-
}
-
}
-
-
- Balaji U
I have added IsPostBack condition here. -
//Global Variable
-
private static DataTable CountryStateCityTable=new DataTable();
-
-
-
page_load(...)
-
{
-
-
if(!IsPostBack)
-
{
-
//Setting autopostback property to true so page is posted back to the server whenever an event is being fired.
-
this.CountryListBox.AutoPostBack=true;
-
this.StateListBox.AutoPostBack=true;
-
this.CityListBox.AutoPostBack=true;
-
-
//City,State,Country
-
-
CountryStateCityTable.Columns.Add("Country");
-
CountryStateCityTable.Columns.Add("State");
-
CountryStateCityTable.Columns.Add("City");
-
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Chennai"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Vellore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Koimbotore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Madurai"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Tamilnadu","Thiruchy"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Cochin"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Ernakulam"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Kerala","Kolikode"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Bangalore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mysore"});
-
CountryStateCityTable.Rows.Add(new string[]{"India","Karnataka","Mangalore"});
-
-
CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","New York"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","New Jercy","North Carolina"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","Colambia","Colambia City"});
-
CountryStateCityTable.Rows.Add(new string[]{"United States","Washington","Washington"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Sindhu","Islamabad"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Peshavur"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Balusistan","Hyderabad"});
-
CountryStateCityTable.Rows.Add(new string[]{"Pakistan","Punjab","Karachi"});
-
-
-
this.CountryListBox.DataSource=new DataView(this.CountryStateCityTable).ToTable(true,"Country").DefaultView;
-
this.CountryListBox.ValueMember="Country";
-
this.CountryListBox.DisplayMember="Country";
-
}
-
}
-
-
-
-
-
private void StateListBox_SelectedValueChanged(...)
-
{
-
try
-
{
-
DataView view=new DataView(this.CountryStateCityTable);
-
view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"' AND State='"+this.StateListBox.SelectedItem.Text+"'";
-
this.CityListBox.DataSource=viewToTable(true,"City").DefaultView;;
-
this.CityListBox.DisplayMember="City";
-
this.CityListBox.ValueMember="City";
-
}
-
catch(Exception exc)
-
{
-
Responce.Write(exc.Message);
-
}
-
}
-
-
private void CountryListBox_SelectedValueChanged(...)
-
{
-
try
-
{
-
DataView view=new DataView(this.CountryStateCityTable);
-
view.RowFilter="Country='"+this.CountryListBox.SelectedItem.Text+"'";
-
this.StateListBox.DataSource=view.ToTable(true,"State").DefaultView;
-
this.StateListBox.DisplayMember="State";
-
this.StateListBox.ValueMember="State";
-
}
-
catch(Exception exc)
-
{
-
Responce.Write(exc.Message);
-
}
-
}
-
-
- Balaji U
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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:...
|
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.
...
|
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...
|
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...
|
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
|
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...
|
by: varunapj |
last post by:
HI ,
im using mysql express 2005 , Autogeneration of numbers is possible ?
|
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...
|
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: 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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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:
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: 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...
|
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...
|
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...
|
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,...
| |