Thursday, 22 August 2013

How to insert records in Access table using Asp.Net


 protected void Button2_Click(object sender, EventArgs e)
    {

        try
        {

            OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\NWIND2.accdb");
            con.Open();
//if you want selected columns :
//I have created student table having stud_name,stud_address,stid(autoincremented)
            String q = "insert into student(stud_address)  values(@ad)";
            OleDbCommand cmd = new OleDbCommand(q, con);
            cmd.Parameters.AddWithValue("@ad", "meerut");

            if (cmd.ExecuteNonQuery() > 0)
                Response.Write("inserted");
            else
                Response.Write("not inserted");

        }
        catch (Exception ee) { }
    }

How to send mail using gmail authentication in Asp.Net



using System.Net;
using System.Net.Mail;
using System.Text;
using System.IO;
using System.Data.OleDb;




    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            MailMessage mailMsg = new MailMessage();
            mailMsg.From = new MailAddress("brijeshmalasi@yahoo.com", "Gedutech");
            mailMsg.To.Add( new MailAddress("brjmalasi@gmail.com","global"));
         
            mailMsg.Subject = "hello";
            mailMsg.IsBodyHtml = true;
            mailMsg.BodyEncoding = Encoding.UTF8;
            mailMsg.Body = "this is test mail";
            mailMsg.Priority = MailPriority.Normal;
            mailMsg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
            SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
            client.Credentials = new NetworkCredential("your gmail id", "password");
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            //you can also call client.Send(msg)
            client.Send(mailMsg);
           response.write("Sent");
        }
        catch (SmtpException ee)
        {
            Response.Write(ee);
        }


    }


Saturday, 17 August 2013

How to create pdf file in ASP.NET

If you want to insert image in pdf file using iTextSharp :

var image = iTextSharp.text.Image.GetInstance(Server.MapPath('your image path'));

// where u want your image  (x,y pixels)
image.SetAbsolutePosition(300,300);

document.Add(image)


*************here is code*******

 String imgname = (grid1.Rows[i].Cells[1].FindControl("imagelarge") as System.Web.UI.WebControls.Image).ImageUrl.ToString();
                        //var logo = iTextSharp.text.Image.GetInstance(Server.MapPath(imgname));
                        //Response.Write("img="+imgname);
                        totRequest += "<tr><td><img src="+Server.MapPath(imgname)+" height='100' width='100'></td>";
                        String pname = (grid1.Rows[i].Cells[2].FindControl("name") as Label).Text;
                        totRequest = totRequest + "<td>" + pname;
                        String color = (grid1.Rows[i].Cells[3].FindControl("col") as Label).Text;

Wednesday, 14 August 2013

How to Pass and returns objects via function in C#.Net


class Person
    {
        public int a, b;

        public Person(int x,int y)
        {
            a = x;
             b=y;
        }
        public Person() { }
        public static Person sum(Person pp, Person hh)
        {
            int x = pp.a + hh.a;
            int y = pp.b + hh.b;

            Person temp = new Person();
            temp.a = x;
            temp.b = y;
            return temp;
      //return "a="+a+"b="+b;
        }
         
    }


class A
{
static void Main(String []st)
 {

   Person pp = new Person(34, 60);
            Person hh = new Person(2, 5);

           Person ans = Person.sum(pp, hh);
           MessageBox.Show("a="+ans.a + "b=" + ans.b);
       

}
}


Tuesday, 6 August 2013

C# Dot Net Assignment



TASK FIRST 

Creata a form  as mentioned below in C#.

It will ask name Customer Name,Customer AccNo, Customer Bal, Customer Address.when you click on submit button all details must submit in class object using Constructor function. Class is as follows:
Class Bank
  {
  String name,address;
Int  accno,bal;
                Bank(String na,String add,int ano,int bal){  input data }
                Withdraw( int amt) {with amt}
Deposit(int amt) {dep amt}
checkStatement(int accno) {check statement here }
}

Further, when user click on deposit a new window should appear asking deposit amt .
Same should be followed in case of withdraw amt but in withdraw a module it must take care that if amt is not sufficient to be withdrawn an “warning message must display on MSG box”.

