Resource Responses

Search Guest Response by Email:
Total 48 responses found.
How to take backup sql server database through ASP.NET and C# .NET ?
nuwan,

Increase your command timeout to avoid this error
Author: Ravindran      Posted Date: 31 Dec 2012
How to integrate PayPal in ASP.NET?
Programmer

You need change url like for testing we are use www.sandbox.paypal.com and if your project go for live just change url in the config file like www.paypal.com its enough no need to change anywhere else(mean coding). And normal sandbox login details account not work in live paypal.com site. Please register according to your detail in live site use that in your project
Author: Ravindran      Posted Date: 09 Dec 2012
How to integrate PayPal in ASP.NET?
Pankaj please read my above my comments and follow this to sort out your issue
Author: Ravindran      Posted Date: 29 Nov 2012
How to upload and download files using database in C#.NET windows application?
Sethil,

Please see above first i defined table and then start article just copy that query and run to create table in your sql server.
Author: Ravindran      Posted Date: 25 Nov 2012
How to integrate PayPal in ASP.NET?
hi,

just you need only url like for testing we are use www.sandbox.paypal.com and if your project go for live just change url in the config file like www.paypal.com its enough no need to change anywhere else
Author: Ravindran      Posted Date: 03 Nov 2012
How to pass value from one form to other from in C#.NET windows application?
try like this


//Add combo box value
ComboBox c1 = (ComboBox)obj.Controls["comboBox1"]; //change control id as per code
c1.Items.Add("Red");
c1.Items.Add("green");
c1.Items.Add("Blue");

Author: Ravindran      Posted Date: 30 Oct 2012
How to show selected record from grid view to another page?
.aspx page
Refer below sample code


<asp:GridView ID="GridView1" runat="server" DataKeyNames="eno" AutoGenerateColumns="false" onpageindexchanging="GridView1_PageIndexChanging" PageSize="5"
AllowPaging="true" onrowcommand="GridView1_RowCommand">
<Columns>
<asp:BoundField DataField="eno" HeaderText="Employee No." />

<asp:BoundField DataField="empname" HeaderText="Employee Name" />
<asp:BoundField DataField="sal" HeaderText="Salary" />

<asp:TemplateField HeaderText="Details">
<ItemTemplate>
<asp:ImageButton ID="Image1" runat="Server" CommandName="cmdBind" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" runat="server" CausesValidation="false" ImageUrl="~/images/p1.png" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>



.aspx.cs page

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "cmdBind")
{
LinkButton lb = (LinkButton)e.CommandSource;
int index = Convert.ToInt32(lb.CommandArgument);
string pkey;
//Bind values in the text box of the pop up control
pkey = GridView1.Rows[index].Cells[0].Text;
Response.Redirect("Page2.aspx?eno=" + pkey + "); //here i have transfer primary key second page taken that query string in second page and get data for that particular record and update it
}
}


Page2.aspx.cs


using System.Data;
using System.Data.SqlClient;

public partial class GridHypher : System.Web.UI.Page
{
SqlConnection sqlcon = new SqlConnection(@"Server=SQLEXPRESS;database=test;uid=xxxx;pwd=yyyy;");
SqlCommand sqlcmd;
SqlDataAdapter da;
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string eno;
eno = Request.QueryString["eno"];
sqlcon.Open();
sqlcmd = new SqlCommand("select * from emp where eno='" + eno + "'", sqlcon);
da = new SqlDataAdapter(sqlcmd);
da.Fill(dt);
if (dt.Rows.Count > 0)
{
txteno.Text=dt.Rows[0]["eno"].ToString();
txtempname.Text=dt.Rows[0]["empname"].ToString();
txtsal.Text=dt.Rows[0]["sal"].ToString();
}
}

}

}

Author: Ravindran      Posted Date: 29 Oct 2012
How to Create Setup file for .NET Windows application?
Archal make sure your write this code in form load


