Friday 30 March 2012

How can we store in multiple table and show in messagebox using vb.net


Imports System.Data
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object,
 ByVal e As System.EventArgs) Handles Button1.Click
    Dim ds As New DataSet
    Dim dt As New DataTable
    Dim dr As DataRow
    Dim idCoulumn As DataColumn
    Dim nameCoulumn As DataColumn
    Dim i As Integer

    idCoulumn = New DataColumn("ID", Type.GetType("System.Int32"))
    nameCoulumn = New DataColumn("Name", Type.GetType("System.String"))

How can we add record using dataset and add record from gridview coloumn using vb.net



 Dim idcoloumn As New DataColumn
    Dim id1coloumn As New DataColumn
    Dim dt As New DataTable

    Dim dr As DataRow
    Dim dr1 As DataRow

Thursday 29 March 2012

In program how can we use dataset in vb.net


    Sub Main()
 'Here is  Two DataTables.
 Dim table1 As DataTable = New DataTable("doctors")
 table1.Columns.Add("name")
 table1.Columns.Add("id")
 table1.Rows.Add("sohan", 1)
 table1.Rows.Add("Waris", 2)

Wednesday 14 March 2012

In asp.net how can we send sms

SENDING SMS IN ASP.NET

Introduction:
                In this article we will see how to send sms from our web application using ozeki-Ng-SMS-Getway.
Pre-Requesite:
1)      For sending sms from our asp.net web application we required third party sms-getway which will deliver our messages to user. You can download this Getway from here http://www.ozekisms.com/index.php?owpn=112.
2)      Mobile Phone whith SIM card and Datacable. Which will be used for sending our sms.

Wednesday 7 March 2012

Main difference between Union and Union All in sql server 2005/2008


UNION

The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type. With UNION, only distinct values are selected.

Sunday 4 March 2012

check image accept only png,jpg,gif and Jpeg using javascript

<script language="javascript" type="text/javascript">
 
 function validate() {
      var result = false;
      var upfile = document.getElementById("FileUpload1").value;
      if (upfile != "") {
      var accept = "png,gif,jpg,jpeg".split(',');
      var getExtention = upfile.split('.');
 

how can we fetch data from database using datalist in asp.net


 Firstly make table in sql server like as:-
Create table college
(
id int,
name nvarchar(50),
Category nvarchar(60),
address nvarchar(60),
city nvarchar(50),
phone bigint
);

Main difference between dataset and datatable in ado.net

I have used Datatable and Dataset interchangeably. A Dataset has an overhead perfomance hit when its loaded with a lot of Data. Now let me be more clearer, a Dataset can Contain a lot of Datatable :- A Dataset is like a Container for Datatables because every dataset has a datatable contained inside it and a Datatable is like a table you have in SQL and a Dataset its like a Database that contain table(Datatable).

Friday 2 March 2012

Query string encoding in asp.net

The .NET Framework provides the HttpServerUtility.UrlEncode class to encode the URL.
The following code shows how name and id is passed to abc.aspx page as encoded.
  string id = "11";
  string name = "abc";
  string url = string.Format("abc.aspx?{0}&{11}", Server.UrlEncode(id), 
  Server.UrlEncode(name));
  Response.Redirect(url);

In asp.net three types of session storage described below

InProc:- use like as <sessionState mode="InProc" /> 

Storage location:- Asp.net Process memory area

Description:- This is the default session storage. Session data will be kept in the server memory. InProc mode is a high performance as it reads from the same processes memory and it allows you to keep all .NET types. If session mode is not specified, ASP.NET will use InProc as the default mode.

State server:-
<sessionStatemode="StateServer" stateConnectionStrin
g= "tcpip=Yourservername:42424" /> 

How can we use TOP clause and GETDATE() fucntion in sql

The TOP Clause

The TOP clause is used to specify the number of records to return.
The TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance.

GET DATE()

Main difference between execute query and execute nonquery and execute reader in sql server 2005/2008

EXECUTE QUERY

ExecuteQuery() is for command objects i.e., this method will send "select statement" to database and returns value given by the database. Moreover the executeQuery() is not used in .net but it is used in JAVA.

Thursday 1 March 2012

Difference between Delete,Truncate and Drop State ments in sql server 2005/2008

DELETE

The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it. Note that this operation will cause all DELETE triggers on the table to fire.

TRUNCATE

TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.

What is the difference between candidate key and primary key

Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.
Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.