Sourav Kumar Das

Sourav Kumar Das

  • 524
  • 2.5k
  • 172.1k

Get maxid for different sub models in Asp.Net

Jan 24 2019 3:31 AM
Hi All,
 
I have a doubt on Asp.Net
 
How to get MaxId for different sub-models in Asp.Net.
 
Eg.
 
Models            Id               SubModels
---------------------------------------------------
 
Model-1          1                Model-1.1
Model-1          2                Model-1.2
Model-1          3                Model-1.3
 
Model-2          1                Model-2.1
Model-2          2                Model-2.2
Model-2          3                Model-2.3
 
Model-3          1                Model-3.1
Model-3          2                Model-3.2
Model-3          3                Model-3.3
 
At here id is maxid it should increment based on models. 
 
At here I have models in dropdownlist while selecting the "model-1" it should check in database whether that model is there or not. 
 
---If it's not there the particular model-1 id should be incremented as +1
---If it's there then the particular model-1 last id it should get and increment with +1
 
it's same for Model-2, Model-3..
 
If there's any solution please let me know it..

Answers (4)