private void Form1_Load(object sender, EventArgs e)
{
//Below code is used to uninstall application

//Get Command Line Arguments
string[] arguments = Environment.GetCommandLineArgs();
foreach (string argument in arguments)
{
if (argument.Split('=')[0].ToLower() == "/u")
{
string guid = argument.Split('=')[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
ProcessStartInfo si = new ProcessStartInfo(path + "\\msiexec.exe", "/i " + guid);
Process.Start(si);
Close();
Application.Exit();
System.Environment.Exit(0);
}
}

//Load DataGridView first time when form load
refreshGrid();
}

Author: Ravindran      Posted Date: 29 Oct 2012
How to generate insert statement for existing data in SQL Server Management studio?
Yes Just taken that script and save it and use that for other server same structure table too.
Author: Ravindran      Posted Date: 10 Oct 2012
How to calculate distance using Google API?
Thanks Sukumar amd PaulH,

@sukumar

It is free version i am using google api.

The above project source is available here

www.dotnetspider.com/attachments/Resources/43960-7447-Distance-Calculate-source.rar
Author: Ravindran      Posted Date: 25 Sep 2012
How to show selected record from grid view to another page?
samreen,

You can get cell value using my below resource code and stored in session value or pass as query string to display in other page

http://www.dotnetspider.com/resources/43119-How-get-Grid-view-control-cell-value.aspx
Author: Ravindran      Posted Date: 25 Sep 2012
How to integrate PayPal in ASP.NET using cart option ?
Thanks Vivek and sijo
Author: Ravindran      Posted Date: 12 Sep 2012
How to integrate PayPal in ASP.NET?
Anil,

Just i give an simple code to reader understand easily PayPal integration in ASP.NET

Refer below as per your requirement code for Default.aspx.cs


using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class _Default : System.Web.UI.Page
{
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ToString());
SqlCommand sqlcmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
string query;

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindGrid();
}
}
void BindGrid()
{
sqlcmd = new SqlCommand("select pname,pdesc,price from productTable", sqlcon);
sqlcon.Open();
da = new SqlDataAdapter(sqlcmd);
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
sqlcon.Close();
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "buy")
{
ImageButton ib = (ImageButton)e.CommandSource;
int index = Convert.ToInt32(ib.CommandArgument);
GridViewRow row = GridView1.Rows[index];

//Get each Column label value from grid view and store it in label
Label l1 = (Label)row.FindControl("Label1");
Label l2 = (Label)row.FindControl("Label2");
Label l3 = (Label)row.FindControl("Label3");

//here i temporary use my name as logged in user you can create login page after only make an order
Session["user"] = "ravi";

//After user clik buy now button store that details into the sql server "purchase" table for reference
string query = "";
query = "insert into purchase(pname,pdesc,price,uname) values('" + l1.Text + "','" + l2.Text + "','" + l3.Text.Replace("$","") + "','" + Session["user"].ToString() + "')";
sqlcon.Open();
sqlcmd = new SqlCommand(query, sqlcon);
sqlcmd.ExecuteNonQuery();
sqlcon.Close();

//Pay pal process Refer for what are the variable are need to send http://www.paypalobjects.com/IntegrationCenter/ic_std-variable-ref-buy-now.html

string redirecturl = "";

//Mention URL to redirect content to paypal site
redirecturl += "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + ConfigurationManager.AppSettings["paypalemail"].ToString();

//First name i assign static based on login details assign this value
redirecturl += "&first_name=ravindran";

//City i assign static based on login user detail you change this value
redirecturl += "&city=chennai";

//State i assign static based on login user detail you change this value
redirecturl += "&state=tamilnadu";

//Product Name
redirecturl += "&item_name=" + l1.Text;

//Product Amount
redirecturl += "&amount=" + l3.Text;

//Business contact id
//redirecturl += "&business=nravindranmcaatgmail.com";

//Shipping charges if any
redirecturl += "&shipping=5";

//Handling charges if any
redirecturl += "&handling=5";

//Tax amount if any
redirecturl += "&tax=5";

//Add quatity i added one only statically
redirecturl += "&quantity=1";

//Currency code
redirecturl += "&currency=USD";

//Success return page url
redirecturl += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();

//Failed return page url
redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();

Response.Redirect(redirecturl);
}
}

