|
Considering a DataRow and a Transaction are completely different things, I cant understand what you are asking.
DataRow - represents a row within a DataTable and stores values for each column within that table
Transaction - A way of executing multiple queries against a database and either commiting all changes or rolling back all changes.
|
|
|
|
|
hi J4amieC
Please see My Example that show how to use DataRows for Insert,Update and delete
(in my example 'Insert')
|
|
|
|
|
Please see my description of the difference between a DataRow and a Transaction - they are unrelated in the context of what you are doing.
You are using a DataAdapter which must have a valid Insert/Update/Delete command according to what you are trying to do. In your example code you have not assigned ANY commands to the adapter so I cant tell what you are doing.
Please also remember to post the text of any exceptions you are receiving as it will help solve your problem.
|
|
|
|
|
You have the right idea you are just implementing it wrong.
Look at this code:
case "Microsoft.Jet.OLEDB.4.0":
OleDbConnection OleConn = new OleDbConnection(_ConnString);
OleDbDataAdapter OleAdp = new OleDbDataAdapter(InsertString, OleConn);
OleAdp.InsertCommand = new OleDbCommand(SQL.BuildHourlySQL());
OleAdp.InsertCommand.Parameters.Add("@RecID", OleDbType.Integer, 50, "RecID");
OleAdp.InsertCommand.Parameters.Add("@DSID", OleDbType.Integer, 50, "DSID");
OleAdp.InsertCommand.Parameters.Add("@Month", OleDbType.Integer, 50, "Month");
OleAdp.InsertCommand.Parameters.Add("@Day", OleDbType.Integer, 50, "Day");
OleAdp.InsertCommand.Parameters.Add("@Year", OleDbType.Integer, 50, "Year");
OleAdp.InsertCommand.Parameters.Add("@Hour", OleDbType.Integer, 50, "Hour");
OleAdp.InsertCommand.Parameters.Add("@KW", OleDbType.VarChar, 50, "KW");
OleAdp.InsertCommand.Parameters.Add("@KVAR", OleDbType.VarChar, 50, "KVAR");
OleAdp.InsertCommand.Parameters.Add("@CAP", OleDbType.VarChar, 50, "CAP");
OleAdp.InsertCommand.Connection = OleConn;
OleConn.Open();
OleAdp.Update(_HourlyData);
didUp = true;
OleConn.Close();
return _HourlyData;
break;
In a differnt part of your code this is where you use the Datarow:
DataRow _dr = _HourlyData.NewRow();
_dr["RecID"] = _RTm.RecID;
_dr["DSID"] = _RTm.DataSetID;
_dr["Month"] = _RTm.Month;
_dr["Day"] = _RTm.Day;
_dr["Year"] = _RTm.Year;
_dr["Hour"] = _RTm.Hour;
_dr["KW"] = _HrData.RA_Tot;
_dr["KVAR"] = _HrData.RB_Tot;
_dr["CAP"] = _HrData.RC_Tot;
_HourlyData.Rows.Add(_dr);
Programmer: A biological machine designed to convert caffeine into code. * Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
how to run an *.exe from windows Service. i use System.Digonistics.Process.Start("WindowApp.exe");
the windowApp.exe runs in Window Task Manager in Applcation tab. but do not show in desktop, please help me.
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wli
|
|
|
|
|
Sanjib Raj wrote: the windowApp.exe runs in Window Task Manager in Applcation tab. but do not show in desktop
Windows Services run without a user interface, they start outside the scope of a user session. If you run an application through the service its interface is probably hidden by default. How could it know where to display its interface anyway? There could be no user logged in, there could be multiple users logged in....
|
|
|
|
|
Hi,
I'm starting a new windows forms application in VS2005. The main apparence of the application should be a dialog with a splitContainer where I'd like to fill with a side menu and then, depending on the option selected change the content of the central panel.
how can I load and unload a whole dialog/form in the central panel depending on the option selected?
thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
you can use the user controls and place it inside the central panel
you should define a user control for each button or action that comes from the left or menu panel.
good luck
|
|
|
|
|
Great thanks, but how to load or unload each user control depending on the option selected?
Thansk again,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
|
How to save textbox in table sqlserver2000
روی فرم چطوری میتوانم اطلاعات داخل جعبه متن را با فشار دادن دکمه ذخیره در
اس کیو ال ذخیره کرد
|
|
|
|
|
With a stored procedure that does an insert or update. Don't use inline code to achieve this effect.
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.
|
|
|
|
|
Hello All,
I have problem, That is :
In my project I want to popup window from C# function in ASP.net2 and I want it as modal, so I use javascript function window.open() , But I haven't found how can i call this function from general c# function without using event's of button.
Can any help me, Please.
Ala Qunaibi
|
|
|
|
|
Hello,
You can try to use this:
ClientScript.RegisterClientScriptBlock(ClientScript.GetType(), "Focus", "" + "window.open('ImprimirGSA.aspx','frmImprimirGSA','width=650,height=500');" +
"");
The first parameter is the type, the second is a key to identify it and the thirst is the script.
|
|
|
|
|
Thanks.
|
|
|
|
|
i have declared a public propery like below in form1
public partial class Form1 : Form
{
string st;
public string s
{
get
{
return st;
}
}
private void Form1_Load(object sender, EventArgs e)
{
st = "MY PROPERTY";
}
}
and i tried to display this value in form2
using the statements
Form1 f = new Form1();
MessageBox.Show(f.s);
its not giving any errors but displaying nothing in messagebox
but if i initialize the st at the declatation instead of form1_load its displaying correct value
ex: public string st="MT PROPERTY";
please tell me why thats happening and how can i resolve this.
|
|
|
|
|
instead of initializing st in Form_Load ,initialize it in the constructor.
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
but if i need to assign that value after occurrance of some event then how could i get the content?
|
|
|
|
|
If you want to access a value that is present in the current instance of the form, you need a reference to that instance. If you create a new instance of the form, you will always get the same value, as it's a newly created and unused form.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
kalaveer wrote: private void Form1_Load(object sender, EventArgs e)
{
st = "MY PROPERTY";
}
kalaveer wrote:
Form1 f = new Form1();
MessageBox.Show(f.s);
You have initialised your variable when the Form Loads (Form_LOad event). This event is fired when the form is loaded (ie. displayed). As you have not shown your form your property has not been set
Form1 f = new Form1();<br />
f.Show();
MessageBox.Show(f.s);
|
|
|
|
|
Wow thats working but it displaying the form again how can i avoid this.
my first form already visible and with f.show() its displayed again i tried to make invisible but by setting visible property to false not working as f.show is just opposite of hiding na
please suggest
|
|
|
|
|
kalaveer wrote: Wow thats working but it displaying the form again how can i avoid this.
As I already explained, you need a reference to the existing form, not creating a new one.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
In your example, the Form_Load event has not been fired. You need to set the value in the constructor based on your logic.
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.
|
|
|
|
|
Error while trying to running project: Unable to start debugging on the web server. you don not have permissions to debug the server.
verify that you are the member of the 'Debugger User' Groups on the webserver.
this is haneef
|
|
|
|
|
you have to be an administrator and/or add ur user name to the debugger users group,then only u can debug
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|