|
In place of oracle connection i suggest you to go with the oledb connection, Which provided by the .net framework it self
You have to import the library as
Imports System.Data.OleDb
then your code will look like:
Dim p_Count As Integer = 0
Dim conStr As String = ""
Dim cmdQuery As String = ""
Dim con As OleDbConnection = Nothing
Dim cmd As OleDbCommand = Nothing
Dim oReader As OleDbDataReader = Nothing
Try
conStr = "<Connection string for oledb connection>"
cmdQuery = "SELECT COUNT(*) FROM WWW.RC$_PRODUCTINDEX"
con = New OleDbConnection(conStr)
cmd = New OleDbCommand(cmdQuery)
cmd.Connection = con
cmd.CommandType = Data.CommandType.Text
cmd.Parameters.Add("@MANUFACTURER", OleDbType.VarChar, 80).Value = m_Manufacturer
con.Open()
oReader = cmd.ExecuteReader
While oReader.Read()
p_Count = oReader.GetInt32(0) 'TheCount
End While
Catch ex As Exception
Finally
con.Close()
oReader = Nothing
End Try
con = Nothing
cmd = Nothing
Return p_Count
|
|
|
|
|
I am interested in making a universal way for all my programs to be able to switch SQL Database Programs, and I think OLEDB was going to be the standard in the future. I did some research on it during my C++ development last year, and I just need to look at my code to see what I used.
I ended up using the Oracle ODP.NET 11.2, the latest one, and finished installing the Oracle 11.g to my production database server, and setup the ODP client on the web server, so I'm ready to go.
i will tool around with teh OLEDB this weekend, and take it for a spin.
Thanks for the discussion on it, anything on the subject is welcomed.
|
|
|
|
|
I have a java web service, RPC that is not accessible direct creating proxy class in .net.
How can we consume java web service RPC not saop in my .net application.
I am getting error :
Client found response content type of 'multipart/related; boundary=MIMEBoundaryurn_uuid_C426126584B07577941351575273892;
Thanks,
|
|
|
|
|
Hi,
I want to create a Facebook application.
Form the examples on the web I see that there's a use of php on the server side.
Is there a way to create the application with asp.net web forms / asp.net MVC and achieve the same results?
Thanks,
Avi
|
|
|
|
|
ThetaClear wrote: Form the examples on the web I see that there's a use of php on the server side.
Outside of the server, that difference is not visible. Server code runs on the server, it's only the result that one can see.
There's an example on C# and FB here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
My query is that i am doing a shopping cart site.I have a repeater control loaded with products and when user clicks on a specific product ,the selected product should get loaded to the gridview which is at the rightcorner .It should happen without postback and when user selects another product the gridview should get updated with another product.How to attain the result. Expecting ur suggestions.
Thank you
|
|
|
|
|
fahad.1 wrote: Expecting ur suggestions.
Use AJAX.
Sorry, but you'll have to research the technology and see how it will fit in your application.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Use AJAX UpdatePanel control.
Put all the code that is being postback to the server in side the UpdatePanel control
|
|
|
|
|
Your going to have to use Javascript, and create your sort of fake grid, and update that fake grid in the DOM. At the same time the item is added, you need to use a web service to update the cart with that item. So when you do a postback, all the items can repopulate that same space.
fahad.1 wrote: .It should happen without postback
Update panels do a partial postback of the page, but it's still a postback.
The only way to get around a postback is to use a web service in the background, in combination with Javascript, to just keep manipulating the dom, until you leave the page.
As far as manipulating the Gridview in JavaScript, I have no idea how.
That's alot of work for that feature or confirmation.
|
|
|
|
|
I am using dropdownlist in c# asp.net. Here one dropdown list getting data's from database and its having required field validator also.,
My ASP design coding is.,
<asp:dropdownlist id="zonename" runat="server" width="195px" tooltip="Select Zone">
<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="zonename" errormessage="Zone Name Required" initialvalue="Select Zone">
And MY C# coding is....,
da = new MySqlDataAdapter("select name from zone", mysqlcon);
dt = new DataTable();
da.Fill(dt);
zonename.Items.Clear();
zonename.Items.Add("Select Zone");
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
zonename.Items.Add(dt.Rows[i]["name"].ToString());
}
mysqlcon.Close();
WHEN I AM SAVING THIS DROPDOWNLIST TEXT TO THE DATABASE.,THE WORD "Select Zone" ONLY GOING TO THE DATABASE.
MY INSERT QUERY IS.,
"insert into TABLENAME(zonename) values('"+zonename.text+"')";
Here i couldnt understand what is going on.,i need to save the selected text to the database. If anybody know how to solve this problem, Please let me know.,
Thanks.,
|
|
|
|
|
zonename looks like it is some sort of list so it is unlikely to have a member called text . It would also help if you formatted your code and put <pre> tags around it, to make it more readable thus:
da = new MySqlDataAdapter("select name from zone", mysqlcon);
dt = new DataTable();
da.Fill(dt);
zonename.Items.Clear();
zonename.Items.Add("Select Zone");
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
zonename.Items.Add(dt.Rows[i]["name"].ToString());
}
mysqlcon.Close();
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Look at the SelectedText and SelectedValue properties of the DropDownList control.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
it's
ddl.items.clear();
ddl.items.add(new listitem("Select a Zone", "--")
ddl.items.add(new listitem(Name, Value));
'Check that the selection is not "--" or > 0
string pvalue = ddl.selectedvalue;
insert into table pvalue
and get the selected value of the ddl, not the selected text
|
|
|
|
|
Hi everyone
Please find below the exact code you need in order to prevent cache from being stored. I am posting this in order to help everyone that ever needs it as I spent myself some hours this last saturday trying to do it. I saw many combinations from the same code everywhere in several forums but this is the only one that worked for me comes, as referenced below
After filling a form, then going back to the previous page and then forward back again, the form is empty as expected. Nothing is stored in the browser's cache
Hope it helps
Regards
Diego Sendra
e-mail: contact@diegosendra.com
http://www.diegosendra.com
[code]
<%
Response.buffer=true
Response.Expires = -1
Response.ExpiresAbsolute = Now() -1
Response.AddHeader "pragma", "no-store"
Response.AddHeader "cache-control","no-store, no-cache,
must-revalidate"
%>
[/code]
|
|
|
|
|
dawnofdefiance wrote: Please find below the exact code you need in order to prevent cache from being stored. Thanks
Alas, it'll be hard to find on the forum, as new messages keep coming in. You might want to submit it as a trick; makes it a bit easier to find.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, I posted it as an article instead, as suggested
Thank you
Diego
|
|
|
|
|
hi Eddie
I report a totally unrespectful behavoir from two members of this site, Guirec Le Bars and Sandeep Mewara
After following your advise to posting it as a trick I received this from these users:
Guirec Le Bars: "Not an article and not even a tip I guess..."
Sandeep Mewara: "Agree. Not even a tip."
Inmediatly the article was deleted
I am not used to this kind of treatment, I am a respected professional with over 20 years experience in the field
I just re-submitted it and I HOPE it gets published now
I have the right to judge myself if what I write is of any help or not, and not be judged by third parties
After all, I am helping others, not trying to earn a cent from this or anything else
|
|
|
|
|
diegosendra wrote: I report a totally unrespectful behavoir from two members of this site, Guirec Le Bars and Sandeep Mewara
After following your advise to posting it as a trick I received this from these users:
Guirec Le Bars: "Not an article and not even a tip I guess..."
Sandeep Mewara: "Agree. Not even a tip."
Inmediatly the article was deleted
The word "article" implies a longer text with explanation, while a "tip/trick" entry is usually a short description of a solution. Both are available under the same link. This way, the articles all meet certain minimal quality-criteria. A tip/trick would also need some background on why you wrote it, and what problem it solves.
diegosendra wrote: I just re-submitted it and I HOPE it gets published now
I have the right to judge myself if what I write is of any help or not, and not be judged by third parties
After all, I am helping others, not trying to earn a cent from this or anything else
Aah, all registered users have the option to vote on an article, or on tips. If you meet a lot resistance, it might be better to give it a rest for a moment - it's no fun if you get a lot of hard words for one's work. Still, if you ask Sandeep how it should be formatted/worded before it's approved as a "trick" would probably give you a list of tips on the subject.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I have developed an application using DOTNET and Oracle 11g, The application while performing load test it throws an error as seen below
"Message: Exception Message : ORA-12542: TNS:address already in use Exception : at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)at Oracle.DataAccess.Client.OracleConnection.Open()
"
The same code works well in regulat cases and breaks only during load testing when the users are 100+ accessing at the same time..Any suggestions are appreciated.
Thanks & Regards,
John
|
|
|
|
|
I want to add dynamic image button on site without ID of Image button so I am using ASP tag to generate dynamic controls with ParseControl method, It's working but event is not fired when click on Image Button
Default.aspx.cs Code
protected void Page_Load(object sender, EventArgs e)
{
string str = @"<asp:ImageButton runat=server ImageUrl=""~/close-icon (1).png"" OnClick=""click"" />";
Control c = Page.ParseControl(str);
form1.Controls.Add(c);
}
protected void click(object sender, ImageClickEventArgs e)
{
Response.Write("Image Clicl");
}
Default.aspx Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Please help me to solve my problem by giving code in solution.
|
|
|
|
|
you need to add command event handler for this:
try this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class dynamicimage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string str = @"<asp:ImageButton ID=""dynoimage"" ImageUrl=""~/images/about01.jpg"" runat=""server"" oncommand=""clickme"" commandname=""btn"" />";
Control c = ParseControl(str);
form1.Controls.Add(c);
((ImageButton)Page.FindControl("dynoimage")).Command += new CommandEventHandler(clickme);
}
protected void clickme(object sender,CommandEventArgs e)
{
Response.Write("Image clicked");
Label1.Text = "Image clicked";
}
}
and here is the aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dynamicimage.aspx.cs" Inherits="dynamicimage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<p>
<asp:Label ID="Label1" runat="server" Text="before click"></asp:Label>
</p>
</form>
</body>
</html>
|
|
|
|
|
hey Thnx Ashish Raj Srivastava, It's working properly
|
|
|
|
|
Hi,
I am using 51degrees to redirect to mobile but when I go to the home page www.JassimRahma.com[^] it's not redirecting to my mobile page at http://m.JassimRahma.com[^] and I am not getting any error. I tried it using my Samsung S2 and S3 and Opera Emulator.
here is my web.config:
<sectionGroup name="fiftyOne">
<section name="log" type="FiftyOne.Foundation.Mobile.Configuration.LogSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
<section name="redirect" type="FiftyOne.Foundation.Mobile.Configuration.RedirectSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
<section name="detection" type="FiftyOne.Foundation.Mobile.Detection.Configuration.DetectionSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication"/>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Detector.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<fiftyOne>
<redirect firstRequestOnly="false" mobileHomePageUrl="http://m.jassimrahma.com/" timeout="20" devicesFile="~/App_Data/Devices.dat" mobilePagesRegex="mobile">
</redirect>
<log logFile="~/App_Data/Log.txt" logLevel="Info"/>
</fiftyOne>
|
|
|
|
|
I am using this code to determine if the device is mobile:
<asp:TableRow>
<asp:TableCell VerticalAlign="Top">is Mobile</asp:TableCell>
<asp:TableCell VerticalAlign="Top">:</asp:TableCell>
<asp:TableCell VerticalAlign="Top"><% Response.Write(Request.Browser.IsMobileDevice); %></asp:TableCell>
</asp:TableRow>
but I always get IsMobile = False when using my Samsung Galaxy SII or S3!
why is that? can you try it here from mobile and let me know if you'll get IsMobile = True?
|
|
|
|
|
|