|
Serialization is the process of converting an object into a stream.
Serialization[^]
Persistence is something that is performed on a stream (something that was serialized) such as storing in a DataBase of File.
Introduction to Persistence[^]
Updated with link for MSDN Introduction to Persistence.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Serialization is a way to persist data from none persistent medium to persistent medium.
ANAND KUMAR
Owner www.csharpmagic.com
www.asbrainz.com
|
|
|
|
|
Hello,
I have developed one web application in asp.net(in VSTS 2008) and moved to production server by taking backup of database and files, Later i have included lot of new modules and functionality in developement server.
My question is how to move updated files (Modules with database) to production server, with out losing of existing data in production server.
do we have any tools to update whenever we build in visual sutdio, or any specail process is there?
Please help me, and let me know any vedios or articles available on this topic.
Pinna
|
|
|
|
|
Well as far as your Modules go, if you are just talking libraries (dlls), you should just be able to overwrite the existing Modules.
For the DB, this is a little trickier if you know exactly what fields changed you should be able to just write an update statement for the tables that have changed. If you don't know what tables changed you can use a third party tool, something like APEX SqlDiff[^] to run the comparison and generated the scripts for you. It's a little pricey but I’m not sure what your budget is. If it's just a onetime thing, I think the trial might do.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
For MSSQL server there is a free toolSqlDbDiff[^] which does a decent job of comparing databases.
|
|
|
|
|
Never heard of this one before, looks nice and you can't beat that price.
Thanks for the info
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hi,
Thanks for your reply.
I am not talking about libraries(dlls), i am just saying about aspx files, and came to known we can move updated files from production server to development server using Team foundation server, but i dont know the process am looking for tutorials.
Pinna
|
|
|
|
|
Copy & Paste replacing the old ones with new ones, if you have customizations to the web.config don't overwrite that or you will have to make the changes again, by changes I mean values. obviously overwriting the web.config will remove all changes to the previous version
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hi,
I am getting error as 'Sys' is undefined.
The above error occures in production server only not in development server. I checked every setting and web.config. I am not getting any solution for this. I am using Ajax in this page.
Please help.
Thanks in advance
|
|
|
|
|
A very common error: a quick search on Google would have helped you:
Sys is undefined[^]
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Hi guys, I'm new to MVC and ASP probably like a few days experience.
I've googled, looked through examples but not finding what I need.
I have a service which returns a
IEnumerable<ViewModel>
I consequently pass this Model into the View using
Inherits="System.Web.Mvc.ViewPage<IEnumerable<ViewModel>>"
I have an asp:GridView setup with no datasource.
How would I bind the model that is passed into the View to the GridView?
I'm currently doing it like this but I would really like to have it in a gridview whereby i can sort the information and apply filters since I don't want to access the SQL DB directly from the ASP page and use the service to access it then return the Model like I am.
<ul>
<% foreach (var vm in ViewModel) { %>
<li>
<%= Html.ActionLink("Edit", "Edit", new { id = vm.ClientCode })%>
<%= Html.Encode(vm.ClientCode)%>
is the code for
<%= Html.Encode(vm.ClientName)%>
<%= Html.Encode(vm.ClientSurname)%>
</li>
<% } %>
</ul>
|
|
|
|
|
I have a problem of integration of the city code in the table of the employer database, it always inserts the last record in the table and here is the city code used:
protected void Page_Load(object sender, EventArgs e)
{
foreach (short vKey in city.Keys)
{
dropdownlist1.Items.Add(city[vKey].cityName);
dropdownlist1.DataTextField = city[vKey].cityName;
dropdownlist1.DataValueField = (city[vKey].id_city).ToString();
}
}
and the code in the button is:
employer.cityName= short.Parse(dropdownliste1.DataValueField);
employer.insert();
|
|
|
|
|
if(!IsPostBack)
{
foreach (short vKey in city.Keys)
{
dropdownlist1.Items.Add(city[vKey].cityName);
dropdownlist1.DataTextField = city[vKey].cityName;
dropdownlist1.DataValueField = (city[vKey].id_city).ToString();
}
}
|
|
|
|
|
Wrap in IsPostback .
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
foreach (short vKey in city.Keys)
{
dropdownlist1.Items.Add(city[vKey].cityName);
dropdownlist1.DataTextField = city[vKey].cityName;
dropdownlist1.DataValueField = (city[vKey].id_city).ToString();
}
}
}
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Ignoring the number of seconds, we both replied exactly on the same time
|
|
|
|
|
Great minds think alike!
I've noticed this before though it doesn't mean anything. I think. Or maybe...
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
ok , thank you very much for both of you, but it does not work with IsPostBack, it always inserts the last record in the table table in town employer, as in adding the new num employer must record the index of the choice of city and not the name of the city
|
|
|
|
|
Try:
employer.cityName = dropdownliste1.SelectedItem.Value;
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Unfortunately, it doesn't work
|
|
|
|
|
Hmm: well, I was intrigued so I knocked up a wee app to simulate what you are doing and, for me, it works. That is, wrapping with both bits of code.
Have you checked to see what it is you're actually outputting to the list; is each id unique or are they all the same?
Can't really see a reason why this should not work as advertised. (Course I can't actually see what you are doing!)
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
A lot of people have given you the IsPostBack answer, but no one has commented on your loop. What is in your collection and what are you using for your keys? If you had a List<T> you wouldn't have to generate the list of keys and you wouldn't need to loop at all. You could just set the DataSource for the dropdown. If you set a datasource instead of doing Items.Add every time that would also eliminate your duplicates and it would be more efficient the one time it does run (once you had the IsPostBack check).
|
|
|
|
|
must use the loop to fill the dropdownlist, and since I work in n-tier gift is not easy to call the database in the datasource in this layer, so you should always call the dictionary but the problem I can not solve is that how to save the id of the city selction instead of city name chosen in the dropdownlist ??????
|
|
|
|
|
I have no idea what that means. I use n-tier architectures all the time and looping is not necessary and neither are dictionaries. A good n-tier architecture has a business layer that contains objects that represent business entities. Using dictionaries is not good practice because you lose some of the benefits from strong typing in C#.
|
|
|
|
|
Okay: think this will do it:
dropdownlist1.Items.Add(new ListItem(city[vKey].cityName, (city[vKey].id_city).ToString()));
I guess we missed that one - you were setting both the text and value to the same thing. If you had stepped through the code or viewed the source on the page you would have probably picked this up - but don't feel bad - several of us missed it as well!
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|