Thursday 28 June 2018

How To display All Data from SQL server table in Visual C# Gridview







click here to download the source code

Unlink and Append in PHP





<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Write</title>

</head>



<body>



<form method="post">

<table>

<tr>  <td>Text </td> <td> <input type="text" name="txt"/> </td> </tr>

<tr> <td colspan="2"> <button name="btn">Post</button> </td> </tr>

<tr> <td colspan="2"> <button name="del">Delete</button> </td> </tr>



</table>

</form>



<?php

if(isset($_POST['btn']))

{



$filename="Resources/salman.txt";

$handle=fopen($filename,'a');

fwrite($handle," ".$_POST['txt']);

fclose($handle);

echo "Data successfully Inserted.....";





}



if(isset($_POST['del']))

{

$status=unlink("Resources/salman.txt");

if($status==true)

{

echo "Deleted.....";

}

else

{

echo "Not Deleted.....";



}

}

?>





</body>

</html>

File Write Operation in PHP





<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Write</title>

</head>



<body>



<form method="post">

<table>

<tr>  <td>Text </td> <td> <input type="text" name="txt"/> </td> </tr>

<tr> <td colspan="2"> <button name="btn">Post</button> </td> </tr>

</table>

</form>



<?php

if(isset($_POST['btn']))

{

$filename="Resources/salman.txt";

$handle=fopen($filename,'w');

fwrite($handle,$_POST['txt']);

fclose($handle);

echo "Data successfully Inserted.....";





}

?>





</body>

</html>

File Read Operation in PHP





<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Read Operation</title>

</head>



<body>



<?php

$fiepath="Resources/salman.txt";

$handle=fopen($fiepath,"r");

$content=fread($handle,filesize($fiepath));

echo "<h1>".$content." </h1>";

fclose($handle);

?>







</body>

</html>

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...