|
Oh it defaults to internal ... wow, I learn something new every day
I always explicitly put in my access modifiers anyway so I guess thats why I've not come across this before.
|
|
|
|
|
you probably have the Interface defined as private and the indexer defined public.
Make sure the Interface definition explicitly includes the access modifier public as by default they are private
-- modified at 11:57 Tuesday 31st July, 2007
|
|
|
|
|
Primary key for the table is (Name, Data).
How to show data like this:
Name1.....Name4
------.....------
Data11....Date41
Data12
Name2
------
Data21
Data22
Data23
Name3
------
Data31
...
|
|
|
|
|
I'm not sure exactly what you're trying to do. If you only have two columns (Name, Data), you cannot return separate columns for each row. I would return the data you need and then any really fancy formatting would need to be done on the UI. Give some more info and perhaps I can help you some more. Thank you.
|
|
|
|
|
Thanks for your answer.
I must to show telephone numbers of clients in this way.
Certainly, they may to have more phones and each of them must be visible.
It is all dispose in more columns, that economically use working surface.
|
|
|
|
|
I am using DB2 and C# to develop a web app.I got a problem in adding a new row.My table has Time field in DB2 which is in hh.mm.ss format.In Dot net the equivalent format is hh:mm:ss.My problem is how can I convert the hh:mm:ss(in .NET) to hh.mm.ss in DB2?
I need urgent help
kidus
|
|
|
|
|
Hey all,
I hope that there is someone out there that can work out what is going on with my application!
I am a n00b trying to use ODBC drivers to update a remote MySQL database, and as such i have been trying to piece code i have found on the internet to get it working. I am able to connect to it fine and even display the contents of any table in a data grid. However, I am unable to get the program to update the database when i make changes inside the datagrid.
I could be completely n00bing out, but i jsut cannot seem to get this to work. The code below is a program i wrote which simply replicates the part of my main application which displays the table name "Paterson" on the MySQL database in a data grid and when the 'btnUpdate' button is pressed, this MySQL table is/should be updated by the contents in the datagrid.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Data.Odbc;<br />
<br />
<br />
<br />
namespace CannotUpdateTables<br />
{<br />
<br />
<br />
public partial class Form1 : Form<br />
{<br />
<br />
private System.Data.Odbc.OdbcConnection OdbcCon;<br />
<br />
private System.Data.Odbc.OdbcDataAdapter DataAdapter;<br />
private DataSet DataSET;<br />
<br />
private string ConStr;<br />
<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
<br />
ConStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" + txtIP.Text + ";PORT=" + txtPort.Text + ";DATABASE=" + txtDatabase.Text + ";UID=" + txtUsername.Text + ";PWD=" + txtPassword.Text + ";OPTION=3";<br />
<br />
OdbcCon = new System.Data.Odbc.OdbcConnection(ConStr);<br />
<br />
try<br />
{<br />
txtLog.AppendText("Openning connection...\r\n");<br />
if (OdbcCon.State == ConnectionState.Closed)<br />
{<br />
OdbcCon.Open();<br />
}<br />
txtLog.AppendText("Connection opened\r\n");<br />
<br />
<br />
<br />
DataAdapter = new System.Data.Odbc.OdbcDataAdapter("SELECT * FROM Paterson", OdbcCon);<br />
<br />
<br />
DataSET = new DataSet("TableData");
<br />
<br />
DataAdapter.Fill(DataSET);
<br />
<br />
dataGrid.DataSource = DataSET.DefaultViewManager;<br />
<br />
<br />
}<br />
<br />
<br />
catch (System.Data.Odbc.OdbcException Ex)<br />
{<br />
txtLog.AppendText(Ex.Message + "\r\n");<br />
MessageBox.Show("Could not access the database and Display Table.\r\nPlease make sure you completed the fields with the correct information and try again.\r\n\r\nMore details:\r\n" + Ex.Message, "Database connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
<br />
private void btnUpdate_Click(object sender, EventArgs e)<br />
{<br />
try<br />
{<br />
<br />
DataAdapter.TableMappings.Add("Paterson", "TableData");<br />
DataAdapter.Update(DataSET, "Paterson");<br />
DataAdapter.TableMappings.RemoveAt("Paterson");<br />
<br />
txtLog.AppendText("Table Paterson successfully Updated\r\n");<br />
}<br />
catch<br />
{<br />
txtLog.AppendText("Table Unable to Update\r\n");<br />
}<br />
}<br />
<br />
}<br />
}
As the code is displayed below i am told that the table is updated fine. However, the table is not updated. I know these lines must be wrong as if i change "Paterson" or "TableData" in them the middle line DataAdapter.Update(DataSET, "Paterson"); gives exceptions (either about incorrect table mapping or simply that it cannot find the TableSet[Paterson] or whatever.
THIS WAY GIVES NO RESPONSE
DataAdapter.TableMappings.Add("Paterson", "TableData");<br />
DataAdapter.Update(DataSET, "Paterson");<br />
DataAdapter.TableMappings.RemoveAt("Paterson");<br />
I have been pulling ym hair out for two days as it jsut doesnt update the table on the MySQL database.
If i anyone can help me i will be forever in your debt. I am an obdc n00b and am probably just missing something out!
Many Thanks
Alex
-- modified at 9:48 Tuesday 31st July, 2007
|
|
|
|
|
][cecu3e wrote: I hope that there is someone out there that can work out what is going on with my application!
I found what is wrong
][cecu3e wrote: I am a n00b trying to use ODBC drivers to update a remote MySQL database, and as such i have been trying to piece code i have found on the internet to get it working.
That's wrong on so many levels
|
|
|
|
|
lmao, yeh i probably sound like the dumbest man alive, its all been going well until this.. ive almost no experience with this so my descriptive terminoligy is probably way off. im just tryin to get that update command to work....
lol, also when i say im jsut piecing other peoples code together im not doing it in a literal sense, im using other FAQs to write this, attempting to understand this odbc connection stuff
soz..can u shed any light?
|
|
|
|
|
Try:
DataSET.AcceptChanges();
Also, "Bob" is a much nicer name for a database table; surnames are reserved for school and the military
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
hehe, true and thnx for the reply, unfortunatly it doesnt make the table update
i ammended the code to (i have placed it after the mapping too, jsut in case..):
lol, also changed the table name to test!
DataSET.AcceptChanges();<br />
DataAdapter.TableMappings.Add("TableData", "Test");<br />
DataAdapter.Update(DataSET, "TableData");<br />
DataAdapter.TableMappings.RemoveAt("TableData");
But it still doesnt update the mysql table
im am very confused, i think maybe my DataAdapter.Update() line may be wrong
many thanx again, i think i need your added line aswell as the code fix!
Can anyone help, im going insane with this one :P
-- modified at 12:20 Tuesday 31st July, 2007
|
|
|
|
|
Does anyone knows the simple yet powerful algorithm in solving Systems of linear equations?
Thanks!!
|
|
|
|
|
that is "LU decomposition" well known to Google and the rest of the world.
|
|
|
|
|
How can i expose the public enum created in c# form to the vb6 application?
-Amit
|
|
|
|
|
I don't believe you can expose the C# form to the v6 application, but you can expose that enum to a vb6 by creating a dll and adding a reference to it.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
There is a new toolkit from Microsoft for exposing .NET UI stuff to VB6 apps, but I can't remember what it is called.
|
|
|
|
|
I'm trying to write an application that will allow an external device to be synchronized with a PowerPoint presentation. So I wrote a very simple Windows Forms application that will load a PowerPoint presentation and get a list of the slides. It then allows the user to hook each slide to an event on the external device with the objective being that when that slide appears, the external device should do a certain action. I'm using the office XP primary interop assemblies from Microsoft and all of this works fine up to this point.
Now I have a button that starts the actual presentation. My program will handle the SlideShowNextSlide, SlideShowEnd and PresentationClose events (from PowerPoint) and everything works great. My handler is triggered when the slide changes and based on which slide is displayed, it makes the external device do something.
The problem occurs after the presentation ends and I then try and restart it. At this point when I get to the SlideShowSettings.Run() method I get a COMException with the message "Presentation (unknown member) : Object does not exist."
Does anybody have any idea what the problem here might be? I'm assuming that something needs to be cleaned up on exit, but I've closed the presentation with the Close() method and even tried reinitializing a whole new PowerPoint.Application and PowerPoint.Presentation, but it just doesn't work.
|
|
|
|
|
Hi,
I never do these things, but IIRC I read something like that on CodeProject
a couple of months ago.
I think this has been a bug, and some patch exists to solve it.
So I suggest you search CP for it (using the looking glass), or else just Google it.
|
|
|
|
|
Thanks but I've struck out on Google. I'm getting nothing.
|
|
|
|
|
Hi:
i am creating controls on a webpage dynamically and then want to get all page controls using "page.controls.count" but it is not getting page controls
anybody have any idea??
thanx
|
|
|
|
|
When you created your dynamic controls, did you add the controls to the Page.Controls collection?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
thanx for ur reply
yes i added it to the page controls.
|
|
|
|
|
Might be the controls are not getting added to the page
Where are you adding the controls to the page ?
First check by debugging the application
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Are you counting the controls on postback? On a postback, you have to create and add all the controls again.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Is there any mechanism to take the screenshot of the desktop along with the mouse pointer?
Here what i need is an image of the desktop in which it contains the mouse pointer.
Thanks in Advance
Ramu Medida.
|
|
|
|