Author: Ravindran      Posted Date: 23 Aug 2012
How to Create Setup file for .NET Windows application?
Thanks Dinesh
Author: Ravindran      Posted Date: 22 Aug 2012
How to Create Setup file for .NET Windows application?
Balu make sure it is permission issue mostly it comes it windows7 OS. Make sure you have set sufficient permission to access that folder and database
Author: Ravindran      Posted Date: 22 Aug 2012
How to integrate PayPal in ASP.NET using cart option ?
ANIL,

Please read that ReadMe.docx attached in that source folder.

Then create sandbox account and inside that account to create two accounts business (Seller) and personal (buyer). Just replace that seller account id in web.config and change port no in success & failed page as per your port after localhost: word. Then just run that source and test after you understand that process rewrite your code as per your requirement and make sure you logged in sandbox account during testing.

I am give sample code only so i am using some static data through data table. If you want load data from database then alter that code as per your requirement and used it.

No need token for shopping cart option leave it.
Author: Ravindran      Posted Date: 21 Aug 2012
How to take backup sql server database through ASP.NET and C# .NET ?
thanks nuwan.. check it my other articles too..
Author: Ravindran      Posted Date: 11 Aug 2012
How to take backup sql server database through ASP.NET and C# .NET ?
Nuwan,

The sql server login user have sufficient privilege then it is possible but the backup is stored in the SQL server installed PC location only not your PC
Author: Ravindran      Posted Date: 11 Aug 2012
How to integrate PayPal in ASP.NET?
vijay,

see my above comment or mail me nravindranmca at gmail.com
Author: Ravindran      Posted Date: 08 Aug 2012
How to integrate PayPal in ASP.NET?
Vijay,

Mistake in that currency paramater just rewrite that code in code behind

//Currency code
redirecturl += "&currency=USD";

And download my full source below resource to check it. Make sure you are change return url or success url as per your port or current website url in web.config file.
Author: Ravindran      Posted Date: 08 Aug 2012
How to integrate PayPal in ASP.NET?
Follow this vijay,

Login in https://developer.paypal.com/ and goto test account then choose "Business" account radio button then click "Enter sandbox test site".


After that login in new popup window login with seller acount mean business account. Under the menu bar profile link button --> then more options in the menu under Selling Preferences choose Website Payment Preferences

