|
YES
IF U CAN GIVE ME AN EXAMPLE PLEAZE
U CAN SEND TO MY E-MAIL
YOSEF_SA@HOTMAIL.COM
THANK YOU
|
|
|
|
|
Hi,
i have a problem with executing select query which was added to dataadpter.
i have 2 select command.
' first select command
dbAdapterUsers.SelectCommand = New OleDbCommand _
("SELECT UserName FROM Users where UserName=? AND PassWord=?", dbConnGym)
dbAdapterUsers.SelectCommand.Parameters.Add("UserName", OleDbType.VarChar, 15, "UserName")
dbAdapterUsers.SelectCommand.Parameters.Add("PassWord", OleDbType.VarChar, 15, "PassWord")
' second select command
dbAdapterUsers.SelectCommand = New OleDbCommand _
("SELECT * FROM Users ", dbConnGym)
'filling the datatable
dbAdapterUsers.Fill(dsGYMObj.Users)
2 question:
1) if i change the order between the queries , i get error " parameter ?_1 has no default value." -- why its ok if i the order is as above
2)i execute login function - and i have a feeling that it execute the first query and not the one with the parameters.
login Public Shared Function Login(ByVal username As String, ByVal pass As String) As Boolean
dsGYMObj.Users.Clear()
dbAdapterUsers.SelectCommand.Parameters.Add("@UserName", OleDbType.VarChar, 15, "UserName").Value = username
dbAdapterUsers.SelectCommand.Parameters.Add("@PassWord", OleDbType.VarChar, 15, "PassWord").Value = pass
dbAdapterUsers.Fill(dsGYMObj.Users)
If Not dsGYMObj.Users Is Nothing Then
If dsGYMObj.Users.Rows.Count > 0 Then
Return True
Else
Return False
End If
End If
End Function
thanks
nir.
|
|
|
|
|
Hello There
I am using ListView Control (detail view) having 6 Columns Maximum ( depending on user can de-select the column from view options) So what I need is that the last column should have the width which is equal to the remaining width of the list control. So that the color assigned to that row should be displyed on the whole row.
I have seen this type of code in Codeproject. But Unfortunately I am unable to search that now . If any one has URL for this or has any other solution would be highly appreciated
|
|
|
|
|
You need to set the Width property of the last ColumnHeader to -2.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
Does anyone know how to get the windows explorer file context menu with all its entries (winzip for zip files, open with etc).
I have seen it implemented in file browsers but I have no idea how it is done. There is a C++ implementation of it here at the code project but I dont understand it , has anyone done this in VB.Net or have any ideas how I would go about doing it myself ?
Any advice would be appreciated.
|
|
|
|
|
You need to work with IContextMenu and IContextMenu2 shell API interfaces. Using the shell interfaces in VB.Net can be complicated, but you can see if the declarations for the interfaces are available on www.pinvoke.net
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
Thankyou for the link and info. It seems I have a lot to learn.
After looking into it a bit I think I may just end up creating standard context menus and implementing my own features.(The extra work will allow me greater control and make the app more usefull in the long run)
BTW the site in your sig came up while I was searching this topic,It was the last site I was on before posting here, kinda wierd you were the first reply.
Thanks
|
|
|
|
|
Hi all,
I have an object of excel,application class in my application. but when i quit my application, the object remain in my memory inspite of the fact that i am using excel=nothing.
i dont understand y is it heapening.
an suggestions please
its urgent
|
|
|
|
|
I don't usually do Office automation, so I don't know if this is going to work or not. But, did you try to find/call a Quit or Exit method on your Excel Application object?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes i did, but its not working
any other clue
|
|
|
|
|
Hi all,
I am using datagrid for my application and i have requirement to check all chack boxes in the grid. It doing well, but for this purpose my page is to be postbaked as my code is written in code behind and i canot understand how can i implement the code performing the same functionality in javascript. here's my code.
Protected Sub CheckAll(ByVal sender As Object, ByVal e As EventArgs)
If CType(sender, CheckBox).Checked Then
For Each i As DataGridItem In dg1.Items
CType(i.FindControl("chkTemplateWO"), CheckBox).Checked = True
Next
Else
For Each i As DataGridItem In dg1.Items
CType(i.FindControl("chkTemplateWO"), CheckBox).Checked = False
Next
End If
End Sub
and then from html i m calling
<asp:checkbox id="chkTemplateHeader" runat="server" oncheckedchanged="CheckAll" autopostback="True"
runat="server">
any advice on how can i do the same thing without going to server.
|
|
|
|
|
I am doing my vb.net programmer training in podicherry.
plz give me coding for treeview
I am Mani I work in pondicherry
|
|
|
|
|
|
I am in need of a insurance application project.
It is very help full to me if any one send the project
my mail id is abhaskar_raomca@yahoo.co.in
krishnasandeep@gmail.com
with Regards
Sandeep
-- modified at 1:04 Saturday 3rd September, 2005
|
|
|
|
|
sandeepreddy wrote:
I am in need of a insurance application project. It is very help full to me if any one send the project
That is a very vague request. There are many applications in the insurance industry and all different. Also, I'm sure that many insurance companies createt their own applications and are very protective of them for competitive reasons.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
hai friend
I need any type of insurance project.
to simply study it and keep that as my exp project
|
|
|
|
|
I've seen quite a few applications if a program is already running, it just brings the instance that is already running back into view. Right now, I could have say, N number of instaces of my contact manager running. How would I go about making a 1 instance app?
|
|
|
|
|
Search the articles for "single instance" and you'll find a bunch of examples. Here's[^] a list of the top 3 VB.NET examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you are using VB6:
If App.PrevInstance Then 'We are already running an instance of this, exit
End
End If
You can also activate the first instance by:
If App.PrevInstance Then 'We are already running an instance of this, exit
Dim sSave As String
sSave = App.Title
App.Title = App.Title & "... duplicate instance."
AppActivate sSave
End
End If
|
|
|
|
|
I want to send Key to another form of another application using API function.
Can you give me source code to do it ?
Hung
|
|
|
|
|
Here is a code snippet to send commands to the Calculator. Hope it helps:
<br />
Dim ProcID As Integer<br />
' Start the Calculator application, and store the process id.<br />
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)<br />
' Activate the Calculator application.<br />
AppActivate(ProcID)<br />
SendKeys.SendWait("22")<br />
SendKeys.SendWait("*")<br />
SendKeys.SendWait("44")<br />
SendKeys.SendWait("=")<br />
|
|
|
|
|
When I apply this code to Command Prompt( Windows XP ) nothing happens.
I don't know why, I have used Win32 API with VB and all things work smoothly. But I don't know how to apply that code to VB.NET
Private Declare Function GetFocus Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Integer) As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Const WM_CHAR As Long = &H102
Private Const CH_A As Byte = 65
Private Sub Command1_Click()
Dim handleactive As Long
Dim recString As String
Dim handle As Long
handleactive = GetFocus()
'Call Shell("c:\windows\system32\cmd.exe", vbMaximizedFocus)
'handleactive = GetActiveWindow()
handle = FindWindowEx(0, 0, "ConsoleWindowClass", "C:\WINDOWS\system32\cmd.exe")
DoEvents
SendMessage handle, WM_CHAR, vbKeyC, 0
SendMessage handle, WM_CHAR, vbKeyD, 0
SendMessage handle, WM_CHAR, vbKeyReturn, 0
recString = String(100, Chr$(0))
GetWindowText handleactive, recString, 50
Text1 = recString
End Sub
Hung
|
|
|
|
|
I modified the code for the command prompt as shown below and seems to work fine:
<br />
Dim ProcID As Integer<br />
' Start the application, and store the process id.<br />
ProcID = Shell("CMD.EXE", AppWinStyle.NormalFocus, True, 1000)<br />
' Activate the application.<br />
AppActivate(ProcID)<br />
SendKeys.SendWait(" CD \TEMP" + vbCr)<br />
|
|
|
|
|
When I use this code:
handle = FindWindowEx(0, 0, "ConsoleWindowClass", "cmd.exe")
The returned handle is different between VB & VB.NET. So I can't use SendMessage (Win32 API function). I don't understand . Please help me !
|
|
|
|
|
Ok so I have TabControl and dynamically created TabPage with dynamically created RichTextBox. I am trying to use a OpenFileDialog to open a .rtf in a new TabPage in a new RichTextBox and read the selected rtf file into it. Here is the code that I am using. Somewhat new so feel free to show me better ways of doing what I am trying to do.
<br />
Dim sr As StreamReader<br />
<br />
Try<br />
With OpenFileDialog1<br />
If .ShowDialog = Windows.Forms.DialogResult.OK Then<br />
If .FileName.EndsWith(".rtf") Then<br />
<br />
'Declare new object variables<br />
Dim rtbTextArea As New RichTextBox<br />
Dim newTab As New TabPage<br />
<br />
TabControl1.TabPages.Add(newTab) 'Add new Tab Page to tab control<br />
<br />
With newTab<br />
.Text = OpenFileDialog1.FileName <br />
.Controls.Add(rtbTextArea) 'Add the rich text Box to the new tab control<br />
rtbTextArea.Dock = DockStyle.Fill 'Set Rich Text box area to fill tab page<br />
.Focus()<br />
End With<br />
<br />
For Each ctl As Control In TabControl1.SelectedTab.Controls 'Find RichTextBox control<br />
If TypeOf ctl Is RichTextBox Then<br />
sr = New StreamReader("" & .FileName & "")<br />
ctl.Text = sr.ReadToEnd<br />
End If<br />
Next<br />
Else<br />
MessageBox.Show("Please choose a Rich Text File (.rtf)")<br />
End If<br />
End If<br />
End With<br />
Catch ex As Exception<br />
MessageBox.Show(MessageBoxIcon.Exclamation, "An error has occured. Please make your selections again")<br />
Finally<br />
If Not (sr Is Nothing) Then<br />
sr.Close()<br />
End If<br />
End Try<br />
<br />
Thanks,
Taen Karth
-- modified at 21:47 Friday 2nd September, 2005
|
|
|
|