|
Sorry, but i cant imagine what is the error.
You can create a very simple project, fill all data to the DataTable, change one record and
make the Update to the DB ...
On a very small project you don't have a huge number of possibilities where the error can be hidden
|
|
|
|
|
That's the problem, I don't receive an error, it does through as if everything was 100, but thanks for all your help, really appreciated.
He who laughs last is a bit on the slow side
|
|
|
|
|
After the Update you need to update the dataSet to reflect changes. To do this add the following after you update the dataAdapter:
dataSet.AcceptChanges();
Hope this helps.
Mike
Started out with nothing and still have most of it left!
|
|
|
|
|
Added that line
private void productsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.productsBindingSource.EndEdit();
this.productsTableAdapter.Update(this.productsDataSet.Products);
this.productsDataSet.AcceptChanges();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
}
}
But still no effect on the database, the dataset gets updated but not the database
He who laughs last is a bit on the slow side
|
|
|
|
|
Hmmm
The only other thing I can think of is that the EndEdit is used in wrong context...see code snippet below.
//If current item is not new and not cloned
if (!obj.IsNew && !obj.IsCloned)
{
drv = dvItem[index];
drv.BeginEdit();
}
else
drv = dvItem.AddNew();
//Transfer Shape data to DataView
obj.ObjectToDRV(drv, id);
drv.EndEdit();
daShape.Update(dsShapeEd1);
dsShapeEd1.AcceptChanges();
You'll notice that I only use the EndEdit if the object is being updated and not new!
Hope this helps.
Mike
Started out with nothing and still have most of it left!
|
|
|
|
|
It is as if the data adapter doesn't commit the changes to the database and then performs a roll back, but I can't figure out how to commit it to the database
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi Friends,
I think this is my third post but still I couldn't get required reply. Hope to get this time.
I am developing a website to watch online movies. User needs to call a number to view movie (A company provide service to check whether user is connected to line or not They will call a script that will save or delete record in the database when user connects or disconnects phone line).
The only think which I need is that I need to run a script that checks database after every 5 or 10 seconds whether user record exists or not. I know it is possible to 'Refresh' page after certain time but my client doesn't want to do like this. I am using c# and Access database for this. I am struggling in it so waiting desperately for your reply.
Regards,
Abubakar Malik
|
|
|
|
|
Abubakar - I already posted how to do this here. Clickety[^] I showed you the javascript there, and explained what else you would need to do, i.e. use Ajax, so why have you posted a question about this again? If you needed more information, you should have replied to that post and not started another one off.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all,
how to make a custom control in a desktop application using c#
which i need to prevent a user from writting integers in a textbox
thanx
|
|
|
|
|
1. Add a "Key Press" event for the text box.
2. And add the below code in the Key press function
if(!char.IsLetter(e.KeyChar))
{
e.Handled = true;
}
This solution ll help you not to enter any integers in the text box.
Thanks & Rgds,
Sri..
|
|
|
|
|
Thanx alot
this code helped me very much
thnax again
|
|
|
|
|
I have a UserControl that contains a collection of custom controls that inherit from Panel. I have configured an ActionItem to display the collections dropdown list (which opens the collection editor when clicked). I also have an ActionItem (property) which displays the current count of the collection. Everything works OK and I can Add and Remove items using the collection editor and the count field gets updated. However, when I create a designer for the child control, which inherits from ParentControl designer you get this stange problem. Adding controls using the SmartPanel option updates the count OK. Removing controls the first time updates the count OK. After that the SmartPanel will refuse to refresh. Calling the DesignerActionUIService.Refresh() method has no effect....I am stumped! If I change the designer to inhertit from ControlDesigner instead of PareControlDesigner it works fine but I need to be able to add controls at design time....help anyone?
Alans
|
|
|
|
|
There have two form which is form1 and form2.
In form1 user have to keyin the right password which we give them. If user keyin in teh textbox the password and click (OK button).If the password is same with the password we set.They can link to other form.
FOR FORM1:
private void textBox1_TextChanged(object sender,EventArgse)
{
// The password character is an asterisk.
textBox1.PasswordChar ='*';
// The control will allow no more than 4 characters.
textBox1.MaxLength = 4;
//
}
private void button1_Click(object sender, EventArgs e)
{
Form Other = new Form2();
Other.show();
}
*****What should I add in this two object so that:
1: In textbox keep user input
2: Verify in OK button object with our password to log in to form2.
TQ VERY MUCH.....
Email: krajah20@yahoo.com
|
|
|
|
|
I assume the following.
You want the user the enter the password in one form.
If the password, matches with some default/inbuilt/from the database password,
then it should go to the second form.
I also assume that you have a default password stored for comparison.
We'll Here it is.
You have to validate the password in the same form.
Form1 fm1 = new Form1();
Form2 fm2 = new Form2();
string DefaultPassword = "pass";
string PasswordCharacter = textBox1.Text;
if (PasswordCharacter==DefaultPassword)
{
fm2.Show();
fm1.Hide();
}
I hope this helps.
Keshav Kamat
India
|
|
|
|
|
Just put a check to validate the user entered password with the default password. If both are same, the show the form2. Thats it..
public partial class Form1 : Form
{
Form2 form2 = new Form2();
public Form1()
{
InitializeComponent();
Password.PasswordChar = '*'; //Masking Char
}
private void Form1_Ok_Click(object sender, EventArgs e)
{
string strDefaultPassword = "ABCD"; //Keep ur default passowrd
string strEnteredPassword = Password.Text;
if(strEnteredPassword == strDefaultPassword )
{
this.hide();
form2.ShowDialog();
}
else
{
MessageBox.Show("Wrong password entered");
this.Close();
}
}
}
Thanks & Rgds,
Sri..
|
|
|
|
|
How can I add an option to the r-click menu from Windows Explorer ? Can someone help me with some info or a source-code ?
|
|
|
|
|
Search the artciles for the term "shell extension" and you should find some useful information.
"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
|
|
|
|
|
Hi,
How to get a certain project/files based on the labels using SourceSafe SDK, I use Get method of IVSSItem to get the latest version of a project/file, but don't know how to use it for getting certain project/file on the basis of label, does any one know about that.
Warm Regards,
Mushq
|
|
|
|
|
Hi
I have a DataGridview control. I want that, when user enters in NewRow I fill some cells with default values and Focus on costum cell. But i got an Error :
(Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.)
And my code :
<br />
private void dGridViewWork_RowEnter(object sender, DataGridViewCellEventArgs e)<br />
{<br />
if (e.RowIndex == dGridViewWork.Rows.Count-1)<br />
{<br />
dGridView.Rows[e.RowIndex].Cells[0].Value = "1001";<br />
dGridView.Rows[e.RowIndex].Cells[4].Value = true;<br />
dGridView.CurrentCell = dGridViewWork[1, e.RowIndex];
dGridView.BeginEdit(true);<br />
}<br />
}
An error refers to the line that Focuses on Cell[1,x].
Can you help me? Tanx.
|
|
|
|
|
I did not get what you meant by that exactly.
Still assuming that you are trying to access the row 1.
By default you can access only the 1st (0th row).
i u want to access, you need to add more rows.
else you will get error when you refer to the first row, or any cell from that row, i.e. Cell[1,x].
Still please tell me more about it.
Keshav Kamat
India
|
|
|
|
|
Hi and Tanx
Dear friend Cell[1,x] means Cell[ColumnIndex,RowIndex]. I know it's funny but when we want to set CurrentCell we first type columnindex.
For example imagine we are at Row number 6 (Last Row) and user press Enter key. DataGridView create new blank row, Now i want to set First Cell's value to 7 programmatically and automatically move cursor to Second cell, then goto input mode . But there is an Error in focussing to second cell in 'RowEnter Event'.
Please Help.
|
|
|
|
|
I am workin on Crystal Reports for VS2005
1>Can i create alerts in it,if yes how?
2>How can i read values that are assigned to formula fields in the application code?
Regards
Shaurya
|
|
|
|
|
Finally i found the solution to my problem so i am sharing the solution here.
The values that are printed on the report can be accessed from the code by this code.
CrystalDecisions.CrystalReports.Engine.ReportDocument a = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
str value=a.Rows[0][20].ToString();
The Rows property contains the data on the front page of the report.
|
|
|
|
|
Is it possible to convert a .mdb (MS Access) file to a binary file? I tried to find a solution/converter for it but was not able to do it.
Anybody got any idea?
|
|
|
|
|
LuckySmoke wrote: Is it possible to convert a .mdb (MS Access) file to a binary file?
Yes.
LuckySmoke wrote: I tried to find a solution/converter for it but was not able to do it.
You didn't say what sort of binary file. Keep in mind that an mdb file is a type of binary file too.
|
|
|
|