Tuesday, 30 September 2014

AngularJs is a Framework of the Jscrit to work in a better way .

A basic knowledge of HTML,cssand JScript is requiredbefore starting angular js.
ng-directives are uses to extentHTML content.
and we need to download the AngualrJs
After adding the AngularJs to your web page it will automatically gets loaded to your web page .
'ng-app' directive is added to div which tells the js that div is the owner of the AngularJs  applicaion

<div ng-app="">

"ng-model" it binds the inserted values with a variable name

<p>The name of the User is <input type="text" ng-model="first_name"/></p>

here the firstname is the variable is which the value is being entered
now we will bind this value to any other component . which is called as two way binding
this can be get by 'ng-bind'

<p>The name of the User is <input type="text" ng-model="first_name"/>>/p>
<p ng-bind='first_name'>

Links from making the animation in XAML.

Monday, 29 September 2014

How to post data in MVC using form collection for Beginners.

Here we can simply put the data into the form tag and give each component an name .We are creating a login form using the MVC Architecture.

<form method="post" action="Name_of_the_function>
<input type="text" name=username id=username>
<input type="password" name =pass id=pass>
<input id=submit type="submit">

on controller
public ActionResult Name_of_the_function(formcollection form)
string str=form["username"];
string str1= form["pass"];

How to post data using J-Query

Here we are making a post method using the J-Query.
Firstly we specify the component which is calling the function.
Here "btn" is the component Id which is calling the post method .
The post function is AssignVal().

$.(post)("AssignVal",{ARG1:$('#Component1_Id ').text(), empid:$('Component2_Id').text()});

Sunday, 28 September 2014

Delete a specific row using LINQ

Here we are having a table in the Database name DBentities .
The name of the table is Employee.
here we are deleting a row where emplyee_id is emp_id

var v = from row in dbentities.employee 
where employee_id==emp_id select row

if(v != null)

Saturday, 27 September 2014

Inserting Data using EF with MVC4.

I think you can add EF in your project.
Then open model1.edmx or what ever is the name of your file .noe go to it property and change  the property CODE GENERATION STRATEGY to default.
Now delete the 2 file from the model1.edmx.

Firstly add your model on the file like
using PROJECT_NAME.model

den u can add your model entity as

modelentities obj= new modelentities ();
then creating a function in the controller as .

public void addintotable()
table1s obj1= new table1s();
obj1.atribute1= value;// adding string value
obj1.attribute2=convert.toint32(value); // adding an int value 
// you can add as many as atttribute you ant to add .

Friday, 26 September 2014

For Beginers on Entity Framework (EF.)

Enitity Framework is another way to ad database to your  project.Here can add a model in the solution so that we can link the database. Here we don't need to write the SQL connection again and again. this also uses LINQ. that is the  another way to insert or fetch the data from the database..
firstly right click on the solution in the solution explorer window. then we can add ADO entity model from the "Data" section.then give the server name and select your database then select the table you want to add.
NOTE:  primary key is required in  every table for EF to work on that specific table .

Some more links for Angular js

How to fetch the image from database using linq , where image is stored in byte code in DataBase.

Here we are having a database model as dbtest, where pictures is the
Table name the Column name is img.
There is panel named ImgPanel where we are Getting the images

dbtestEntities db = new dbtestEntities();
var images = from p in db.Pictures
     select Image.FromStream(new MemoryStream(p.img.ToArray());

foreach (Image image in images)

Thursday, 25 September 2014

Refrences regarding the AngularJS some of the best links..

Using AJAX for getting data on web pages without reloading them ?

We have to be a bit familiar with the Java script for the use of ajax.
In this example ,a java script function which is calling the post function using ajax.
<script type="type/javascript" >
function ajaxunload()
//here we created the obj of the xmlhttprequest , which is a mile stone to ajax .
//all latest browser like internet explorer 5 or abve uses activeXobject
//this object exchanges the data with the server ..
obj  = new XMLHttpRequest();
//It stores the function or the name of the function to be called automatically when the readystate //property changes 
 obj.onreadystatechange = function ()

   if (obj.readyState == 4 && obj.status == 200)
// here we are storing the data which is returend from the ajax function.
  var s = obj.responseText
 }"POST", "postfunction", true);

using session for login and logout in

firstly open the "Global.aspx".

then create a function there
 protected void Application_Start()
//we give the name of the session  here and declare it null ..username is the name of the session
//we can change it according to our needs

now we can create the function where we are login as
function boolean login( string username, string password)
  // firstly we match the login details from the database.

if(username == logincredintialfromdb && password ==logincredintialfromdb )
// the values are matched here so are assiging the value to the session variable
Session["username"]= username ;
return true;
return false;


How to use lamda expression for updating using LINQ

This is small example showing how we use lamda expression in the programming section , Generally we use lamda expression when working wiht LINQ , or the classs of list type where need to get the data based on any where clause.

public Boolean Update(string id)
int flag = 0;
string str = DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year;
foreach (var c in obj.Task_Details.Where(x => x.task_no == id))
c.task_date = str;
flag = 1;
c.status = "Complete";
if (flag == 1)
return true;
return false;