|
1. DataGridView and GridView are two different things.
2. OP wasn't clear enough about the what exactly he wants to show in the gridview. So, which columns are you asking to remove?
"No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
What do you mean by all the information from the database?
"No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
Ok, well its a DataGridView, and I just want every entry in the database, put in there. So the database has 7 columns, and for example it has an entry like this:
300,mark,male,homosexual,single,male,19
And I want the DataGridView to display that info, in the appropriate columns.
|
|
|
|
|
I generally use a datatable instead of a dataset, I find it easier to debug. I can't see anything to stop this code working, change the datasource to a table, debug and make sure you are getting data returned from the database.
I also never use the data member property with a table. This may be forcing the DGV to look for a TABLE in the dataset named data which does not exists of course!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
dataset DS = new Dataset
datatable DT = new DataTable
mysqlconnection connection = new mysqlconnection();
connection.ConnectionString = "blah blah blah"
connection.Open();
sqlite_comm = connection.CreateCommand();
string CommandText = "select * from data";
mysql_da = new MySQLDataAdapter(CommandText, connection);
DS.Reset();
mysql_da.Fill(DS);
DT = DS.Tables[0];
dataGrid1.DataSource = DT;
connection.Close();
|
|
|
|
|
I have a C# form users use to enter hours worked, sick time , vacation.
It is connected to access 2003 database.
The form does not have a login- each person just selects last name from combo box and any secure data is not visible on form.
is there a way I can display a current number of vacation hours, sick time left each week on form for each person.
I recieved an excel sheet with total number of vacation hours and sick hours each user has for this year at present. When someone uses time it has to calculated and updated.
I am uncertain of how of even how to start on this task. any ideas. I also have to have vacation time and sick time only available to user. no one else can view.
thank you,
|
|
|
|
|
You would force a user to select their name first and then query the data on the SelectedItemChanged event, same as you would select data from another data source on a different event, such as saving data on a button click
|
|
|
|
|
|
|
Go back to the article, and send the author a message there - use new message at the end of the article. That way they get an email to say you need help, rather than relying on them dropping in here and spotting your request.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
Hi folks,
I am entering data into the db from a winform. The save button handles the insertion of the form data into the db. The form has
all fields for insertion into the table. Some field of the table are set to database defaults like getdate() and suser_sname .
When I hit the save button .... the default values are not getting interted into the db they are NULL when i query the db.
please provide you suggestions to relove this issue . thanks
|
|
|
|
|
I think we will need to see the code for the save button - please use the "code block" widget when you post it.
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
{
tbSystem tb = new tbSystem();
tb.System_DeliveryDate = System_DeliveryDateDateTimePicker.Value;
tb.System_Description = System_DescriptionRichTextBox.Text;
tb.System_Name = System_NameTextBox.Text;
tb.System_Priority = (int)System_PriorityComboBox.SelectedValue;
tb.System_Status = (int)System_StatusComboBox.SelectedValue;
try
{
tmx.tbSystem.InsertOnSubmit(tb);
tmx.SubmitChanges();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
MessageBox.Show("Date is Validated and saved");
}
|
|
|
|
|
Check ur query otherwise it is not possible to face this type of problem.
(And past code also, For more exact answer)
Syed Shahid Hussain
|
|
|
|
|
Just pasted code in the reply above
|
|
|
|
|
i dont know if there is a way but when i face like this problem i did for loop to check if there is a null value and replace it with 0.
i hope that will help
|
|
|
|
|
Hi All,
I want to add description to already installed service.
Help Please
Regards,
Sunil G.
|
|
|
|
|
On the registry, change the "Description" key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\yourservice
|
|
|
|
|
Just a simple question
Is System.Array a collection ?
If it is, then why doesnt it come in the System.Collections namespace ??
The name is Sandeep
|
|
|
|
|
System.Array is a collection, it also implements System.Collections.ICollection .
Xandip wrote: If it is, then why doesnt it come in the System.Collections namespace ??
Because somone in Microsoft decided it would be best sitted in the System namespace! Possibly this is because it has a close natural affinity with the primative (object[] type) arrays.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
If you create your own collection, would you put it there?
|
|
|
|
|
How to get exception Code in C#?
This Code just Show Error Message :
try
{
}
catch(Exception ex)
{
messagebox.show(ex.Message);
}
|
|
|
|
|
Hi,
exception is a way to provide information about an unusual behavior in a method. Sometimes this behavior is caused by an error. What you want is the error code. So the "default" Exception class you are catching does not provide an error code
http://msdn.microsoft.com/en-us/library/system.exception.aspx[^]
But if the specific class of the exception thrown by the called method contains a code, than you can receive this code by accessing the property from the exception (you have to cast before or catch a more specific type).
If you need further help I recommend to post the code also, causing the exception.
Regards
Sebastian
|
|
|
|
|
1) for example : System.FormatException
try
{
int i = int.Parse("Hi Thanks for your Help!");
}
catch (Exception ex)
{
Type tp= ex.GetType();
}
catch (FormatException Fex)
{
Type tp= ex.GetType();
}
2) where we can get all Exception types?
|
|
|
|
|
1) you have to catch the FormatException first. And as second one the common Exception. When not, the FormatException will never be catched, because a FormatException is an Exception.
2) Nowhere, because Exception are classes which can be derived from. So there are thousands of Exception types out there (waiting to be catched ) (For all framework exceptions you can browse through msdn...)
3) Maybe you can explain what you want to achieve? To get an idea for exception handlung start reading this msdn article:
http://msdn.microsoft.com/en-us/library/ms173160.aspx[^]
Regards
Sebastian
|
|
|
|