| View previous topic :: View next topic |
| Author |
Message |
asianking Expert Cheater
Reputation: 0
Joined: 25 Jun 2008 Posts: 109
|
Posted: Thu Mar 10, 2011 5:04 pm Post subject: |
|
|
is there a code to hide checkbox inside the database, but show the checkbox on graphical interface?
for example:
If you ask why didn't I just create a plain checkbox without adding in database; I tried it and if I move on to the next record; the checkbox will kept highlighted which it doesn't save it.
_________________
|
|
| Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Thu Mar 10, 2011 6:55 pm Post subject: |
|
|
Add an event that checks when the form is refreshed or the form moves on and have it clear out the check boxes. Also why is there a checkbox physically in your db? I would have had a column sex then pop with m or f have your checkbox check the value if checkbox == "m") checkbox_male.checked.value = true
_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
| Back to top |
|
 |
asianking Expert Cheater
Reputation: 0
Joined: 25 Jun 2008 Posts: 109
|
Posted: Fri Mar 11, 2011 8:26 am Post subject: |
|
|
so i'm assuming you don't know the code to hide from data. I kind of like the data view to display on FirstName, LastName, Telephone, Email, and Address. For All checkbox, to hide. I still want them there, but just hide so it doesn't display it in data view. For graphical view, I want to show the checkbox though.
_________________
|
|
| Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Fri Mar 11, 2011 3:16 pm Post subject: |
|
|
If not mistaken in DataView you would have to hide the whole column.
SELECT(FirstName, LastName, Telephone, Email, Address) FROM dbUsers;
In your query just leave it out.
What's the code look like for your DataView?
This is a snippet of code I wrote to fill a datatable with results parsed from a text file. If I wanted to hide something on the table, I just wouldn't have added it when creating the datatable to begin with. I am not sure if this is relevant to your question or not.
| Code: |
public static int fillDataTable(DataTable tblName, string[] colHead, string[] dataRow)
{
DataRow dr;
dr = tblName.NewRow();
for (int n = 0; n < colHead.Length; n++)
{
dr[colHead[n]] = dataRow[n].ToString();
}
tblName.Rows.Add(dr);
return 1;
} |
EDIT simpler solution. If you used the DataGridView then when you select your table you should be able to select what in the table is shown. This may affect your query though, unless you are building that seperately to popular the actual form.
_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
| Back to top |
|
 |
asianking Expert Cheater
Reputation: 0
Joined: 25 Jun 2008 Posts: 109
|
Posted: Fri Mar 11, 2011 4:31 pm Post subject: |
|
|
code error; static is not a declearation.
by the way; I think you kind of got the right idea by hiding others that you do not enter in the codes. Anyway, my co-worker says that I can do two seperate tables and make sure both of them includes ID that will match. So if I update one table; it applies both. I would know how to do this with access, but not vb.
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Fri Mar 11, 2011 5:35 pm Post subject: |
|
|
| asianking wrote: | code error; static is not a declearation.
by the way; I think you kind of got the right idea by hiding others that you do not enter in the codes. Anyway, my co-worker says that I can do two seperate tables and make sure both of them includes ID that will match. So if I update one table; it applies both. I would know how to do this with access, but not vb. |
You can use Linq to do joins to ensure matching.
If you need help learning Linq:
http://msdn.microsoft.com/en-us/vcsharp/aa336746
_________________
- Retired. |
|
| Back to top |
|
 |
|