Select Auto Return on radio button to redirect and enter return url any valid domain (like http://www.urname.blogspot.com)

Enable on Payment Data Transfer to get payment data return in website and save it.

Again go to more option website payment reference and see identity token is generated (under payment data transfer) copy that identity token use it in the website.
Author: Ravindran      Posted Date: 07 Aug 2012
How to integrate PayPal in ASP.NET?
yes in that page paypal login is there?

Steps to Execute Details Output below image....is appear after you redirect to that URL and make sure you must signin paypal account in the same browser.

Please read in that source attached document
Author: Ravindran      Posted Date: 06 Aug 2012
How to upload and download files using database in C#.NET windows application?
Anirban,

Use the above code snippet for any file store add one additional field in the table to store file type, based on that create temp file in this line

//store file Temporarily
string filepath = "D:\\temp.xls"; //anything what you want that file format
Author: Ravindran      Posted Date: 20 Jul 2012
How to create sub reports in crystal report?
BigHeart,

Make sure you bind interger value to integer data type vice versa. If you bind varchar data to numeric then you got this kind of error.
Author: Ravindran      Posted Date: 19 Jul 2012
How to convert HTML to PDF in ASP.NET?
abdhesh, Make sure your input string was correct format like if you assign string value in integer variable got this kind of error...
Author: Ravindran      Posted Date: 19 Jul 2012
How to create tree view in ASP.NET?
Thanks Rajan
Author: Ravindran      Posted Date: 15 Jun 2012
How to create custom paging in Repeater control?
thanks mahesh...
Author: Ravindran      Posted Date: 01 Jun 2012
How to import excel data into GridView using File Upload Control?
Smita security reason not allowed to keep file in the file upload control during post back occur like password textbox.
Author: Ravindran      Posted Date: 23 May 2012
How to import excel data into GridView using File Upload Control?
Shwetha can you explain clearly you not get data in datatable?
Author: Ravindran      Posted Date: 25 Apr 2012
How to create sub reports in crystal report?
Asha make sure you have installed crystal report specified version
Author: Ravindran      Posted Date: 30 Mar 2012
How to download PDF file from SQL Server Database in ASP.NET?
Jaz,

Option1:

During file upload time store that file type in one field. Based on that field value you can set Response.ContentType in code.

Option2:

Read first few bytes of your store image content and then set

Response.ContentType = "application/pdf"; //change that file format here

In my another article i explained how to chek uploaded file content use that concept to check file is which format
http://www.dotnetspider.com/resources/43209-How-check-Upload-file-real-Image-file-or.aspx
Author: Ravindran      Posted Date: 29 Mar 2012
How to convert HTML to PDF in ASP.NET?
Thanks Jalilur!
Author: Ravindran      Posted Date: 26 Mar 2012
How to get Grid view control cell value in ASP.NET?
Thanks pragash!
Author: Ravindran      Posted Date: 02 Mar 2012
How to Show Uploaded Images in Grid View?
han I have explained in details about database image field insertion in this resource check it

http://www.dotnetspider.com/resources/42953-How-show-uploaded-images-Grid-view.aspx

Source code available in the same page bottom download it and try it..
Author: Ravindran      Posted Date: 12 Feb 2012
How to get Grid view control cell value in ASP.NET?
make sure you pass value to the method !!
Author: Ravindran      Posted Date: 03 Feb 2012
How to Show Uploaded Images in Grid View?
thanks rawan and lily
Author: Ravindran      Posted Date: 28 Jan 2012
How to create custom paging in Data List control?
Thanks Nilesh
Author: Ravindran      Posted Date: 16 Dec 2011
How to download PDF file from SQL Server Database in ASP.NET?
Hi Scott try like this way


Dim sqlcon As New SqlConnection("Provider=SQLOLEDB;Data Source=SGEN-SQL02;Initial Catalog=KX_Live;Integrated Security=True;")

Author: Ravindran      Posted Date: 21 Oct 2011
How to get weather detail using Web Services in ASP.NET?
Hi

what ever cities name given by www.webservicex.net that only load in the dropdownlist.
Author: Ravindran      Posted Date: 24 Sep 2011
How to create custom paging in Repeater control?
Thanks Suresh !
Author: Ravindran      Posted Date: 13 Sep 2011
How to create custom paging in Repeater control?
Thanks Siva
Author: Ravindran      Posted Date: 09 Sep 2011
How to generate insert statement for existing data in SQL Server Management studio?
Thanks Yuvraj and Suresh!
Author: Ravindran      Posted Date: 21 Aug 2011
How to Create Setup file for .NET Windows application?
@BHANU

Reason for your error may be version compatible problem or some Mergemod.dll not register please check this link

http://support.microsoft.com/kb/329214/EN-US/


Author: Ravindran      Posted Date: 20 Jul 2011
How to show number of user in online based on country wise ?
No alok user never login again in to the website until previous session is expired if he/she try to login then message display "your previous session is not expired please try after some time".
Author: Ravindran      Posted Date: 25 Jun 2011
How to show number of user in online based on country wise ?
No Alok agw...i gave entire solution download my source code and try to close your browser i update "N" value using Globax.asax file Session end event.
Author: Ravindran      Posted Date: 25 Jun 2011
Your Website Page Rank
hi

Good very nice thanks for share your information..

Keep do well
Author: Ravindran      Posted Date: 19 Feb 2011
How to convert the Number into words using Sql Query?
hi,

Nice code i execute this ...it working nicely
Author: Ravindran      Posted Date: 14 Jan 2011
Implementing Session in WebService
Excellent Aritical

easily udnerstand session in webservice

Good work
Author: Ravindran      Posted Date: 07 Jan 2011



Top Contributors
Today
    Last 7 Daysmore...

    Awards & Gifts

    Online Members

    Omni Tech
    More...
     
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India