How to send Email By php when user fill registration Form


NOTE : you need to download  "class_email.php" file and save it in your main folder.

Here html form for Users:

********************************index.html***********************


<h5>Registraton Form</h5>
<form method="post" action="insert.php" id="ff" class="well span2" style="padding:10px 10px 10px 10px;margin-left:0px;margin-top:0px" >
<label>Your Name :</label><input type=text class="span2" required id="user" name="user" placeholder="Name :">
<label>Mobile No :</label><input type=text class="span2" required name="mob" id="mob" placeholder="Mobile No :">
<label>Email ID :</label><input type=text class="span2" required name="email" id="email" placeholder="Email ID :">
<label>Select Course</label>
<select class="span2" id="crs" name="crs" style="background:white;border:1px solid white;color:black">
<option value="" selected>-select-</option>
<option value="Career Courses">Career Course</option>
<option value="Training Programs">Training programs</option>
</select>
<label>Select Technology</label>
<select class="span2" id="tech" name="tech" style="background:white;border:1px solid white;color:black">
<option value="" selected>-select-</option>
<option value="android">Android</option>
<option value="C#net">.Net C#</option>
<option value="aspNet">Asp.Net</option>
<option value="phpMsql">Php,MySql</option>
<option value="jquery">Jquery</option>
<option value="htmlJavaCss">Html,JavaScript,CSS</option>
<option value="java">Java</option>
<option value="AjaxWebService">Ajax,WebServices</option>
<option value="WordPress">WordPress</option>
<option value="LinqWpfMvc">Linq,Wpf,Mvc</option>
</select>
<button id="bt" class="btn btn-primary">Submit</button>
<input type=reset value=reset class="btn">
</form>





**************************index.html ended here ***********************


Here is php Code sending Mail.


php file name : insert.php

<?php


$name = $_POST["user"];
$mobile = $_POST["mob"];
$email = $_POST["email"];
$course = $_POST["crs"];
$tech = $_POST["tech"];

//echo "hi, Your name is :$name \n mob:$mobile \n email:$email \n course : $course \n tech:$tech";

include( 'class_email.php');

     $ee= new email();

//below is your Server details with port number.

  $ee->set_server('smtp.gmail.com', 465); //465,597,25 ()


//In below line you have to specify your google valid email and password
  $ee->set_auth('abc@gmail.com','password');


  $ee->set_sender( 'sender Details here ', 'sender Mail here' );

//In array() function mention your list to whom you want to send email: you can specify more than one
//like below

$send_to =array('abc@yahoo.com','xyz@gmail.com','pqr@gmail.com');
  $subject = "Enquiry Mail:GEdutech";
  $body="<div style='border:2px solid blue'><table border='0' cellpadding='10'> <tr> <td>Enquiry Name  </td><td>$name</td></tr>
  <tr> <td>Mobile No: </td><td>$mobile</td></tr>
   <tr> <td>Email :  </td><td>$email</td></tr>
  <tr> <td>Course </td><td>$course</td></tr>
   <tr> <td>Technology  </td><td>$tech</td></tr></table> </div>";


  if( $ee->mail($send_to, $subject,$body))
  {
echo true;
}
 else
 {
echo false;
}


?>


String Questions : Java, C#,C, C++


Strings :
1)Write a program to do the following :
1)To output the question “Who is the inventor of JAVA ?”.
2)To accept an answer.
3)To print out “Good” and then stop, if the answer is correct.
4)To output the message “try again”, if the answer is wrong.
5)To display the correct answer when the answer is wrong even at the third attempt and stop.
2)Write a program to extract a portion of a character string and print the extracted string. Assume  that m characters are extracted , starting with the nth character.

3)Write a program, which will get text string and count all occurrences of a particular word.
4)Write a program to read the price of an item in decimal form (like 75.95) and print the output in paise (like  7595 paise).


Questions on Classes and Objects


Classes and objects:

