|
hi,
In my appication i'm using Oracle as a back end. In that when i'm using ExecuteReader() it shows an exception. Can any one of help me to solve this issue.
<br />
oleDBConnection = new OleDbConnection(connectString); <br />
string query = "SELECT V_FIRST_NAME,V_LAST_NAME,V_PHONE_NUMBER,V_EMAIL,V_FAX_NUMBER,V_ADDRESS,V_TITLE,V_POSTAL_CODE,V_COUNTRY from UserDetails where (V_USER_ID = ?) AND (V_PASSWORD = ?)";<br />
<br />
OleDbCommand oledbCmd = new OleDbCommand(query, oleDBConnection);<br />
oledbCmd.CommandText = query;<br />
<br />
oledbCmd.CommandType = CommandType.Text;<br />
<br />
OleDbParameter par = oledbCmd.Parameters.Add("UserName", OleDbType.VarWChar, 50);<br />
OleDbParameter parm = oledbCmd.Parameters.Add("password", OleDbType.VarWChar, 50);<br />
<br />
oledbCmd.Parameters["UserName"].Value = userName;<br />
oledbCmd.Parameters["password"].Value = password;<br />
<br />
oledbCmd.Connection = oleDBConnection;<br />
<br />
oleDBConnection.Open();<br />
<br />
OleDbDataReader dr ;<br />
dr = oledbCmd.ExecuteReader();<br />
It threw an exception when executing the last line. The exception states that Unspecified error.Oracle error occured,but error message could not retrieved from Oracle.Data Type is not supported.
|
|
|
|
|
That i know But i have to move to next page grid and retrieve the records and assign it to the data table.How should i?
my UpdateCustomerDetails method is as below
private void UpdateCustomersDetails()
{
Customers oCustomers = Customers.GetCurrentSingleton();
int iRowCount = oCustomers.CustomersList.Rows.Count;
for (int iRowIndex = 0; iRowIndex < iRowCount; iRowIndex++)
{
TextBox oTextBoxCustomerName = (TextBox)GridViewCustomers.Rows[iRowIndex].FindControl("TextBoxCustomerName");
oCustomers.CustomersList.Rows[iRowIndex]["cCustomerName"] = oTextBoxCustomerName.Text;
TextBox oTextBoxEmailID = (TextBox)GridViewCustomers.Rows[iRowIndex].FindControl("TextBoxEmailID");
oCustomers.CustomersList.Rows[iRowIndex]["cEmailID"] = oTextBoxEmailID.Text;
RadioButton oRadioButtonActive = (RadioButton)GridViewCustomers.Rows[iRowIndex].FindControl("RadioButtonActive");
RadioButton oRadioButtonInActive = (RadioButton)GridViewCustomers.Rows[iRowIndex].FindControl("RadioButtonInActive");
if (oRadioButtonActive.Checked == true)
{
oCustomers.CustomersList.Rows[iRowIndex]["bIsActive"] = true;
}
else if (oRadioButtonInActive.Checked == true)
{
oCustomers.CustomersList.Rows[iRowIndex]["bIsActive"] = false;
}
oCustomers.CustomersList.AcceptChanges();
}
-- modified at 7:40 Wednesday 31st October, 2007
kavitha
|
|
|
|
|
Hi All,
I want to read Excel file and show records into the Grid.
for that i have written vb.net code,this code is successfully running as follows:
DataGrid1.DataSource =
Excel.GetWorkSheetByName(Excel.ExcelWorkSheets.Item(0).TableName);
DataGrid1.DataBind();
while writting same code in c# as follows:
DataGrid1.DataSource =
Excel.GetWorkSheetByName(Excel.ExcelWorkSheets.Item[0].TableName);
DataGrid1.DataBind();
it gives an error message as follows:
Cannot apply indexing with [] to an expression of type 'WorkSheet'
Please Help.
Thanks in advance.
Tejesh Kamble.
|
|
|
|
|
hi
i m not getting what's the error ...
but u try like this
string strcon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\jintal\\test\\test.xls; Extended Properties=Excel 8.0;";
OleDbConnection con = new OleDbConnection(strcon);
OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connection);
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet, "Sheet1$");
GridView1.DataSource = myDataSet.Tables["Sheet1$"].DefaultView;
GridView1.DataBind();
-- modified at 8:15 Wednesday 31st October, 2007
Jintal Patel
|
|
|
|
|
Thanks for ur reply.
I will try this.
Tejesh Kamble.
Software Engineer.
|
|
|
|
|
With the Index I m finding control so wen it reaches 5th record it searches for 6th then says out of range error because pagesize is 5
-- modified at 7:22 Wednesday 31st October, 2007
kavitha
|
|
|
|
|
Because here gridview's datasource contains only 5th records.
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
I m very clear i know that only 5 rows are ther in the grid .but i need all the records from the grid
kavitha
|
|
|
|
|
Thavika wrote: 5 rows are ther in the grid .but i need all the records from the grid
please don't forget to vote on the post that helped you.
|
|
|
|
|
Dear All,
I have a web application (ASP.NET / framework 2.0 / Windows Server 2003) on one machine, i.e. Web Server and corresponding database (SQL Server 2005) on second machine.
If I access the application from Web Server, it works fine, but when I access from a third client machine it gives following error
-------------------------------------------------------
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
-------------------------------------------------------
I think this has some thing to do with the permissions to access DB from client machines
my Web.config file has following things added
---------------------------------------------------------
<add name="ConnString" connectionString="workstation id=MY_WORKSTATION;packet size=4096; integrated security=SSPI;data source=MY_DB; persist security info=False;initial catalog=MY_CATALOG"/>
<system.web>
.....
<identity impersonate="true"/>
.....
</system.web>
---------------------------------------------------------
Moreover, the SQL Server is configured as per following link
"http://support.microsoft.com/kb/914277"
Please guide
Regards
Sachin
|
|
|
|
|
How to close a frame from either javascript or from code behind in a page? Suppose if in a page two frames are present and in one frame an aspx page is present...in onClick of a button in the aspx page the other frame should be closed and the aspx page should occupy the whole window ...is there any way to do this?
Koushik
|
|
|
|
|
I guess you can't close a frame. You can redirect to other page which don't have any frames.
|
|
|
|
|
code for get HTML Source from input URL
using System.Web.Caching;
using System.Net;
using System.IO;
string URL = TextBox1.Text;//INPUT URL
if (URL.Substring(0, 7) != "http://")//CHECK URL CONTAIN http://
{
URL = "http://"+TextBox1.Text;
}
string ConvertURL =(string)Cache.Get(URL);
if (ConvertURL == null)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(new Uri(URL));
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
StreamReader srdr = new StreamReader(res.GetResponseStream());
ConvertURL = srdr.ReadToEnd();
}
Response.Write(ConvertURL);
Raju.M
http://aspdotnetprogrammer.blogspot.com/
|
|
|
|
|
makhaai wrote: URL = "http://"+TextBox1.Text;
Why reading it from the text box again? Just do:
URL = "http://" + URL;
makhaai wrote: string ConvertURL =(string)Cache.Get(URL);
Why do you look in the cache for the source? Do you have any code elsewhere that stores anything in the cache?
You forgot to dispose the HttpWebResponse and the StreamReader.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
He was not asking a question, it seems like he is advertising this[^]
|
|
|
|
|
N a v a n e e t h wrote: He was not asking a question
Yeah, I didn't see any question, but he got an answer anyway.
N a v a n e e t h wrote: it seems like he is advertising this[^]
Seems you can take any crappy code and make a blog out of it...
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
makhaai wrote: please tell wat is the prob in my code?
I just did.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
i have a jaascript function. and a gridview , which contains a button.My problem is , how i should add the attributtes of that utton.i am doing it in the following manner.
on form load i am extracting the id of button (whichh is in gridview).
Button l = (Button)GridView1.FindControl("p");
l.Attributes.Add("onClick", "javascript:return abc();");
and in java script i am extracting the button id in the following manner.
function abc()
{
var a = document.getElementById("<%=GridView1.subassembly.ClientID%>");
alert(a);
}
after doing this , i am gettng an error, does not contain the definition for
subassembly.
Where is the problem lying?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: i am gettng an error, does not contain the definition for
subassembly.
From this you got the error. What's the problem now ?
Sonia Gupta wrote: var a = document.getElementById("<%=GridView1.subassembly.ClientID%>");
What is the use of getting Gridview's client id here ? Controls inside gridview will be having different id.
|
|
|
|
|
U have place button inside a gridview of row. If yes use this code in rowDataBound Ok.
Button btn=(Button)e.Row.FindControl("buttonID");
btn.Attributes.Add("onclick","javascript:abc('"+btn.ClientID+"')");
It will work.
Devjit Das.
|
|
|
|
|
actually , i have textbox also, and after leaving the textbox blank , i want a messagebox.
that's y i am writig the code in the source file.
and i am using this tag var a = document.getElementById("<%=GridView1.subassembly.ClientID%>");
in java script because the page is of master type, i mean the html is under content place holder tag.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
what ever u want to do do.
just use like this of script function.
function abc(id)
{
var a = document.getElementById(id);
alert(a);
}
Devjit Das
|
|
|
|
|
what happen have u done.
Devjit Das.
|
|
|
|
|
how should i access the button id which is placed in the template column of gridview.and i want to wite the funciton in javascript at source file.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
what is this i have all ready given the code. just once again.
In grid use this event.
grid_RowDataBound
Button btn = (Button)e.Row.FindControl("buttonID");
btn.Attributes.Add("onclick", "javascript:abc(" + btn.ClientID + ")");
Note buttonID means the id u have provide in grid template ok.
javascript function
function abc(id)
{
document.getElementById(id);
alert("Plz enter value");
}
It will work . ok
Devjit Das
|
|
|
|