C#

keyword searching result from database in C#

Posted on May 23, 2008. Filed under: C# |

public static DataSet RelatedKeyword(string keyword)
{string[] arr =keyword.Replace(“& “,“”).Split(‘ ‘);
DataSet ds = new DataSet();
DataSet dsTemp = new DataSet();
bool flag = false;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["remote"].ConnectionString);
// DBAccess db = new DBAccess();
SqlDataAdapter sda;
foreach (string s in arr)
{ if (s.Length >= 2)
{ sda = new SqlDataAdapter(“select distinct top 60 keywordid, keywordname from keyword  where keywordname like ‘%’+@ksearch+’%’”, con);
sda.SelectCommand.Parameters.Add(“@ksearch”, SqlDbType.VarChar).Value = [...]

Read Full Post | Make a Comment ( None so far )

Sending mail in asp.net

Posted on May 12, 2008. Filed under: C# |

System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
mail.From=new MailAddress(”mymail@gmail.com”);
mail.To.Add(new MailAddress(”sendmail@yahoo.com”));//enter company name which send
mail.IsBodyHtml=true;
mail.Subject = “Sending Enquiry”;
mail.Body = “Enquiry About Company “;
//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential(”maymail@gmail.com”, “password”);
//Smtp Mail server of Gmail is “smpt.gmail.com” and it uses port no. 587
//For different server like yahoo this details changes and you [...]

Read Full Post | Make a Comment ( 1 so far )

Creating Datalayer in Class file

Posted on May 12, 2008. Filed under: C# |

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace RUBRUDATAACCESS.SQL
{
public class DATALAYER:IDisposable
{
private IDbCommand cmd=new SqlCommand();
private string strConnectionString=””;
private bool handleErrors=false;
private string strLastError=””;
public DATALAYER()
{
[...]

Read Full Post | Make a Comment ( None so far )

Recursively find control from previous page

Posted on April 9, 2008. Filed under: C# |

hi
i study more time asp.net starter kit and i found best code for finding previous page server control.
But from prevoius page you must use  postbackurl on button  or use  server.transfer(”go.aspx”);
The code is follow……..
public sealed class Util{ 

 
private Util(){
}
 

 
public static Control FindControlRecursively(string controlID, ControlCollection controls){
if (controlID == null || controls == null) 

 
return null; 
 
foreach (Control c in controls){
 
 
if [...]

Read Full Post | Make a Comment ( None so far )

    About

    Hi,I am Suresh Sharma(MCP) from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...