1)Define a class to represent a book in a library. Include the following members:
Data Members
Book Number,Book Name,Author,Publisher,Price,No of copies, No.of copies issued
Member functions
1)To assign initial value                                  2)To issue a book after checking for its availability
3)To return a book                                          4)To display book information

2)Declare a class to represent fixed deposit account of 10 customers with the following data memers :
Name of the depositor, Account Number, Timer Period (1 or 4 or 5 years), Amount. The class also contains following member function:
a)To initialize data members                                       b)For withdrawl of money (after half of the time period has passed)
c)To display the data members

3)Define a class to represent batsmen in a cricket team.Include the following members:
Data Members :
First Name, Last Name, Runs made, Number of fours, Number of sixes.
Member functions
1)To assign the initial values
2)To update runs made (It should simultaneously update fours and sixes, if required )
3)To display the batsman’s information
Make appropriate assumption about access labels

4)Write a program to manage a rooms statistics. The room class includes the following members :
Data Members :
Length, Width, Height
Member Functions :
a)To assign initial values                                                                b)To calculate area
c)To display information (length,width,height & area)

5)Declare a class to represent bank account of 10 customers with the following data members. Name of the depositor, Account Number, Type of account(S for savings and C for Current ), Balance amount. The class also contains member functions to do the following :
1)To initialize data members                       2)To deposit money
3)To withdraw money after checking the balance (min.balance in Rs.1000)
4)To display the data members.

6)Define a class worker with the following specification :
Wname                25 characters
hrwrk,wgrate    float(hours worked and wagerate per hour)
totwage                               float(hrwrk * wgrate)
calcwg()               A function to find hrwrk * wgrate with float return type
Public member function of class worker
                in_data()                             a function to accept values for wno,wname,hrwrk,wgrate and invoke calcwg() to calculate totwage
Out_data()         a function to display all the data members on the screen you should give definitions of functions.

7)Define a class teacher with the following specification :
a)name                                                20 characters
b)subject                             10 characters
c)Basic,Da,Hra                   float
d)salary                                                float
                Calculate() function computes the salary and returns it.
Salary is sum of Basic,DA, HRA
public members:
ReadData()function accepts the data values and invoke the calculate functions.
DisplayData() function prints the data on the screen
8)Define a class student with the following specification:
Private mebers :
Roll_no                                 integer
name                                    20 characters
class                                       8 characters
marks[5]                              integer
Percentage                         float
Calculate() function that calucates overall percentage of marks and returns the percentage of marks
Public members:
ReadMarks() a function that reads marks and invokes the calculate functions
Displaymarks() a functions that prints the marks

9)Imagine a ticket selling booth at a fair. People passing by are requested to purchase a ticket. A ticket is priced as Rs.2.50/.The booth keeps track of the number of people that have visited the booth, and of the  total amount of money collected.
Model this ticketselling booth with a class called ticbooth including the following members :
Data Members :
1)number of people visited
2)total amount of money collected.
Member Functons:
1) To assign initial values(assign 0 to both data members )
2)To increment only people total in case ticket is not sold out.
3)To increment people total as well as amount total if a ticket is sold out.
4)To display the two totals
5)To display the number of tickets sold out(a tricky one)

10) Write a C # program to perform various operations on  a string class without using without using lanugae supported built in string functions. The operations on a class are:
a)Read a string                                  b)Display  the string
c)Reverse the stirng                       d)Copy the string into an empty string
e)Concatenate two strings.


11)A book shop maintains the inventory of books that are being sold at the shop. The list includes details such as author, title , price,publisher and stock position.Whenever a customer want a book, the sales person inputs the title and author and the system searches the list and displays whether it is available or not. If it is not, an appropriate message is displayed.If it is then the system displays the book details and requests for the number of copies required. If the requested copies are available, the total cost of the required copies is displayed, otherwise the message “Sorrry”! These many copies are not in stock” is displayed.
Design a system using a class called stock with suitable member functions and constructors.


