Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
N

netsooz Amir Hamidi

@netsooz Amir Hamidi
About
Posts
12
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • transaction stoppage or resume
    N netsooz Amir Hamidi

    Hi folks I'm building this registration system in my asp application and I've got a question. I'd be happy if you provide me with an answer. I have a code block to check if the entered email exists or not. I've used executeScalar method here. so when the email exists I receive a ONE. now I made an if block telling the machine to print an error then and stop the process. because I'm putting the main process (saving user to DB) after this checkpoint, HOW can I stop the code blocking from process(going on to insertation) if email exists before? I mean I want the transaction to stop if email exists and this requires I think something like break; or ... . can you help me?

    Proper Prepration Prevents Poor Performance! h

    ASP.NET question help database performance career

  • Version error
    N netsooz Amir Hamidi

    I'm so sorry I guess that was a really stupid question to ask, since I could just choose the version when I was creating the project. That's what an amateur does! sorry.

    Proper Prepration Prevents Poor Performance! h

    ASP.NET help csharp sysadmin debugging performance

  • Version error
    N netsooz Amir Hamidi

    hi I'm trying to put this aspx page in my host and run it, I've coded it using VS2010, so version of .netFrameWork is 4. But appearntly the server is running on .netFramework 3.5. so I get this error when I try to locate the page in browser: Line 25: system.web; Line 26: compilation debug="true" targetFrameworkMoniker=".NETFramework,Version=v4.0"; so is there anyway I can fix this or not? thanks

    Proper Prepration Prevents Poor Performance! h

    ASP.NET help csharp sysadmin debugging performance

  • how to make an effective invitation number in activation emails
    N netsooz Amir Hamidi

    Hi folks I'm just trying to complete a registration sector and for that I've done evrything except for activation email. I know the algorithm and how to do that but my problem is where I can't get a beautiful activation number. I want to write and sql query by which I can select from 3 beggining letters of name, 2 final letters of last name and month and day of registration date and ... (which are enetered in registration form) . So I can make a complicated activation code. you know what do I mean! my problem would be solved only if you tell me how I can write and handle that sql query for selection. Thanks alot.

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database algorithms performance help tutorial

  • handle sql error to stop user reputation
    N netsooz Amir Hamidi

    hi there, for sure this solution is the best but please tell me how should I do this. I have my primary key on ID field but how can I put unique constraint on a field? and what is the code to to get the thrown sqlexception? please give me coding way too.

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database performance help question code-review

  • Sending email in ASP.net
    N netsooz Amir Hamidi

    to send an email from your application you have to ways: 1- use smtp server of your own 2- use one of the free smtp servers like gmail's accordingly after choosing your smtp there are two coding ways that goes as below: 1- add namespace of System.Net.mail; 2-in the click event of your [Send Email] button:

    MailMessage mailmsg= new MailMessage();
    mailmsg.From = new MailAddress("Your Email Address");
    mailmsg.To.Add("Email of reciver");
    mailmsg.Subject = "Your sybject";
    mailmsg.Body = "The body of your mail (You can use html tags too";
    mailmsg.IsBodyHtml = true;
    SmtpClient smpt= new SmtpClient("127.0.0.1"); [if you are using your application in your own host]
    smtp.Send(mailmsg);

    ----------------------- Now if you don't have your own smtp and wanna use free one like google's do as below: 1- add the same name space 2- Code as below:

    string subject = "Your Subject";
    string from = "Your Gmail account having @gmail.com";
    string rec = "reciver email";
    string body = "The mail body.";
    MailMessage mail = new MailMessage(from, rec);
    mail.IsBodyHtml = true;
    mail.SubjectEncoding = System.Text.UnicodeEncoding.UTF8;
    mail.Subject = subject;
    mail.Body = body;
    SmtpClient sm = new SmtpClient();
    System.Net.NetworkCredential me = new System.Net.NetworkCredential();
    me.UserName = "your gmail username";
    me.Password = "your gmail password";
    sm.UseDefaultCredentials = false;
    sm.Credentials = me;
    sm.Host = "smtp.gmail.com";
    sm.Port = 587;
    sm.EnableSsl = true;
    sm.Send(mail);

    hope it works

    Proper Prepration Prevents Poor Performance! h

    ASP.NET csharp asp-net question

  • handle sql error to stop user reputation
    N netsooz Amir Hamidi

    hi I have this webpage called register.aspx. user has a form of 4 fields and completes them to get an activation email and ... . Where I want to optimize my code is a place where I want to use a try & catch block where if user enters an existing username he will divert to catch block that tells him to reconsider about his/her username. I mean I want to stop username duplication, what kind of exeption or sql query do I need to use? Please inform me with details since I am kind of new Thanks

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database performance help question code-review

  • Simple activation email
    N netsooz Amir Hamidi

    Hello there I'm having this registration form with 7 fields of real_name, user_name, email, password, city, webpage and signiture, I want my users to fill in this form and then after submitting the form I want to send them an activation email. my database has mentioned fields and also id (using identity) and verfy_user with default value of 0 (which means not). 2 questions are here for me: 1- how can I send activation email (simply?) 2- how can I prevent unactivate users from logging in? your responses will be highly appriciated

    Proper Prepration Prevents Poor Performance! h

    ASP.NET question database performance

  • session value and using that
    N netsooz Amir Hamidi

    As a matter of fact the result of return is always -1 ! I don't know why. by the way Do you think I can try the title instead of id? I mean I use the string of title to pass to session and ... by the way, since I am kind of new in asp.net please inlight me with the ways you've provided. I have no idea what I should do with them thanks

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database help performance announcement

  • session value and using that
    N netsooz Amir Hamidi

    hi people I've created this session in global.asax part of my project in this way:

    Session["news_id"]= null;

    I've used a datalist to load some news titles from database and when you click on that title (Which is a link button) there opens a popup window and reads the desired news. It the click event of mentioned link button I've told that:

    Session["news_id"]= (int)(dataList1.DataKeys[dataList1.SelectedIndex]);

    (I guess that the snippet above is problmatic) Then in the form_load of that popup page after creating the sqlconnection stuff i've made the below commandtext: "select text from news where id='"+Session["news_id"]+"'"; in which text is a field that news is stored and news is the name of my table. What I get as an error is that sometimes on the click event of my link button says : Object not set to its refrence or something and sometimes it says that index was out of range! Plase help me with you solutions. Thanks alot

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database help performance announcement

  • how to open a costumized page in our webform
    N netsooz Amir Hamidi

    My problem is kind of javascript related thing I guess. I have this datalist stuff and On it there are some titles being read from database. its ok so far. But I have this link for each title so when a user clicks on that link (READ MORE link) there opens a new window above all windows and the news show up there. I've used the code below in the OnClientClick event of my READ MORE link :

    <asp:LinkButton ID="LinkButton4" runat="server"
    CausesValidation="False" OnClientClick="windows.showModalDialog('news.aspx, titlebar="no", fullscreen="false", width="300", height="300", toolbar="no", resizable="false", menubar="no"');">read more</asp:LinkButton>

    The qoueted part is a little problamatic I guess. I mean I used qouets, i removed them, I changed the captial letters and ... but no result. If possible please give me the proper solution

    Proper Prepration Prevents Poor Performance! h

    ASP.NET javascript database sysadmin performance help

  • Creating a simple shopping card with two DataLists
    N netsooz Amir Hamidi

    Hello Folks I need to develope a asp.net webpage which in it there are two seperate Datalists, one showing stored products in Database and the other showing the products 'added to shopping card'. Actually when the user clicks on "Add To Shopping Card" link button of one product being shown in first DataList, the other DataList is going to get that and show it (In the same page). As user will click on products' "Add to Shoping Card" they will one by one add to Sh.C so it can hold more that one product. by the way the Sh.C needs to have a final price, calculating all prices of added products. I've designed and bounded the first datalist correctly and what I have is list of products having the image and other information, and i've put a small plus sign (+) indicating the "Add to shopping card" proccess. What I want to know is that how should I make the other DataList and get the list of that. (Include SQL Commands). I'd appriciate your responses. Thanks ;)

    Proper Prepration Prevents Poor Performance! h

    ASP.NET database csharp asp-net performance
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups