|
H,
I had used OLEDB provider to connect to DB2.When i run the code the system response is slow when connection is open.When i debug it hangs in connection ope.
Please suggest some code or idea
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;
namespace Supply_Chain
{
public partial class _Default : System.Web.UI.Page
{
OleDbConnection conn = new OleDbConnection();
protected void Page_Load(object sender, EventArgs e)
{
string connString = @"Provider=IBMDADB2;Database=BBTFILEA;Uid=KSUNDER;Protocol=TCPIP;Port=23;Hostname=10.140.201.21;Pwd=welcome1;";
DataTable dt = new DataTable();
dt = DB2data(null, null, connString);
}
public DataTable DB2data(OleDbParameter[] Params, string spName, string connString)
{
DataSet ds = new DataSet();
using (OleDbConnection DBConn = new OleDbConnection(connString))
{
DBConn.Open();
Response.Write("CONNECTED TO DB2");
DBConn.Close();
}
return ds.Tables[0];
}
}
}
Regards
S.Guhananth
|
|
|
|
|
Hi,
I have a scenario like this.
I have two asynchronous service calls AsynchronousCal1 and AsynchronousCal2. And two response handlers ResponseHandler1 and ResponseHandler2. When AsynchronousCal1 finished ResponseHandler1 will be called. When AsynchronousCal2 finished ResponseHandler2 will be called.
Now I want to call a method "RunMethod" when the above two Response handlers completed.
The above two calls are asynchronous and I am calling them paralelly (Its mandatory for me to call them paralally), we are not sure which ResponseHandler will complete first and which ResponseHandler will complete second.
How to handle this situation in ASP.NET and C#?
Thanks in Advance.
|
|
|
|
|
Hi...
I have doing my project on investment mgt.In which i have to update equity share price so that i will helping my client by providing profit/loss information for his portfolio.But problem is that i have not connectivity with nse or bse.So on student level project can i get some free source for update so i will update my share price..If update will take + or - 5-10 min for update then its also fine.But I require free update link...
Please helping me..
|
|
|
|
|
No you cannot get it free..
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Yes you can.
You need to do a little process which is that you need to import market price dailybasis.
Where you can get Daily Market Price?
For this you need to open site for NSE or BSE and there is a link for download daily market price after market close.
www.bseindia.com/mktlive/bhavcopy.asp[^]
www.nseindia.com/archives/archives.htm[^]
you can easily import these files to your database.
Maulik Dusara
Sr. Sofware Engineer
I love it when a plan comes together
|
|
|
|
|
hi i am a new user of asp.net
in php i can show direct value but how i can do this with asp.net there is lot of news on my database i would like to show all news on my page between the marquee tag like most sites have..
how i will show will u provide code to show message..
thanks
|
|
|
|
|
|
<
div class="newsmatter">
<marquee behavior="alternate" direction="up" height="200px">
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table cellpadding="1" cellspacing="3" width="99%" style="text-align:justify" >
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style="color:Black " >
<%#DataBinder.Eval(Container.DataItem,"Newscontent")%>
</tr>
<tr style="height:10px;">
<td >
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></FooterTemplate>
</asp:Repeater>
</marquee>
</div
>
|
|
|
|
|
|
Hi,
We are trying to connect to DB2 from .Net via IBM DB2 Data provider. We are not able to establish the connection using the CFWEBUSER profile created.
We are checking for other options to establish the connection.
Tried checking the CFWEBUSER Profile directly in DB2 box. We have limitations in using the queries using the CFWEBUSER As400 profile. We have “Start Structured Query Language (STRSQL)” command in AS400 which starts the interactive SQL program to write the SQL queries. I’m not able to access this command using the profile mentioned.
Any Db2 guys here,,,,,,,,,what is CFWEBUSER profile.
Thanks
Guhananth.S
|
|
|
|
|
Hi i m using paypal IPN for payment notifications. I am using the same code provided by Paypal however i m having issues. Here is the code
string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
string strLive = "https://www.paypal.com/cgi-bin/webscr";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox);
//Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
string strRequest = Encoding.ASCII.GetString(param);
Dictionary<string, string=""> nvs = new Dictionary<string, string="">();
string[] items = strRequest.Split("&".ToCharArray());
foreach (string item in items)
{
string[] parts = item.Split("=".ToCharArray());
nvs.Add(parts[0], HttpUtility.UrlDecode(parts[1]));
}
strRequest += "&cmd=_notify-validate";
req.ContentLength = strRequest.Length;
//for proxy
//Hook up 1&1 proxy server
//WebProxy proxy = new WebProxy("ntproxyus.lxa.perfora.net:3128",false);
//req.Proxy = proxy;
//Send transaction detail with the flag back to PayPal
StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();
//DataLayer dl3 = new DataLayer();
//dl3.executeQuery("Update petOwner set orderStatus = 'Afterproxy(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
//Get validation status from PayPal
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
string strResponse = streamIn.ReadToEnd();
streamIn.Close();
//DataLayer dl4 = new DataLayer();
//dl4.executeQuery("Update petOwner set orderStatus = 'Afterproxy2(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
if (strResponse == "VERIFIED")
{
//check the payment_status is Completed
if (nvs["payment_status"] == "Completed")
{
//check that txn_id has not been previously processed
//check that receiver_email is your Primary PayPal email
//check that payment_amount/payment_currency are correct
//process payment
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Paid' where orderId = '" + Request.Form["item_name"] + "'");
CheckPaymentMode();
SendOrderEmail();
}
}
else if (strResponse == "INVALID")
{
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Not Paid(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
//log for manual investigation
}
else
{
DataLayer dl = new DataLayer();
dl.executeQuery("Update petOwner set orderStatus = 'Not Paid(Invalid Card)' where orderId = '" + Request.Form["item_name"] + "'");
//log response/ipn data for manual investigation
}
}
The code is working fine untl this line of code
StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
streamOut.Write(strRequest);
streamOut.Close();
When it comes to send request to paypal. from here on no line of code gets executed.
I ve contacted the hosting company they are saying no proxy is needed to send request.
I am unable to trace the issue. Need urgent help
Thanks in Advance,
Asfand
|
|
|
|
|
Please put your code in <pre> tags so that it's readable. (Use the "code" formatting.)
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
hi
i want create chat room on my site please guide me
|
|
|
|
|
|
hi
how do i send Message ,
broadcasting to update all clients
|
|
|
|
|
It's depend on your implementation because you didn't specify anything like are you using any Messaging Server OR Have you implemented it's own? OR you want to implement it both Server and Client?
Parwej Ahamad
|
|
|
|
|
you also need to specify that this is Windows or Web application. and also you need to show what you have implemented for this.
Maulik Dusara
Sr. Sofware Engineer
I love it when a plan comes together
|
|
|
|
|
I am in the processing of trying to run a C # asp.net 2010 web application from my workstation so I can understand it and add my own webpages to the application. However to get this application to run, I am trying to determine what the following values should be in the web.config file:
^<appSettings>
<add key="ReportViewerServerConnection" value="" />
<add key="ReportViewerUser" value="" />
<add key="ReportViewerPassword" value="" />
<add key="ReportViewerDomain" value="" />
<add key="ReportServerUrl" value="" />
<add key="ReportsPath" value="" />
</appSettings>^
Let me know if the following settings are correct and/or what would you recommend?
^
<add key="ReportViewerUser" value=general company name? />
<add key="ReportViewerPassword" value=general company value />
<add key="ReportViewerDomain" value=general company domain or report server doamian?/>
<add key="ReportServerUrl" value="http://localhost/reportserver" />
<add key="ReportsPath" value="" />^
where would this reports path be on my local workstation?
NOTE: I have C#.net 2008 desktop experience, but this is the first time I am working on anasp.net 2010 application.
|
|
|
|
|
i am developing sending bulk mail in asp.net using C#....how to send mail without internet connection...Is There any code in C# for sending bulk mail without internet connection...(intranet to internet)
|
|
|
|
|
How do you expect your mail messages to be delivered without internet connection? Without a communications link to the mail server, and from there to all the mail receivers, it is not possible.
|
|
|
|
|
I think the question is about sending mail from a machine that itself doesn't have an internet connection, but does have an intranet connection.
If so, all it needs is another machine on the intranet with an internet connection and run an SMTP server or relay on it.
|
|
|
|
|
Maybe you should have posted this information to OP.
|
|
|
|
|
I have an index page that I want to filter based on drop down list selection, this is the relevant code:
Controller:
public ViewResult Index()
{
var observations = db.Observations
.Include("Claim").Include("Defect").Include("InspectionType")
.Include("Location").Include("Property");
ViewBag.defectId = new SelectList(db.Defects, "id", "displayId");
return View(observations.ToList());
}
public ViewResult Search(int defectId)
{
var observations = db.Observations
.Include("Claim").Include("Defect").Include("InspectionType")
.Include("Location").Include("Property").Where(o => o.defectId == defectId);
return View(observations.ToList());
}
View:
@Html.DropDownList("defectId", String.Empty)
@Html.ActionLink("Search","Search", new { defectId=??????????????})
That big old question mark chain is where my issue lies. How do I get the value from the above dropdown list back to the Search ViewResult on the controller?
Cheers, --EA
|
|
|
|
|
I've been using Data CacheDependency for a while now for my XML File based data.
But then I suddenly had the need to use a data cache for my SQL Server based Products table and started looking around for some help.
Then I found this:
http://www.asp.net/data-access/tutorials/using-sql-cache-dependencies-vb
After taking a look at this tutorial, I said "Wow, there goes my sunday afternoon!".
But being lazy as I am, I started wondering if there wouldn't be an easier way for achieving what I wanted, and this is what I came up with.
1. I created a Table named TableChanged with 2 columns:
- TableName varchar(20)
- Changed bit
The idea is to track changes made to other tables; for the time being there is only 1 row in it:
TableName Changed
Products True
2. I created a trigger in the Products table:
CREATE TRIGGER Changed
ON dbo.Products
AFTER INSERT, UPDATE, DELETE
AS
Update TableChanged Set Changed = 1 WHERE TableName='Products'
So everytime something changes in Products, the value of Changed becomes True, in TableChanged.
I created the same trigger in table Categories, since it's related to Products.
3. In PageLoad I did:
If Not IsPostBack Then
Dim dv As DataView
Dim changed As Boolean = Global.CheckChanged("Products")
If changed Then
dv = LoadDV()
Else
dv = Cache("cachedDV")
If dv Is Nothing Then
LoadDV()
dv = Cache("cachedDV")
End If
End If
Protected Function LoadDV() As DataView
Dim dt As DataTable = Product.GetDiscounted
Dim dv As DataView = New DataView(dt)
Global.UpdateChanged("Products")
Cache("cachedDV") = dv
Return dv
End Function
Global and Product are classes in my BOL which handles the dataconnection thru my DAL. The sprocs used for CheckChanged and UpdateChanged are the following:
ALTER PROCEDURE dbo.TableChangedCheck
@sTable varchar(20)
AS
SET NOCOUNT ON
Select Changed From TableChanged WHERE TableName=@sTable
RETURN
ALTER PROCEDURE dbo.TableChangedUpdate
@sTable varchar(20)
AS
SET NOCOUNT ON
UPDATE TableChanged SET Changed = 0 WHERE TableName=@sTable
RETURN
So, on Pageload, if changed = true the dataview gets populated from the db and is added to the cache, while the row "Products" in TableChanged gets flagged as False.
On subsequent Pageloads, changed = false, so the dv gets populated from the cached dv;
And this goes on until either the Products or Category table get altered or the application restarts.
Very well then, this seems to work. My question is now why would the people at MS dream up
the SqlDependency Class if the same result can be achieved in this (apparently) much simpler manner?
What are the hidden pitfalls, drawbacks, disadvantages, if any, of my custom implementation.
I was hoping someone more experienced on the subject could reassure me to stay with it.
In this case it might help out others too, looking for the same thing.
Thank u for your attention
Jaime Premy
modified on Friday, September 16, 2011 8:43 AM
|
|
|
|