12)Imagine a publishing company that markets both books and audio-cassette versions of its works. Create a class publication that stores the title and price of a publication.From this class derive two classes : BOOK which adds a page count and TAPE which adds a playing time in minutes. Each of these three classes should have a getdata() functions to get its data from the user at the keyboard and a putdata() function to display its data. Write a main() program to test the book and tape classes by creating instances of them, asking the user to fill in their data with getdata() and then displaying the data with putdata().
3)Write a C sharp to read and display information about employees and managers.EMPLOYEE is a class that contains employee number, name, address and department. Manager class contains all information of the employee class and a list of employees working under a manger.




Friday, 26 July 2013

C OBJECTIVE QUESTIONS:


1)Choose the correct statement.

a)Use of Goto enhaces the logical clarity of a code
b)Use of goto makes the debugging task easier.
c)Use goto when you want to jump out of a nested loop.
d)Never use goto

2)Which is true of conitional compilation?
a)It is taken care of by the compiler
b)it is setting the compiler option conditionally
c)it is compiling a program based on a condition
d)it is taken care of by the pre-processor.

3)C was primarily developed as a
a)Systems programming language
b)general purpose language
c)data processing language
d)none of the above

4)C is a
a)high level lanauge
b)low level language
c)high level language with some low level features
d)low level language with some high level features

5)Even if a particular implementation does not limit the number of characters in an identifier, it is advisable to be concise because
a)chances of typographic errors are les
b)it may be processed by assembler, loaders,etc., which may have their own rules that may contradict the language rules
c)by being concise, one can be mnemonic.
d)none of the above

6)The minimum number of temporary variables needed to swap the contents of two variables is
1)1          b)2                         c)3                          d)0

7)The purpose of the following program fragment
                b=s+b;                  s=b-s; b=b-s;
where s,b are two integers is to
a)transfer the contents of s to b
b)tansfrer the contents of b to s
c)exchange the content of s and b
d)negate the contents of s and b

8)Consider the function
                Find(int x,int y)
{return ((x<y)?0Lx-y));}
Let a,b be two non-negative integers.The call find(a,find(a,b)) can be used to find
a)maximum of a,b                           b)positive difference of a,b
c)sum of a,b                                       d)minimum of a,b

9)Let a,b bet non-negative integers. Which of the following calls, finds the positive difference of a and b?
a)find(a,b) +find(b,a)                                     b)find(a,find(a,b))
c)a+find(a,b)                                                      d)b+find(a,b)

10)If integer needs two bytes of storage, then maximum value of an unsigned integer is
a)2 (16)-1                                                             b)2(15)-1             c)2(16)  d)2(15)

11)printf(“%d”,printf(“tim”));
a)results in a syntax error                             b)outputs tim3
c)outputs garbage                                           d)prints tim and terminates abruptly

12)if abc is the input,then the following program fragment
Char x,y,z ;

13) Printf(“%d”,scanf(“%c%c%c”,&x,&y,&z)); results in
a)a syntax error                                                                b)a fatal error
c)segmentation vilation                                                d)priting of 3     

14)consider the statements
putchar(getchar()); putchar(getchar());
If a b is the input ,the output will be
a)an error message                         b)this can not be the input
c)ab                                                       d)a b

15)Let a,b be two positive integers. Which of the following options correctly relates / and % ?
a)b=(a/b)*b + a%b                          b)a=a(a/b)*b+a%b
c)b=(a%b) +a/b                                                d)a=(a%b) + a/b

16)Literal means
a)a string                                                             b)a string constant
c)a character                                                      d)an alphabet

17)Length of the string “correct” is
a)7                                                                                          b)8
c)6                                                                                          d)implementation dependent

18)Which of the following are true regardless of the implementation?
a)sizeof(int) is not less than sizeof(long)
b)sizeof(short) equals sizeof(int)
c)sizeof(int) equals sizeof(unsingned)
d)sizeof(double) is not less than sizeof(float)

19)Coercion
a)takes place across an assignment operator
b)takes place if an operator has operands of different data types
c)means casting
d)none of the above

20)Choose the correct statements
a)Casting refers to implicit type conversion
b)Coercion refers to implicit type conversion
c)Casting refers to explicit type conversion
d)Coercion refers to explicit type conversion

