Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I want make one application in mvc 4 asp.net but some issue occurred like connect raven db create document , update ,edit ,delete





contact is class
C#
public class Contact
    {
        public string Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime DateOfBirth { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
 }

for create and connect database
C#
documentStore = new DocumentStore { Url = "http://localhost:8085/" };
                documentStore.Initialize();


                using (var session = documentStore.OpenSession())
                {
                    session.Store(contact);
                    session.SaveChanges();
                }


But does entry in database in raven db
Posted
Updated 16-Jan-14 23:06pm
v2

RavenDB is .NET based, so you should be able to interact with it in .NET. If it's SQL based, you should be able to create a connection string and use the ODBC classes. If it's not, you'll need to use the methods they provide to access it.

http://ravendb.net/learn[^] is the link to learn how to use it.
 
Share this answer
 
For initialize ravendb server

var documentStore = new DocumentStore { ConnectionStringName = "RavenDB" };
documentStore.Initialize();

using (var session = documentStore.OpenSession("TEST"))
{
session.Store(ravendata, templateName);
session.Advanced.GetMetadataFor(ravendata)[Constants.RavenEntityName] = "Template";
session.SaveChanges();
}

For save in database
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900