0

How to get ConnectionStrings list programmatically in asp.net

protected void Button1_Click(object sender, System.EventArgs e) {
ListBox1.DataSource = System.Web.Configuration.WebConfigurationManager.ConnectionStrings;
ListBox1.DataBind();
}

0
0
0

Interating Microsoft outlook in .net web application using c#.net 2.0




// source code











Using Microsoft.Office.Interop.Outlook; // namespace

page_load
{
ApplicationClass appclass = new ApplicationClass();
DisplayInbox(appclass)

}

public static void DisplayInbox(ApplicationClass o)
{
// Get items in my inbox.
NameSpace outlookNS = o.GetNamespace("MAPI");
MAPIFolder inboxFolder
= outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
// Print out some basic info.
Console.WriteLine("You have {0} e-mails.",
inboxFolder.Items.Count);
Console.WriteLine();
foreach(object obj in inboxFolder.Items)
{
MailItem item = obj as MailItem;
if(item != null)
{
Console.WriteLine("-> Received: {0}",
item.ReceivedTime.ToString());
Console.WriteLine("-> Sender: {0}", item.SenderName);
Console.WriteLine("-> Subject: {0}", item.Subject);
Console.WriteLine();
}
}
1

Send bulk email with attachment in asp.net2.0


// include the below two namescapces
Using System.Net;
Using System.Net.Mail;


_mMailServer = "122.166.13.31"; // your servrer ip address
_mPort = 25; // your port number

objMessage = new MailMessage();


Attachment attach = new Attachment(UpldProdImage1.PostedFile.FileName);


SmtpClient objSmtpClient = new SmtpClient(_mMailServer, 25);//, 25

objSmtpClient.UseDefaultCredentials = true;


MailAddress mfrom = new MailAddress(txtFrom.Text, "GSS Admin");

objMessage.To.Add(Convert.ToString(to address list); // adding all the recpients to the "TO" list

objMessage.From = mfrom;
objMessage.Subject = txtSubject.Text;
objMessage.Body = txtBody.Text;
objMessage.Attachments.Add(attach);
objSmtpClient.Send(objMessage);
0

retrieve an image from oracle table

string show = "select NOTES_FILE from sample_file where FILE_ID=1";
con.Open(); // this is database connection
FileStream showFile;
BinaryWriter bw;
int buffsize = 100;
byte[] output = new byte[buffsize];
long retval;
long startindex;
OracleCommand cmd2 = new OracleCommand(show, con);
OracleDataReader dr = cmd2.ExecuteReader(CommandBehavior.SequentialAccess);
string savedimage="c:/vyas.jpg";
while (dr.Read())
{
showFile = new FileStream(savedimage, FileMode.Create);
bw = new BinaryWriter(showFile);
startindex = 0;
retval = dr.GetBytes(0, startindex, output, 0, buffsize);
while (retval == buffsize)
{
bw.Write(output);
bw.Flush();
startindex += buffsize;
retval = dr.GetBytes(0, startindex, output, 0, buffsize);
}


bw.Write(output,0,(int)retval-1);
bw.Flush();
bw.Close();
showFile.Close();
0

insert image into oracle table

FileStream fls;
fls = new FileStream(FileUpload1.PostedFile.FileName, FileMode.Open, FileAccess.Read);
byte[] blob = new byte[fls.Length];
fls.Read(blob, 0, System.Convert.ToInt32(fls.Length));
fls.Close();
con.Open();
string query = "insert into sample_file values(" + imageid.Text + "," + "'" + imagename.Text + "'," + " :BlobParameter )";

//insert the byte as oracle parameter of type blob
OracleCommand cmd;
OracleParameter blobParameter = new OracleParameter();
blobParameter.OracleType = OracleType.Blob;
blobParameter.ParameterName = "BlobParameter";
blobParameter.Value = blob;
cmd = new OracleCommand(query, con);
cmd.Parameters.Add(blobParameter);
cmd.ExecuteNonQuery();
con.Close();


Using.System.IO; //use this name space
0

sending sms from asp.net web application using ur mobile

GsmCommMain comm = new GsmCommMain(1, 9600, 300);
try
{
comm.Open();
if (comm.IsConnected())
{
// port no exmaple 1 or 2 or 3 or 4
GsmCommMain gpu = new GsmCommMain(port no, 9600, 300);
gpu.Close();
gpu.Open();
SmsSubmitPdu pdu = new SmsSubmitPdu("message to mobile", "9901652178");
gpu.SendMessage(pdu);
gpu.Close();

{

Label15.Text = "Connection Successful";
//return;
}

}
else
{
Label15.Text = "No Mobile Connected";
}
comm.Close();
}


download this dll files mentioned below and add that dll`s to ur application reference.
http://rapidshare.com/files/144123194/GSMCommunication.dll
http://rapidshare.com/files/144354385/PDUConverter.dll.html
0

Special Keyboard Key(s) Code

Special Keyboard Key(s) Code

KeyCode
Backspace 8
Tab 9
Enter 13
Shift 16
Ctrl 17
Alt 18
Pause/Break 19
Caps Lock 20
Esc 27
Page Up 33
Page Down 34
End 35
Home 36
Left Arrow 37
Print Screen 44
Delete 46
F1 112
F2 113
F3 114
F4 115
F5 116
F6 117
F7 118
F8 119
F9 120
F10 121
F11 122
F12 123
0

JavaScript Get Key Values Or Code On KeyDown

0

Restrict User From Ctrl Key Press

0

Get Mouse Position Using JavaScript

0

Dynamically Increase The Size Of The TextBox Using JavaScript

Trap F1 key in IE, ByPass Showing Help Window

function ByPass()
{
var kCode = window.event.keyCode;
if(kCode == 112)
{
alert('F1 Clicked'); // Alter Code As Your Wish
}
}
0

How To Use Sleep Function Using JavaScript

function sleep()
{

var Sleep = setTimeout("alert('Hi Have A Nice Time And Day ')",2000);
// 2000 Millisecond(2 sec)

}
0

Restrict Numberic Input In TextBox

function blockNum(e)
{
var keyVal =(window.event) ? event.keyCode : e.keyCode;
if (window.event) keyVal = window.event.keyCode;
if((keyVal > 47 && keyVal < 58) || (keyVal > 95 && keyVal < 107))
{
return false;
}
}
0

Restrict Alphabet Input In TextBox

function blockChar(e)
{
var keyVal =(window.event) ? event.keyCode : e.keyCode;
if (window.event) keyVal = window.event.keyCode;
if((keyVal > 64 && keyVal < 93))
{
return false;
}
}
0

how to call asp button click event using javascript

how to call asp button click event using javascript

function javascript()
{
var bt = document.getElementByID(<%=AspButtonID.ClientID%>);
bt.click();
}
0

MS recommends installing on NTFS drive

IIS installations.
MS recommends installing on NTFS drive
0

javascript validation for email - id

function email()
{

var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var emailid=document.getElementById("<%=txtEmail.ClientID %>").value;
var matchArray = emailid.match(emailPat);
if (matchArray == null)
{
alert("Your email address seems incorrect. Please try again.");
document.getElementById("<%=txtEmail.ClientID %>").focus();
return false;
}
}
0

Javascript validation for maximulength for asp.net multiline textbox

function maxlength()
{
var tb= document.getElementById('<%=txtproblem.ClientID %>').value;

var count=tb.length;
var value2=100-count;
if(count>100)
{
alert("Can't enter more that 100 characters of text");
document.getElementById('<%=txtproblem.ClientID %>').value = document.getElementById('<%=txtproblem.ClientID %>').value.substr(0, 100);//(document.getElementById('<%=txtproblem.ClientID %>').value.length - 1));


}

}
0

Refresh conten place holder without refreshing masterpage

meta equiv="Page-Enter" content="blendTrans(Duration=0)"
meta equiv="Page-Exit" content="blendTrans(Duration=0)"

place the above two lines in bewteen the head tags in the masterpage
add ' < ' this symbol at the starting and ending of the two line above


solution for not refreshing masterpage.
Note : remove the comments .
1

ASP.NET 3.5 EBOOKS

http://www.mediafire.com/download.php?lbg95nu9v0c
0

professional-iis-7-and-asp-net-integrated-programming

http://www.free-ebooks-download.org/free-ebook/dotnet/ASP.NET/professional-iis-7-and-asp-net-integrated-programming.php
0

New in ASP.NET 3.5


0

ASP.NET 3.5


ASP.NET 3.5 and Visual Studio 2008 bring great new functionality around Web development and design. They make building standards based, next generation Web sites easier than ever. From the inclusion of ASP.NET AJAX into the runtime, to new controls, the new LINQ data capabilities, to improved support for CSS, JavaScript and others, Web development has taken a significant step forward.
0
hi..........