21)Consider the following program fragment
char c=’a’;
while(c++<=’z’) putchar(xxx);
If the required output is abcdefghijklmnopqrstuvwxyz, then xxx should be
a)c                          b)C++                    c)c-1                      d)-c

22)Which of the following comments are true ?
a)C provides no input output features
b)C provides no file access features
c)C borrowed most of its ideas from BCPL
d)C provides no features to manipulate composite objects

23)If y is of integer type then the expressions
     3**y-8)/9 and (y-8)/9*3
a)must yield the same value                       b)must yield different values
c)may or may not yield the same value                  d)none of the above

24)If y is of integer type then the expression
3*(y-8)/9 and  (y-8) / 9*3
yield the same value if:
a)y is an event number                                                                 b)y is an odd number
c)y-8 is an integral multiple of 9                                                 d)y-8 is an integral multiple of 3

25)Integer division results in
a)truncation                                                       b)rounding
c)overflow                                                          d)none of the above

26)Which of the following comments about EOF are true?
a)Its value is defined within stdio.h
b)its value is implementation dependent
c)its value can be negative
d)Its value should not equal the integer equivalent of any character

27)The value of an automatic variable that is declared but not initialized will be :
a)0                                          b)-1                        c)unpredictable                d                             d)one of the above

28)Choose the correct statements
a)An identifier may start with an underscore
b)An identifier may end with an underscore
c)If is a valid identifier
d)The number of significant characters in an identifier is implementation dependent

29)The const feature can be applied to
a)an identifier                                   b)an array
c)an array argument                       d)none of the above

30)Which of the following operators takes only integer operands?
a)+                                         b)*                         c)/                                          d)%

31)In an expression involving || operator, evaluation
a)will be stopped if one of its components evaluates to false
b)will be stopped if one of its components evaluates to true
c)takes place from right to left
d)takes place from left to right

32)The statement
If(myprt!=NULL)
*myptr=NULL;
else
                *myptr=NULL;
has the same effect as the statement(s);
a)if(myptr) *myptr=NULL;
                else *myptr=NULL;
b)*myptr=NULL;
c)if(!myptr) *myptr=NULL;
                                else *myptre=NULL;
d)if(myptr==NULL) *myptr=NULL;
else *myptr=NULL;

34)Pick the operators that associate from the left:
a)+                         b),          c)=                          d)<

35)Pick the operators that associate from the right:
a)?:                        b)+=                                      c)=                                          d)!=

36)The operators . , ||,<,=, if arranged in ascending order of precedence reads
a)

37)Pick the operators whose meaning is context dependent?
a)*                                                         b)#
c)&                                                         d)No such operator exists.

38)The following code fragment
int x,y=2,z,z;
X=(y=y*2) +(z=a=y);
Printf(“%d”,x);
a)print  8                                              b)prints 6
c)prints 6 or 8 depending on the compiler implementation
d)is syntactically wrong

39)if n has the value 3 then the output of the statement printf(“%d %d”,n++,++n);
a)is 3 5                                                                  b)is 4 5
c)is 4 4                                                                   d)is implementation dependent
40)x-=y+1; means
a)x=x-y+1                                                                            b)x=-x-y-1
c)x=-x+y+1                                                                         d)x=x-y-1

41)Which of the following comments about  the ++operator are correct ?
A)It is a unary operator                 b)The operand can come before or after the operator
c)It can not be applied to an expression                                d)It associates from the right

42)In standard C, trigraph in the source program are translated
a)before the lexical analysis                        b)after the syntax analysis
c)before the recognition of escape characters in strings                 d)during the intermediate code generation phase.

43)printf(“%c”,100;
a)prints 100                                                                        b)prints the ASCII equivalent of 100
c)prints garbage                                                               d)none of the above

44)The program fragment
int  i=263;
putchar(i);
a)prints 263                                                        b)prints the ascii equivalent of 263
c)rings the bell                                                  d)prints garbage

45)Which of the following comments regarding the reading of  a string ,using scanf (with %s option ) and gets , is true?
a)Both can be used interchangeably       b)scanf is delimited by end of line,while gets is not
c)scanf is delimited by blank space , while gets is not       d)none of the above

