|
that is ok with me........But may i know what is difference between state server and SQL server.........In wat cases they use......I mean the need?
pavan...
|
|
|
|
|
Please go through the link I have given. It explains that in last section
|
|
|
|
|
sorry.....I dont find any link in ur reply...........
pavan...
|
|
|
|
|
|
Hi,
I am Using a List<city> to store the data retrived from database...
My code goes as this
Service Layer Method:
public List<city> GetCities()
{
DataSet ds= cdb.GetCities();
List<city> city = new List<city>();
foreach (DataRow row in ds.Tables[0].Rows)
{
city.Add(new City(row["city_id"].ToString(), row["city_name"].ToString(), row["state_id"].ToString(), row["city_classification_id"].ToString()));
}
return city;
}
In Application Layer: I am Caliing the method as below
GridView1.DataSource = cs.GetCities();
GridView1.DataBind();
It works fine but ....
The Columns are not coming in the same order as in Database i.e... CityID, CityName, StateID, cityClassificationID.
The column order comes in as cityClassificationID,CityId, CityName, StateID.
But I want them in the same Order i.e CityID, CityName, StateID, CityClassificationID...
How to accomplish this....
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
Turn off auto columns and define them yourself in the order you want.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Strange, Why don't you return the DataTable object from dataset ? Any way you are iterating through all rows, or is there any other reason that you are specific with List ?
|
|
|
|
|
There is a school of thought that suggests the data layer should return collections of objects instead of database related classes.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: There is a school of thought that suggests the data layer should return collections of objects instead of database related classes.
Great information. I was not knowing.
What will be the impact when it returns Database classes ? upto my knowledge, DataTable is also a collection class which contain a collection of DataRows. So what is making difference ?
|
|
|
|
|
He's returning a collection of entity objects. It's at least partially a religious discussion. I've seen all sorts of other OO principles thrown out in order to pursue this one goal. It's not clear cut, and you need to make a call based on the needs of your project.
It is very sexy to call the data layer and get back a list of custom business objects, tho.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi friends
In my asp.net form, I want receive an image from network and show it. The image has jpeg format and is sent in Byte[] format. When I receive it, how can I display the image? pleas write the code.
thanks
|
|
|
|
|
your server needs to recieve the image, and either save it to the hard drive, or your page will need to show the image and nothing else, then you can do a binary write
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks so much , but can you tell me how binary write works for display image?
|
|
|
|
|
82130012 wrote: but can you tell me how binary write works for display image?
Binary write to the Response. Set the Response content type to image.
|
|
|
|
|
Hai all,
I have a problem that in my application i have two forms which are related each other.
When i save the first form and move to the next form,my problem is if i want to see the values in the first form,if click on back button all the textbox values become blank.Which prperty i need to set for saving the value.
Bcz i just want refer before saving the second form.plz tel lme the solution.
Plz give me a solution
Regards
kissy
|
|
|
|
|
You can pass the values from the first form to the second with cross page postback or on the URL, then have a button within the page which goes back and repopulates the old page.
The other way to do it, is to make both form controls that appear on the one form, then you will have viewstate between what appear to be pages.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: The other way to do it, is to make both form controls that appear on the one form, then you will have viewstate between what appear to be pages.
You mean in single page and changing the visibility ? But browser will keep the posted data on cache and repost on hitting refresh. Are you familiar with Java beans ? I think that is something related to passing values between pages, but not sure
|
|
|
|
|
Well, I have a vague idea about beans, what I can say for sure, is they are not going to help the OP, who is using ASP.NET.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
if u want to see the information u must session,viewstate to store the information......
i think it is not possible by setting a property .........
Have great programming....
|
|
|
|
|
But if the form has many controls and if i set autopostback is true,it doesnt look good for each control page will be postback.
But by using viewstate or session variables ,it is not good.
i dont have any idea of javabeans.
How to solve this problem.
Bcz forms are big in size(so many controls).
give me some other idea.
kissy
|
|
|
|
|
You only need to do a postback when you navigate to the next page. You can do a postback, store your values, and then move on, and then you can expect to be able to write code so when the page reloads, the values are restored.
Kissy16 wrote: i dont have any idea of javabeans.
That was a dumb idea, you're not using J2EE.
Kissy16 wrote: But by using viewstate or session variables ,it is not good.
Those are your only options, unless you do some of the other things I suggested. At the end of the day, many web apps fail if uses click the back button instead of navigating within the site. If you offer a back button, you can control the behaviour, and then the two controls on one page idea is best, viewstate will do what you want, automatically.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You can use static property in the class.
bEst regaRd
pAthAn
please don't forget to vote on the post that helped you.
|
|
|
|
|
hi all,
Can you please help me out, how to implement browse button. i want path of the selected file.
Thanks in advance!
|
|
|
|
|
There is an ASP.NET file selection control, that's what you need.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Imran. Mohammed wrote: how to implement browse button. i want path of the selected file.
Use FileUpload Control. To get the file name use
if (FileUpload1.HasFile)
FileUpload1.PostedFile.FileName
|
|
|
|