|
Blumen
The issue relates to the underlying data being changed as you iterate through the datareader. This normally occurs when somebody else changes a record that you are interested in. If you don't have your transaction isolation level set accordingly (take a look in the Oracle docs for this), you can get issues.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete, I think this is the reason why the guys here use Adapter to fill a DataTa
ble and then make a collection.
Have to investigate more.. Is there anyway I can contact u, any e-mail ids or chat ids, if you don't mind?
Blumen
blumenhause@yahoo.com
|
|
|
|
|
Guys,
I have a weird problem.
1.
We have a windows service running on the computer.
This service actually manages services that are related to our core application (We can call up a gui and add new services into this one).
2.
In order to customize our core application we can interact with it via a tlb file.
So I've written a little application that can interact with our core application (press buttons, select items, read/write from/to fields,...)
To do this I have a wrapper dll that calls CreateObject to create the object.
I built in a check to make sure the core application is running, because else it would be started. (We don't want to start it that way)
All works fine until I add my custom application to this service manager. It passes the check that our application is running, but will still fire up a new instance of our core application.
Apparently he can't attach to the existing application or something?
Why is this happening? What's the cause?
Is there a way around this?
I hope my explanation was clear, thanks in advance for your help !
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
hello all,
I am trying to save of importing a dataView to Excel file. dose anybody now how?
discription:
first I did a select to an Excel file and then I made a DataView of those selected rows and now I want to save that DataView as a Exel file.
-- modified at 8:29 Thursday 18th January, 2007
|
|
|
|
|
Hi
This is the code to Export data to excel file from table in vb.net
Public Sub XportToXcel(ByVal dt As DataTable)
Try
Dim XApp As New Excel.Application
Dim XBook As Excel.Workbook = XApp.Workbooks.Add
Dim XSheet As Excel.Worksheet = CType(XBook.Worksheets(1), Excel.Worksheet)
XApp.Visible = False
With XSheet
Dim c As Long = Asc("A")
For Each dc As DataColumn In dt.Columns
.Cells(1, c).Value = dc.ColumnName.ToString
.Cells(1, c).Font.Bold = True
c += 1
Next
Dim i As Long = 2
For Each dr As DataRow In dt.Rows
c = Asc("A")
For Each dc As DataColumn In dt.Columns
.Cells(i, i - 1).Value = dr.Item(dc.ColumnName)
c += 1
Next
i += 1
Next
XApp.Visible = True
End With
Catch ex As Exception
MessageBox.Show("Source [" & ex.Source & "] Description [" & ex.Message & "]")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
XportToXcel(DataGrid1.DataSource)
I hope this will idea for u r problem
Have a Nice day
|
|
|
|
|
Hi All,
I am using HttpWebRequest and HttpWebResponse object to upload a file over HTTPS Channel.
My code works fine when I upload a small size file (Less than 2K). When I try to upload a bigger file, HttpWebRequest is Timing Out.(The operation has timed-out.)
Here is the snippet of the code I am using
HttpWebResponse Resp = (HttpWebResponse) Req.GetResponse(); Stream responseStream = Resp.GetResponseStream(); Encoding enc = Encoding.GetEncoding(1252); // Windows default Code Page
StreamReader loResponseStream = new StreamReader(responseStream,enc);
string stringResponse = loResponseStream.ReadToEnd();
LogFileStream.WriteLine("Http Response: " + Resp.StatusCode + " " + DateTime.Now.ToString().Trim()+"\n");
responseStream.Close();
oResponseStream.Close();
Does any body having clue what to do in such kind of scenario??
Thanks in advance.
Satya
Satya
|
|
|
|
|
I am using a calendar control in my application(Visual Studio 2005, C# .NET 2.0). As per the control, clicking on the calendar textbox, a calendar should popup just below the textbox. I am facing two problems with the control. First problem is, when I am clicking on the text box(calendar control) the calendar is popping up but it is displaying under the other controls below. Second problem is, if I am using more than one date control in the same page, one of the calendar is getting displayed in top left corner of the page permanently. The calendar control is inside a "div" tag. Is this the problem?
|
|
|
|
|
Using Globalisation for ASP.Net Can a Web appplication can take the user input in different laguages. Like for example my culture is fr-Fr french then Can a user enter the data in french in the textbox control.
sj
|
|
|
|
|
UICulture has no connection with the language the user can use for entering data. The user can even enter data in Chinese. UICulture is used to display the correct date format etc on a website.
|
|
|
|
|
hello all
i'm working with panels.
i've added some textboxes and labels on panels. there are multiple panels on one form.when i hide a panel i want to hide all controls on that panelm too
how do i do this??/
plz reply
Saira
|
|
|
|
|
If you hide a panel, it should hide all the controls as well. If this is a web app, a PlaceHolder is the best way to group things so they all show and hide together.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
If you set panel.Visible = false, then all controls in that panel will be invisible too.
|
|
|
|
|
i'm using the visible poperty to hide the panel but it doesn't hide the controls on the panel.
is there any other way other than through the visible property.
|
|
|
|
|
Hi, Everyone
I have bound dataGrid1 with using dataset1.
kindly help me about mentioned two problems:
1) when I click on any cell. it is already set with edit mode. How may I turn off edit mode?
2) When I bind dataGrid1 with dataset1, after loading project i have to collap it manualy. Why does it not collap automatic?
please give solutions about said problems.
thank you
My source code
==============
namespace WindowsApplication1
{
public partial class Form1 : Form
{
private DataTable dataTable1;
private OleDbConnection oConnOLEDB = new OleDbConnection();
private OleDbDataAdapter oAdapter1 = new OleDbDataAdapter();
private OleDbDataAdapter oledbSelectCMD = new OleDbDataAdapter();
private DataSet dataset1 = new DataSet();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
oConnOLEDB.ConnectionString = "Provider=MSDAORA.1;Data Source=ORVB;Persist Security Info=True;User ID=RIAZ;Password=SMS";
oConnOLEDB.Open();
}
catch (OleDbException ex)
{
MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button1_Click(object sender, EventArgs e)
{
String strSQLCommand = null;
strSQLCommand = "SELECT * FROM ADMIN.SCHEDULE ORDER BY TDATE DESC";
dataset1.Clear();
oAdapter1 = new OleDbDataAdapter(strSQLCommand, oConnOLEDB);
oAdapter1.Fill(dataset1, "SCHEDULE");
dataGrid1.SetDataBinding(dataset1, null);
}
}
}
|
|
|
|
|
1) Make your datagrid readonly
2) Use DataSet.Tables[0].DefaultView.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
dear all,
i have created an arrylist in one class i add object to it from the same class.
how can i remove object from the same arraylist from another class if u have any piece of code please do provide me.
thanx alot
flavour of life
|
|
|
|
|
You probalby need to post some code. The best way to do this is to have the class that exposes the arraylist to expose methods to add and remove items. Or use delegates to send a message to the class in question.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You must have a reference to arrayList in Class1 in Class2.
Sample:
using System;
using System.Collections;
class Program
{
static void Main(string[] args)
{
MyClass1 myClass1 = new MyClass1();
myClass1.AddABC();
MyClass2 myClass2 = new MyClass2(myClass1.MyArrayList);
myClass2.RemoveABC();
}
}
public class MyClass1
{
private ArrayList arrayList = null;
public MyClass1()
{
this.arrayList = new ArrayList();
}
public void AddABC()
{
this.arrayList.Add("ABC");
}
public ArrayList MyArrayList
{
get { return this.arrayList; }
}
}
public class MyClass2
{
private ArrayList arrayList = null;
public MyClass2(ArrayList arrayList)
{
this.arrayList = arrayList;
}
public void RemoveABC()
{
this.arrayList.Remove("ABC");
}
}
|
|
|
|
|
Hi
The simplest way is declare the ArrayList as public static and access directly through the class name.
Chandru
|
|
|
|
|
ChandruIT wrote: The simplest way is declare the ArrayList as public static
I suggest you look up the term "encapsulation"
|
|
|
|
|
I want to create a directory using post build event at a specified path before copying my files into that directory. presently, i am facing a problem of post build error, if directory does not exist. I want to provide a command in post build to create directory first then it should copy.
Thanks in advance
Praveen Raghuvanshi
Software Engineer,
India.
|
|
|
|
|
MKDIR [path] will create a directory with the specified path.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
How can I remove a method from System.Collections.CollectionBase?
Say, I have a class:
public class MyList : System.Collections.CollectionBase{}
I have all the members of the collection base such as Add(object), Remove(object), RemoveAt(index), etc...
I want to get rid of RemoveAt() and Insert() methods..
Do you have a solution?
Thanks in advance..
Radgar
|
|
|
|
|
You can't remove methods that you inherit.
You can override them with methods that throws InvalidOperationException, or you can encapsulate the collection in a class that only exposes the methods that you want.
---
Year happy = new Year(2007);
|
|
|
|
|
You have a couple of options:
1. Do not derive from CollectionBase and instead implement ICollection and/or IList directly. This will allow you to either not include undesirable insertion/removal methods or, where those methods are required by the collection interfaces, to throw a NotImplementedException.
2. Derive from CollectionBase but override the protected OnInsert() and OnRemove() methods and throw a NotImplementedException. (You have to be careful with OnInsert(), though, as that will also get called for Add(), which you *do* want to allow.)
-Phil
|
|
|
|