46)The following statement
                printf(“%f”,9/5);
prints
a)1.8                      b)1.0                      c)2.0                      d)none of the above

47)Which of the following are not keywords in C ?
a)printf                                 b)main                  c)IF                         d)none of the above

48)The following program fragment
Unsigned i=1; int j=-4; printf(“%u”,i+j);
Prints
a)garbage                            b)-3
c)an integer that changes from machine to machine
d)none of the above

49)The following program fragment
For(i=3;i<15;i+=13)
printf(“%d”,i);
Results in
a)a syntax error                                                                b)an execution error
c)printing of 12                                                  d)printing of 15

50)The following program fragment
if(a=0)
printf(“a is zero”);            else printf(“a is not zero”);
Results in the printing of
a)a is zero                                                                            b)a is not  zero
c)nothing                                                                             d)garbage

51)A possible output of the following program fragment
for(int i=getchar();;i=getchar())
If(i==’x’) break;
else putchar(i); is
a)mi                                       b)mix                    c)mixx                   d)none of the above

52)The following program fragment
int  i=5;
Do {putchar(i+100);printf(“%d”,i--);}
while(i);
results in the printing of
a)i5h4g3f2el                                                                       b)i4h3g2fle0
c)an error message                                                         d)none of the above
                                                                                                               




Tuesday, 22 January 2013

About G-EduTech



Today,the scenario of  the education system has been changed  due to the different technologies in the market. Effects of the technologies are so rapid that which technology has to follow or not is the question. G-EduTech believes that technologies are born, not to be stable, but they are changed by the span of time. Need is not worry about numerous technologies, but to learn them from the bottom to the top. Need to have revolution education by which average person can be learnt. G-EduTech tries to full all the demands according to the market and provides different type of training program from the very basic.

From the last few years, the need of software and website applications have been recognized in the Bank, Enterprises, Education System, Research and so on. Global EduTech not only provides computer training, but also create a atmosphere where people can judge and feel the subjects  and  bring up his/her talent. We have professional and corporate training experience to aid student to get their career at right direction. We deal with PHP, ASP.NET, JAVA, C, C++.

G-EduTech is a fully qualified professionals team support in the field of IT training and development. We provides following services :

  • IT training to BTech, MCA, BE, BCA, MTech, MSc(IT) students to enhance IT qualities.
  • Corporate training to Colleges, Institutions and Organizations.
  • Professional Coaching to Developers,programmers and Designers to upgrade their IT skills.
  • Internships with live projets

OUR TRAINING PROGRAMS ARE AS FOLLOWS :

SQL SERVER 2005/08               -           1 MONTH
C# - ASP.NET                        -           3/6 MONTH           
JAVA                                    -           3/6 MONTH
ANDROID                               -           2 MONTH
PHP                                      -           2 MONTH
JQUERY                                 -           1 MONTH
WEB DESIGNING                      -           1 MONTH

OUR MODULES SERVICES : ( FAST TRACK )

HTML                                      -           7 DAYS
JAVASCRIPT                             -           10 DAYS
CSS                                        -           10 DAYS
JQUERY                                   -           10 DAYS
SQL                                        -           10 DAYS
DIV     TAG                              -           7 DAYS
SEO                                        -           7 DAYS


WHY  ANDROID ?

Google Android - A Future Mobile OS?
 Recently Google mobile chief Andy Rubin announced.
  • Android has reached half billion activations.

  • 1.3 million android devices added every day

If you don’t know the above facts, your time now  start to know the facts. If we believe in above fact, what about future statistics and demand of android professional.


    JOIN US TO BE PROFESSIONAL


Contact Us :


36/38,Ist Floor, Desh Bandhu Khadi Bhandar, Subhash Bazar, Meerut. 

Mobile No: 9897048275, 8439135226 
LandLine Number : 0121-4034674




http://www.google.com/mapmaker?ll=28.980176,77.712908&spn=0.024102,0.032959&z=15&lyt=large_map