Monday, 27 August 2012
c# for dummies: c# tutorial
c# for dummies: c# tutorial: A delegate is a variable that holds a function. namespace delegateexample1 { delegate string[] mydelegate(string str); class Program...
c# for dummies: c# tutorial
c# for dummies: c# tutorial: A delegate is a variable that holds a function. namespace delegateexample1 { delegate string[] mydelegate(string str); class Program...
c# tutorial
A delegate is a variable that holds a function.
namespace delegateexample1
{
delegate string[] mydelegate(string str);
class Program
{
static void Main(string[] args)
{
mydelegate mymy = new mydelegate(testdeligate.replacestring);
mydelegate mimi = new mydelegate(testdeligate.splitstringup);
string[] str= mymy("Ade is a good boy");
string[] str1 = mimi("Ayo is a nice boy");
foreach (string x in str)
{
Console.WriteLine("\t\n{0}", x);
}
Console.WriteLine("\t ");
foreach (string x in str1)
{
Console.WriteLine("\t\n{0}", x);
}
Console.ReadLine();
}
class testdeligate
{
public static string[] replacestring(string s)
{
string[] marray = s.Split(' ');
//StringSplitOptions option=new StringSplitOptions();
//Console.WriteLine("Replace Space with Hyphen...");
//return s.Split(marray, option);
//return s.Replace(' ','-');
return marray;
}
public static string[] splitstringup(string s)
{
string[] hiarray = s.Split(' ');
return hiarray;
}
}
namespace delegateexample1
{
delegate string[] mydelegate(string str);
class Program
{
static void Main(string[] args)
{
mydelegate mymy = new mydelegate(testdeligate.replacestring);
mydelegate mimi = new mydelegate(testdeligate.splitstringup);
string[] str= mymy("Ade is a good boy");
string[] str1 = mimi("Ayo is a nice boy");
foreach (string x in str)
{
Console.WriteLine("\t\n{0}", x);
}
Console.WriteLine("\t ");
foreach (string x in str1)
{
Console.WriteLine("\t\n{0}", x);
}
Console.ReadLine();
}
class testdeligate
{
public static string[] replacestring(string s)
{
string[] marray = s.Split(' ');
//StringSplitOptions option=new StringSplitOptions();
//Console.WriteLine("Replace Space with Hyphen...");
//return s.Split(marray, option);
//return s.Replace(' ','-');
return marray;
}
public static string[] splitstringup(string s)
{
string[] hiarray = s.Split(' ');
return hiarray;
}
}
Saturday, 25 August 2012
Friday, 24 August 2012
C# tutorial
silverlight1: it does not support .net languages so u may have to use java script
silverlight2: this has the CLR and .net framework classes and works base on WPF.
silverlight2: this has the CLR and .net framework classes and works base on WPF.
c# for dummies: c# tutorial
c# for dummies: c# tutorial: Silverlight: silverlight allows deffernt browsers thru .net code on variety of operating system. silverlight works thru a browser plug-in an...
c# tutorial
Silverlight:
silverlight allows deffernt browsers thru .net code on variety of operating system.
silverlight works thru a browser plug-in and provides a subset of the .net framework class library..
silverlight is for client, allows to create richer pages than you could with HTML,DHTML, and JavaScript alone.
silvertlight duplicates the features of adobeflash and echoes the goals of Adobe flash.
BY using silverlight you can draw sophisticated 2D graphics, animate scence and play video and other media files.
Silverlight is perfect for creating a mini-applet, like a browser-hosted game.
It’s also a good choice for adding interactive media and animation to a website
but you can freely mix ASP.NET pages and Silverlight pages on a website—or place Silverlight content in an ASP.NET page.
For example,
although you can use Silverlight to create an animated button, this is a risky strategy. Users without the
Silverlight plug-in won’t be able to see your button or interact with it. (Of course, you could create more
than one front end for your web application, using Silverlight if it’s available or falling back on regular
ASP.NET controls if it’s not. However, this approach requires a significant amount of work.)
silverlight allows deffernt browsers thru .net code on variety of operating system.
silverlight works thru a browser plug-in and provides a subset of the .net framework class library..
silverlight is for client, allows to create richer pages than you could with HTML,DHTML, and JavaScript alone.
silvertlight duplicates the features of adobeflash and echoes the goals of Adobe flash.
BY using silverlight you can draw sophisticated 2D graphics, animate scence and play video and other media files.
Silverlight is perfect for creating a mini-applet, like a browser-hosted game.
It’s also a good choice for adding interactive media and animation to a website
but you can freely mix ASP.NET pages and Silverlight pages on a website—or place Silverlight content in an ASP.NET page.
For example,
although you can use Silverlight to create an animated button, this is a risky strategy. Users without the
Silverlight plug-in won’t be able to see your button or interact with it. (Of course, you could create more
than one front end for your web application, using Silverlight if it’s available or falling back on regular
ASP.NET controls if it’s not. However, this approach requires a significant amount of work.)
Thursday, 23 August 2012
c# for dummies: c# tutorial
c# for dummies: c# tutorial: Coding4Fun book, Coding4Fun 10 .NET Programming Projects for Wiimote, World of Warcraft, YouTube, and More officially released to the world ...
c# tutorial
Coding4Fun book, Coding4Fun 10 .NET Programming Projects for Wiimote, World of Warcraft, YouTube, and More officially released to the world last week. Unlike your typical .NET development book, Coding4Fun is about learning how to use your developer skills to do fun, cool projects (see below for the full list). All of the .NET projects are in VB and C#, with the exception of the XNA chapter as XNA only supports C# at this time.
Wednesday, 22 August 2012
c# for dummies: c# tutorial
c# for dummies: c# tutorial: LINQ TO XML FORMAT lautech=new XDocument( new XDeclaration("LADOKE","AKINTOLA","UNIVERSITY"), ...
c# for dummies: c# tutorial
c# for dummies: c# tutorial: LINQ TO XML FORMAT lautech=new XDocument( new XDeclaration("LADOKE","AKINTOLA","UNIVERSITY"), ...
c# tutorial
LINQ TO XML FORMAT
lautech=new XDocument(
new XDeclaration("LADOKE","AKINTOLA","UNIVERSITY"),
new XComment("LADOKE AKINTOLA UNIVERSITY OF TECHNOLOGY OGBOMOSO"),
new XElement("LAUTECH",
new XElement("Student",new XAttribute("MATRICNO",textBoxmatricno.Text),
new XElement("FirstName",textBoxfirstname.Text),
new XElement("LastName",textBoxlastname.Text),
new XElement("Phone",textBoxphone.Text),
new XElement("Address",textBoxaddress.Text),
new XElement("Gender",comboBoxgender.SelectedItem.ToString()),
new XElement("Birthday",dateTimePickerDOB.Text.ToString())
)
)
);
lautech.Save("Lautech.edu.ng.xml");
lautech=new XDocument(
new XDeclaration("LADOKE","AKINTOLA","UNIVERSITY"),
new XComment("LADOKE AKINTOLA UNIVERSITY OF TECHNOLOGY OGBOMOSO"),
new XElement("LAUTECH",
new XElement("Student",new XAttribute("MATRICNO",textBoxmatricno.Text),
new XElement("FirstName",textBoxfirstname.Text),
new XElement("LastName",textBoxlastname.Text),
new XElement("Phone",textBoxphone.Text),
new XElement("Address",textBoxaddress.Text),
new XElement("Gender",comboBoxgender.SelectedItem.ToString()),
new XElement("Birthday",dateTimePickerDOB.Text.ToString())
)
)
);
lautech.Save("Lautech.edu.ng.xml");
c# for dummies: c# for dummies: c# tutorial
c# for dummies: c# for dummies: c# tutorial: c# for dummies: c# tutorial : USING LINQ TO SQL INSERT INTO DATABASE Saving to the database using LINQToSQL Step1: Creat...
c# for dummies: c# tutorial
c# for dummies: c# tutorial: USING LINQ TO SQL INSERT INTO DATABASE Saving to the database using LINQToSQL Step1: Create the database in MSSQL Manage...
c# tutorial
USING LINQ TO SQL INSERT INTO DATABASE
Saving to the database using LINQToSQL
Step1:
Create the database in MSSQL Management studio
Step2:
Connect to the MSSQL Database from Visual Studio
Step3:
Design the interface to take name,Mat no and picture
Step4:
Add LINQ to Sql classes from Visual Studio
Step5:
Write The codes like this
CODES TO INSERT INTO THE DATABASE:
customerDataContext db;
CustomerTB cust;
private void btnsubmit_Click(object sender, EventArgs e)
{
db = new customerDataContext();
cust = new CustomerTB()
{
ID = txtboxmatno.Text,
name = txtboxname.Text,
photo=pix
};
db.CustomerTBs.InsertOnSubmit(cust);
db.SubmitChanges();
txtboxmatno.Clear();
txtboxname.Clear();
}
CODES TO BROWSE FOR THE PICTURE:
OpenFileDialog openfile;
string path;
byte[] pix;
FileStream fs;
private void btnbrowse_Click(object sender, EventArgs e)
{
openfile = new OpenFileDialog();
openfile.ShowDialog();
path = openfile.FileName;
pictureBoxsubmit.Image = Image.FromFile(path);
pictureBoxsubmit.SizeMode = PictureBoxSizeMode.StretchImage;
fs = new FileStream(path, FileMode.Open, FileAccess.Read);
pix=new byte[fs.Length];
fs.Read(pix, 0, Convert.ToInt32(fs.Length));
}
CODES TO RETRIVE NAME AND PICTURE:
ImageConverter imageconvert;
private void btnretrieve_Click(object sender, EventArgs e)
{
byte[] retrevedPix = null;
imageconvert = new ImageConverter();
db = new customerDataContext();
cust = new CustomerTB();
cust = (from c in db.CustomerTBs where c.ID == txtboxretrivematno.Text select c).Single<CustomerTB>();
txtboxretrievename.Text = cust.name;
retrevedPix = cust.photo.ToArray();
pictureBoxretrive.Image=(Image)imageconvert.ConvertFrom(retrevedPix);
pictureBoxretrive.SizeMode=PictureBoxSizeMode.StretchImage;
}
Saving to the database using LINQToSQL
Step1:
Create the database in MSSQL Management studio
Step2:
Connect to the MSSQL Database from Visual Studio
Step3:
Design the interface to take name,Mat no and picture
Step4:
Add LINQ to Sql classes from Visual Studio
Step5:
Write The codes like this
CODES TO INSERT INTO THE DATABASE:
customerDataContext db;
CustomerTB cust;
private void btnsubmit_Click(object sender, EventArgs e)
{
db = new customerDataContext();
cust = new CustomerTB()
{
ID = txtboxmatno.Text,
name = txtboxname.Text,
photo=pix
};
db.CustomerTBs.InsertOnSubmit(cust);
db.SubmitChanges();
txtboxmatno.Clear();
txtboxname.Clear();
}
CODES TO BROWSE FOR THE PICTURE:
OpenFileDialog openfile;
string path;
byte[] pix;
FileStream fs;
private void btnbrowse_Click(object sender, EventArgs e)
{
openfile = new OpenFileDialog();
openfile.ShowDialog();
path = openfile.FileName;
pictureBoxsubmit.Image = Image.FromFile(path);
pictureBoxsubmit.SizeMode = PictureBoxSizeMode.StretchImage;
fs = new FileStream(path, FileMode.Open, FileAccess.Read);
pix=new byte[fs.Length];
fs.Read(pix, 0, Convert.ToInt32(fs.Length));
}
CODES TO RETRIVE NAME AND PICTURE:
ImageConverter imageconvert;
private void btnretrieve_Click(object sender, EventArgs e)
{
byte[] retrevedPix = null;
imageconvert = new ImageConverter();
db = new customerDataContext();
cust = new CustomerTB();
cust = (from c in db.CustomerTBs where c.ID == txtboxretrivematno.Text select c).Single<CustomerTB>();
txtboxretrievename.Text = cust.name;
retrevedPix = cust.photo.ToArray();
pictureBoxretrive.Image=(Image)imageconvert.ConvertFrom(retrevedPix);
pictureBoxretrive.SizeMode=PictureBoxSizeMode.StretchImage;
}
Tuesday, 21 August 2012
c# for dummies: c# tutorial
c# for dummies: c# tutorial: CODE TO RETRIEVE PICTURES FROM DATABASE USING LINQ TO SQL using System; using System.Collections.Generic; using System.ComponentModel; usi...
c# tutorial
CODE TO RETRIEVE PICTURES FROM DATABASE USING LINQ TO SQL
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace pictureProjectIlinqToSql
{
public partial class Retrive_Picture : Form
{
public Retrive_Picture()
{
InitializeComponent();
}
private void btnretrive_Click(object sender, EventArgs e)
{
retrivePicture();
}
public void retrivePicture()
{
StudeterDataContext stud = new StudeterDataContext();
StudentTB stutb = new StudentTB();
byte[]pix =null;
stutb = (from s in stud.StudentTBs where s.Matricno == txtboxmatricno.Text select s).Single<StudentTB>();
pix = stutb.photo.ToArray();
ImageConverter imageconv = new ImageConverter();
pictureBoxretrivepicture.Image=(Image)imageconv.ConvertFrom(pix);
pictureBoxretrivepicture.SizeMode = PictureBoxSizeMode.StretchImage;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace pictureProjectIlinqToSql
{
public partial class Retrive_Picture : Form
{
public Retrive_Picture()
{
InitializeComponent();
}
private void btnretrive_Click(object sender, EventArgs e)
{
retrivePicture();
}
public void retrivePicture()
{
StudeterDataContext stud = new StudeterDataContext();
StudentTB stutb = new StudentTB();
byte[]pix =null;
stutb = (from s in stud.StudentTBs where s.Matricno == txtboxmatricno.Text select s).Single<StudentTB>();
pix = stutb.photo.ToArray();
ImageConverter imageconv = new ImageConverter();
pictureBoxretrivepicture.Image=(Image)imageconv.ConvertFrom(pix);
pictureBoxretrivepicture.SizeMode = PictureBoxSizeMode.StretchImage;
}
}
}
c# for dummies: c# tutorial
c# for dummies: c# tutorial: CODE TO INSERT IMAGE INTO DATABASE using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin...
c# tutorial
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace pictureProjectIlinqToSql
{
public partial class Picture : Form
{
public Picture()
{
InitializeComponent();
}
private void btnsubmit_Click(object sender, EventArgs e)
{
bool resp = inserstudent();
MessageBox.Show(resp.ToString());
}
OpenFileDialog opendiag;
string path;
private void btnbrowse_Click(object sender, EventArgs e)
{
opendiag = new OpenFileDialog();
opendiag.ShowDialog();
pictureBoxsubmitpicture.SizeMode = PictureBoxSizeMode.StretchImage;
path = opendiag.FileName;
pictureBoxsubmitpicture.Image = Image.FromFile(path);
insertImage();
}
public void getpicturePath()
{
}
byte[] pix;
FileStream fs;
bool flag;
public bool insertImage()
{
fs = new FileStream(path, FileMode.Open, FileAccess.Read);
pix=new byte[fs.Length];
fs.Read(pix, 0, Convert.ToInt32(fs.Length));
return true;
}
public bool inserstudent()
{
StudentDataContext stu = new StudentDataContext();
StudeterDataContext stud = new StudeterDataContext();
StudentTB stub = new StudentTB()
{
Matricno = txtboxmatricno.Text,
photo = pix,
};
stud.StudentTBs.InsertOnSubmit(stub);
stud.SubmitChanges();
return true;
}
}
}
Monday, 20 August 2012
Subscribe to:
Posts (Atom)