Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Download ASP.NET MVC 4: insert, edit, update, delete with sql server using csharp (c#)

Monday

Select, Insert, Update And Delete With ASP.NET MVC 4 and SQL server database using C#:
                                         In one of my previous article I'm explained how to create a sample project with asp.net mvc 4?. In this article we look at how to do insert, edit, update, delete with  sql server database using csharp.

Getting Started with MVC4 wep application with sql server databas:
                           Here you can only download a sample asp.net mvc 4 project with sql server. And all the other steps like create models, controllers, views, insert, update, delete etc.. you can find Rick Anderson's article from http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-controller .
I think this is a best tutorial for your first mvc 4 project.


 I'm created the above project just followed by Rick Anderson' articles.

Issue with Connection string in asp.net mvc 4:
  If you face any problem with your default connection string (when change the data storage from .mdf to sql server). You just change your connection string with the following format.

code to resolve database connection string problems in asp.net mvc 4:

 <add name="MovieDBContext" connectionString="data source=localhost;uid=sa;pwd=sa;Initial Catalog=MyFirstMVC" providerName="System.Data.SqlClient" />


 And you can download the  asp.net mvc 4 web application with insert, edit, update, delete in sql server data base  source code from here.

                                                |
                                               \|/                                                
Don't forgot to share this knowledge to your friends. Cheers!

iphone sdk: get / retrieve/ display all first name and last names from the address book

iPhone-  Retrive contact list name from default Address Book:
                      This tips demonstrates how to print the first and last names for all entries in the iPhone Address Book to the console. Start by including the following import statement:

#import <AddressBook/AddressBook.h>

Also, add the AddressBook.framework to your project.
To display all the address book names, create an address book reference, copy all entries into an array and for each entry, access the first and last name properties.

           

ABAddressBookRef addressBook = ABAddressBookCreate();
 
// Can we find the address book...
if (addressBook != nil)
{
  // Get an array address book entries
  CFArrayRef arrayOfEntries = ABAddressBookCopyArrayOfAllPeople(addressBook);
 
  // Are there entries in the array?
  if (CFArrayGetCount(arrayOfEntries) > 0)
  {
    CFIndex countOfEntries = CFArrayGetCount(arrayOfEntries);
    NSLog(@"Address book entries: %ld", countOfEntries);
 
    for (int x = 0; x < countOfEntries ; x++)
    {        
      // Get the current entry
      ABRecordRef activeRecord = CFArrayGetValueAtIndex(arrayOfEntries, x);
 
      // Print first name
      NSString *firstname = (NSString *) ABRecordCopyValue(activeRecord, kABPersonFirstNameProperty);
      NSLog(@"First name: %@", firstname);
      [firstname release];
 
      // Print last name        
      NSString *lastname = (NSString *) ABRecordCopyValue(activeRecord, kABPersonLastNameProperty);
      NSLog(@"Last name: %@", lastname);
      [lastname release];
    }
  }
 
  CFRelease(arrayOfEntries);
  CFRelease(addressBook)
} 

iPhone tricks:Insert string value with single quotes ( Replace single quote in sqlite3 insert query - objective c ) in iphone sdk

Friday

                                             I am working in SQLite3 database for Iphone App.In Objecitve-c one of my query is getting failed because of the value "This is user's profile" as it contains single quote. So I'm using the following solution to resolve my problem. By using the string replacement we can save the apostrophe into the database. Look at the following sample

strAddress =  [strAddress stringByReplacingOccurrencesOfString:@"'" withString:@"\''"];


How to programmatically prevent iphone auto-lock?
                            Simply disabled the idle timer to prevent outo-lock the iphone while your app is open. Just add the following line into your apps delegate.m file.

- (void)applicationDidFinishLaunching:(UIApplication *)application {   application.idleTimerDisabled = YES;  }


How to hide keyboard when you press the button - iphone sdk?
           In button action you just write

 [yourTextField resignFirstResponder].

It will hide your keyboard.

How to take a screenshot with the iPhone?
                 To take a screenshot, hold the home button and click the sleep button. The screen will flash white and the screenshot will be stored in your camera roll.
 
                                         

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets