|
In Form Closing Event place the code e.cancel=true
prabumj
Prabumj@gmail.com
|
|
|
|
|
I will do it by disabling Close menu item in window's system menu
|
|
|
|
|
i installed the visual studio 6.0 after visual studio 2.0.and got the following message after the vs 6.0 installation
do u want to upgrade the jet settings? Now my question is what's the meaning of the line , upgrade the jet settings.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
You installed them in the wrong order. IIRC, you have to install VS6 first, then installed Visual Studio 2005. But in your case, I would think you do not want to do this.
|
|
|
|
|
|
i have datagrid that had data , but the headercolumn text is the column text in database. I want to change headercolumn text . What shuold i do ?
gaumeo
|
|
|
|
|
If u pass datas through Dataset u can change by Writting New Header text
e.g code
with dataset
.columns(0).columnname="New Column1 Name"
.columns(1).columnname="New Column2 Name"
End with
or else
from design time itself u can assign new header text and later pass datas in required cells.
Prabumj
Prabumj@gmail.com
|
|
|
|
|
'For example
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
' Create a DataSet with a table,and tablename is "tmpTbl";
' Create a Data Connection with name "gCnData";
tmpTbl.TableName = "SQL:"
DataSet.DataSetName = "SQL:"
Dim tmpRS As New ADODB.Recordset
Dim i As Int16
Dim RowCnt As Int16
tmpRS.Open("Select * from datatable", gCnData, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockBatchOptimistic)
tmpTbl.Rows.Clear()
tmpTbl.Columns.Clear()
For i = 1 To tmpRS.Fields.Count
tmpTbl.Columns.Add(tmpRS.Fields(i - 1).Name)'Here ,you can rename the column's name
Next i
If Not tmpRS.EOF Then tmpRS.MoveFirst()
RowCnt = 0
While Not tmpRS.EOF
Dim tmpRow As System.Data.DataRow = tmpTbl.NewRow
For i = 0 To tmpRS.Fields.Count - 1
tmpRow(i) = tmpRS.Fields(i).Value
Next
tmpTbl.Rows.Add(tmpRow)
tmpRS.MoveNext()
RowCnt = RowCnt + 1
End While
On Error Resume Next
DG.DataSource = DataSet
DG.Refresh()
DG.Expand(-1)
DG.PreferredColumnWidth = 122
DG.RowHeaderWidth = 6
If DG.AllowNavigation = True Then
DG.NavigateTo(0, "SQL:")
End If
DG.Text = "SQL:"
DG.AllowNavigation = False
DG.AllowNavigation = True
Cursor.Current = System.Windows.Forms.Cursors.Default
|
|
|
|
|
Hi everyone,
Anyone knows how to set iTunes application to Mini Player mode using .net?
Thanks, Have a nice day...
ianbacalla
|
|
|
|
|
There's two problems here
1 - does the iTunes application allow an external appliction to control it, and
2 - does it do so in a way that supports .NET ?
The Apple site seems like the best place to look for answers, to me.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian,
yes, iTunes application allow external application to control. just found the solution now...
ituneslib.itunesapp.browserwindow.miniplayer = true
cool...
ianbacalla
|
|
|
|
|
I have a problem with my application.I have created a connection with an Access database using wizard.and i have a form with some buttons to add , delete and modify records.Bu some time ( !! Not always ) an error is generated : --Concurrency violation the update command affected o of the expected 1 records--. I can do many operations add , delete , update ..etc and everything is ok , some time i get this error.
Please help me !
Modified : I found that the error is generated always if i add a record and then i try to deleted.
( but the error is generated in other situations too, but not always)
-- modified at 21:03 Thursday 9th August, 2007
|
|
|
|
|
Hi,
There is many possiblity of problems/bugs in ur connecting n disconnecting. 1st thing is the ms access is using by some other process Or the db file driver may be NTFS format Or the system may have virues that accesing ur db. Many of the programmers mistake it to forgot to close the connections..
It is the best to use try... catch..
i.e,
Try
Open()
(coding....)
Catch ex As Exception
Finally
connect.close()
End Try Try this code.. N Pls reply me wat u get
Senthil S
Software Engineer
|
|
|
|
|
thank you
i try but the problem is the same. ( i'm using DataAdapter update method)
The problem is only when i add new record and after i try to modify or delete the new record.
if i close the form after adding new record and open again and try to modify or delete the record everything is ok.
only my program is accessing the database , and there is no virus on my computer.
-- modified at 10:12 Friday 10th August, 2007
|
|
|
|
|
If I was the colorindex definition, where in the sam hill would I be hiding? Can't find anything on support.microsoft.com except where they are used as numbers (e.g., I know that 5 is blue). This is using Excel from within VB.NET.
Thanks, OH
ohart
|
|
|
|
|
|
Johan,
Thanks for the help. I found a macro to display the color index (don't know why I didn't think of that).
Thanks, OH
ohart
|
|
|
|
|
Hello,
I'm trying to write an own control and I want to draw the content by my self. But I have problems with the Visual Style-Support. The Visual Styles are supported and enabled for my application, but my code do nothing. Here it is:
Protected Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)<br />
' open theme data<br />
Dim hTheme As IntPtr = IntPtr.Zero<br />
hTheme = NativeMethods.OpenThemeData(hTheme, "EDIT")<br />
<br />
' make sure we have a valid handle<br />
If Not hTheme = IntPtr.Zero Then<br />
' get a graphics object the UxTheme can draw into<br />
Dim hdc As IntPtr = e.Graphics.GetHdc()<br />
<br />
' get the draw and clipping rectangles<br />
Dim dRect As RECT = RECT.FromRectangle(Me.ClientRectangle)<br />
Dim cRect As RECT = RECT.FromRectangle(Me.ClientRectangle)<br />
<br />
' draw the themed background<br />
Dim ret As Integer = NativeMethods.DrawThemeBackground(hTheme, hdc, 1, 1, dRect, cRect)<br />
<br />
' clean up resources<br />
e.Graphics.ReleaseHdc(hdc)<br />
End If<br />
<br />
' close the theme handle<br />
NativeMethods.CloseThemeData(hTheme)<br />
End Sub<br />
<br />
'The NativeMethods-Class<br />
<br />
Public Class NativeMethods<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function OpenThemeData(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPTStr)> ByVal pszClassList As String) As IntPtr<br />
End Function<br />
<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function DrawThemeBackground(ByVal hTheme As IntPtr, ByVal hdc As IntPtr, ByVal iPartId As Integer, ByVal iStateId As Integer, ByRef pRect As RECT, ByRef pClipRect As RECT) As Integer<br />
End Function<br />
<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function CloseThemeData(ByVal hTheme As IntPtr) As Integer<br />
End Function<br />
End Class<br />
<br />
'The RECT-Class<br />
<br />
Imports System.Runtime.InteropServices<br />
<br />
<StructLayout(LayoutKind.Sequential)> _<br />
Public Class RECT<br />
Public left As Integer<br />
Public top As Integer<br />
Public right As Integer<br />
Public bottom As Integer<br />
<br />
Public Sub New(ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer)<br />
Me.left = left<br />
Me.top = top<br />
Me.right = right<br />
Me.bottom = bottom<br />
End Sub<br />
<br />
Public Shared Function FromRectangle(ByVal rect As Rectangle) As RECT<br />
Return New RECT(rect.Left, rect.Top, rect.Right, rect.Bottom)<br />
End Function<br />
<br />
Public Shared Function FromXYWH(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) As RECT<br />
Return New RECT(x, y, x + width, y + height)<br />
End Function<br />
<br />
Public Function ToRectangle() As Rectangle<br />
Return New Rectangle(Me.left, Me.top, Me.right - Me.left, Me.bottom - Me.top)<br />
End Function<br />
End Class
This is a simplified implementation to draw a visual style enabled textbox, but it do nothing although no exception is thrown and the return value from DrawThemeBackground is ok. What is my mistake? I hope that onebody could help me because I tryed a few days and see no solution.
Thanks vocaris
|
|
|
|
|
Hello,
its me again, does everyone knows an other forum, where I could ask this question?
Vocaris
|
|
|
|
|
try www.vbforums.com
they are pretty good there too, sorry I can't help you either I'm just a beginner myself.
|
|
|
|
|
Hi all,
I am having a problem with a standard webclient url download via proxy server (ISA) only when the download method is called via an alternate thread other than the main UI thread.
The error is an authentication failure.
When the call is made via the main UI thread it works fine, even without specifying authentication or proxy details (I assume default is in use).
The thread calling the webclient methods is a standard System.Threading.Thread object.
Any ideas?
Thanks in advance!
|
|
|
|
|
I monitor a large ETL process at my company. This ETL process runs on a UNIX server within our network. If a specific process fails, an error log (Step1.log) is generated on the UNIX server that describes what caused the failure. We then use "CORE FTP" or "PUTTY" to retrieve/open the error log and cut/paste the error message into an email which is sent to our developers for handling. I have written a VB6 desktop application that automagically sends a CDO email to the developers to alert them when the specific process has failed. (This information exists on a Windows Server and isn't a problem to open and retrieve info.) My objective is to include the UNIX error message in the alert email message to the developers but I do not know how to programmatically connect to UNIX and retrieve the error logs. I know the UNIX Remote Host IP address and port. I also have the user name and password. So far I've tried connecting to UNIX using WINSOCK but I'm unable to pull this off. I believe I'm having trouble sending the user name as password to the UNIX server. Unfortunately my ideation is bigger then my skill level. My skill level is between beginner/intermediate so any help would be greatly appreciated. Thanks!
|
|
|
|
|
How were you connecting to the UNIX box through VB6? I.e. which protocol were you attempting to connect with? FTP, Telnet, HTTP etc or a custom app protocol?
By the sounds of it, given then ability to connect via core and putty, the UNIX box has ftp enabled. If I were you I'd take a look for an open source VB6 ftp control and configure from there. Or you could just buy one of course!
Writing an ftp client is non-trivial (although fun - at least in uni). If you really want to then take a look at RFC 959[^] which describes the FTP protocol.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Thanks for addressing my question. I was trying to connect using an FTP protocol but it was way above my skill level. I will search the open source sites for a vb6 ftp control. Thanks for that suggestion!
|
|
|
|
|
I'm trying to access the value of a HtmlInputHidden inside a datalist, but I get "Object reference not set to an instance of an object" as an error when I try to call the value.
Here is my code:
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
'Dim row As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim TitleLink As HyperLink = CType(e.Item.FindControl("ProdTitleLink"), HyperLink)
Dim TextLink As HyperLink = CType(e.Item.FindControl("ProdTextLink"), HyperLink)
Dim prodID As HtmlInputHidden = CType(e.Item.FindControl("ProductID"), HtmlInputHidden)
TextLink.NavigateUrl = "productDetails.aspx?catID=" & Request.QueryString("catID") & "Id" & prodID.Value
TitleLink.NavigateUrl = "productDetails.aspx?catID=" & Request.QueryString("catID") & "Id" & prodID.Value
End Select
End Sub
Code of Datalist:
<asp:DataList ID="DataList1" runat="server">
<HeaderTemplate>
<div class="ProdHeadBox">
<div class="ProdTitleHead">Product</div>
<div class="ProdQtyHead">Qty</div>
<div class="ProdPriceHead">Price</div>
</div>
</HeaderTemplate>
<ItemTemplate>
<div class="ProdMainBox">
<div class="ProdPicBox">
<asp:Image ID="ProdImage" runat="server" ToolTip='<%# Eval("PictureLarge") %>' ImageUrl='<%# "~/images/productImages/small/" + DataBinder.Eval(Container.DataItem, "PictureSmall").ToString() %>' />
</div>
<div class="ProdTextBox">
<div class="ProdTitle">
<asp:HyperLink CssClass="ProdTitleLink" ID="HyperLink2" runat="server" NavigateUrl='<%# "productDetails.aspx?Id=" + Eval("ProductID").ToString() %>' ToolTip="Read More...">
<asp:Literal ID="litTitle" runat="server" Text='<%# Eval("ProductName") %>' /></asp:HyperLink>
</div>
<div class="ProdText">
<asp:Literal ID="ProdType" runat="server" Text='<%# Eval("Type") %>' /><br />
<asp:Literal ID="litDescription" runat="server" Text='<%# GetDescription(Eval("ProductDescription")) %>' /><br />
<asp:HyperLink CssClass="ProdTextLink" ID="HyperLink1" runat="server" NavigateUrl='<%# "productDetails.aspx?Id=" + Eval("ProductID").ToString() %>' ToolTip="Read More...">more...</asp:HyperLink>
<input type="hidden" id="ProductID" runat="server" value='<%# Eval("ProductID") %>' />
</div>
<div class="ProdQtyBox">
<asp:TextBox Width="25" ID="ProductQTY" Text="0" MaxLength="5" runat="server" />
<asp:RegularExpressionValidator ControlToValidate="ProductQTY" ValidationExpression="\d+" Text="*" ID="QTYValidator" runat="server"></asp:RegularExpressionValidator>
</div>
<div class="ProdAddBox">
Price: <asp:Literal ID="Literal1" runat="server" Text='<%# String.Format("{0:c}", Eval("ProductPrice")) %>' />
<br />
Per roll/pack<br />
<asp:Button ID="Add" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ProductID")%>' Text="Add" runat="server" />
</div>
</div>
</div>
</ItemTemplate>
</asp:DataList>
Thanks for any help!
|
|
|
|