|
Hi,
I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me.
below is the sample HTML that I have:
<asp:tablerow>
<asp:tablecell text="Company" id="CompanyCode" runat="server">
<asp:tablerow>
<asp:tablecell text="Paygroup" id="PaygroupCode" runat="server">
<asp:tablerow>
<asp:tablecell text="paygroup descr" id="PaygroupDescr" runat="server">
------------
In addition, I think I need some VB code but I'm not sure of the syntax:
Table1.ID("Company") = Dr("Company")
Any help would be much appreciated.
Thanks,
Gavin
--
"You've got to live and learn..."
|
|
|
|
|
You need to check 'Do not treat <'s as HTML tags' for your html to be visible.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for pointing that out.
<b>Here is my html</b>
<asp:TableRow>
<asp:TableCell Text="Company" ID="CompanyCode" Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="Paygroup" ID="PaygroupCode" Runat="server"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="paygroup descr" ID="PaygroupDescr" Runat="server"></asp:TableCell>
</asp:TableRow>
|
|
|
|
|
As I thought - this control just generates a table, as in a html table. It's not a databound control. You need to use a datagrid or a repeater to do this. Then the datagrid will generate the table for you, using the data source.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Does anyone have any idea how to create a password gnerator that changes everyday.
what i'm trying to do is have an admistrator password that changes everyday, Less likely that someone will use it without a persons consent.
Any Ideas on how this could be created?
Thanks
You are you and I am I. So who is that?
|
|
|
|
|
in your application on load. check if user has changed the password today. if not then prompt him to change. for this keep one column in DB "LastChangedOn". to keep the track.
|
|
|
|
|
Thanks for the info.
What i'm thinking of doing is have the password automatically generate a new password everyday for the system.
I know it has to be done using the date, but I don't know how
You are you and I am I. So who is that?
|
|
|
|
|
This will generate a password of random characters with a length of 10 characters. You could modify this to include the date as part of the generation process.
<br />
Private Sub btnGeneratePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGeneratePassword.Click<br />
Dim RandomNo As New Random<br />
Dim x As Integer<br />
Dim y As Integer<br />
Dim Chars As String<br />
Chars = "1234567890abcdefghijklmnopqrstuvwxyz"<br />
Chars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()[]{};:<>?/.,"<br />
Count = CInt(numLength.Text)<br />
txtPassword.Text = ""<br />
For y = 0 To 10 ' Number of chars in password<br />
If chkUseSpecial.Checked Then<br />
x = RandomNo.Next(0, Chars.Length - 1)<br />
Else<br />
x = RandomNo.Next(0, Chars.Length - 24)<br />
End If<br />
txtPassword.Text += Chars.Chars(x)<br />
Next<br />
End Sub<br />
PS: Codeproject could do a better job at formatting the code above!
|
|
|
|
|
Thanks for that. I'll try it tonight after work.
I know what you mean about formatting it a bit
Anyway. Can you try this for me, If you have time,
Public Function GeneratePassword(ByVal passwordLength As Integer) As String<br />
Dim Vowels() As Char = New Char() {"a", "e", "i", "o", "u"}<br />
Dim Consonants() As Char = New Char() {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v"}<br />
Dim DoubleConsonants() As Char = New Char() {"c", "d", "f", "g", "l", "m", "n", "p", "r", "s", "t"}<br />
<br />
Dim wroteConsonant As Boolean 'boolean<br />
Dim counter As Integer<br />
<br />
Dim rnd As New Random<br />
Dim passwordBuffer As New StringBuilder<br />
<br />
wroteConsonant = False<br />
For counter = 0 To passwordLength<br />
If passwordBuffer.Length > 0 And (wroteConsonant = False) And (rnd.Next(100) < 10) Then<br />
passwordBuffer.Append(DoubleConsonants(rnd.Next(Do ubleConsonants.Length)), 2)<br />
counter += 1<br />
wroteConsonant = True<br />
Else<br />
If (wroteConsonant = False) And (rnd.Next(100) < 90) Then<br />
passwordBuffer.Append(Consonants(rnd.Next(Consonan ts.Length)))<br />
wroteConsonant = True<br />
Else<br />
passwordBuffer.Append(Vowels(rnd.Next(Vowels.Lengt h)))<br />
wroteConsonant = False<br />
End If<br />
End If<br />
Next<br />
<br />
'size the buffer<br />
passwordBuffer.Length = passwordLength<br />
Return passwordBuffer.ToString<br />
End Function
Found it on the internet. Iv'e only just started programming, but I assumed that because it was a function. to get it to display, all I would need to do is
text_change event<br />
<br />
textbox1.text = GeneratePassword
But VB.net says tjhat it's not a string????
Any ideas?
P.s. I think I might go with your's. i'm just trying to understand how to display this.
Thanks
----------------------------------------------
You are you and I am I. So who is that?
|
|
|
|
|
Hi I am upgrading VB application. I have few questions after upgrading to
VB.NET
1. I use SelectObject Win32 API which takes Handle to the DC (I currently
use picture box). Error message is "HDC is not a member of
System.Windows.Forms.Panel"
2. All of the Listview controls are upgraded as AxMSComctlLib.AxListView,
but I get an error "Type AxMSComctlLib.AxListView is not defined".
Can you please guide me to resolve these errors.
Thanks In Advance
|
|
|
|
|
I don't know about the first one but if you type "dim AxMSComctlLib as New AxMSComctlLib" should take care of #2.
|
|
|
|
|
1:How we create Input MessageBox in C# Or VB.Net and its set value?
2: How to get Print and PrintPreview dialog box result.
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
|
If (MsgBox("Are you sure to delete selected: " & "WARNING: Delete CANNOT be undone!", vbYesNo + vbQuestion + vbDefaultButton2, "Confirm delete!") = vbYes) Then
// Put your code here
End if
|
|
|
|
|
I have a combox i bind it with data table like this.
cbclientid.DataSource = dsclientid;
cbclientid.DisplayMember = "Client_Info.Client_Name";
cbclientid.ValueMember = "Client_Info.Client_Id";
Now when i get value from table through sql reader.
Client Id how i select the value from cbclient(combox);
I am doing this :-
cbclientid.SelectedText = dr2.GetString(2); // Return Client Name
this code not select cbclient name value.
...
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
Try this:
cbclientid.SelectedIndex = cbclientid.FindString(dr2.getstring(2))
|
|
|
|
|
There is a treeview, I want to store all of the nodes into a class or structure.
How to do?
|
|
|
|
|
Have read about some macros but never found one wich works?
Anyone knows how to do this in VB.NET ... In C# it seems to be default.
//Maw
|
|
|
|
|
Hi. I am developing a system that uses a computer that has a USB port as input with no keyboard/mouse. After the program scanned the flash drive, the user will now remove it. How can I duplicate the action of clicking the "Safely Remove Hardware" in my program?
Thanks a lot!
|
|
|
|
|
I tried this for days but can't seem to get it. Basically I just need to open a folder. No browsing or dialog box is needed. I just need to open a specific folder(E.g. "C:\Example\") whenever I click the button. I should be able to see whatever files are in there.
|
|
|
|
|
you want explorer to open the folder so you can see it?? you want cmd to display the folder? You want to open a display window in your program that displays the list of files in a folder? Please elaborate your problem.. Also show us some code that isn't working?
David W Johnson
|
|
|
|
|
Thanks very much for all the talent programmers here. I enjoy your codes here very much.
|
|
|
|
|
I can create a new instance for the MS Office app with the shell statement:
Shell("C:\Program Files\Microsoft Office\Office11\WINWORD.EXE ")
but I can not figure out the proper syntax to call a specific word document in a folder.
Shell("c:\Documents and Settings\Administrator\My Documents\Docs\Analysis.doc")
**I still get file not found in my catch block
*It does work with notepad
Shell("notepad C:\Documents and Settings\Administrator\My Documents\Analysis.doc")
Am I missing a project reference, a com object or a import statement?
|
|
|
|
|
Have you tried:
Shell("C:\Program Files\Microsoft Office\Office11\WINWORD.EXE " & """" & "c:\Documents and Settings\Administrator\My Documents\Docs\Analysis.doc" & """")
|
|
|
|
|
I just knew it would take 2 or three sets of quotes...(yeah right)
What does the ampersand do?
|
|
|
|