|
OK. I see what you're trying to do, but it's never going to work. VB 6 cannot generate the kind of DLL that is required for "DLL Injection". VB6 can only generate a COM-based DLL, which won't work for you because the required exports are not there. There is no way to "force" VB6 to generate those exports. You'd have to use some other wrapper around your DLL code to get this to work. Don't ask - I don't have any idea if someone has written one - let alone how to use whatever you find.
|
|
|
|
|
Thank you .I'll try to use C++ compile the dll.
|
|
|
|
|
For example i have a query table named (Qsupplier) consist of 3 rows and 5 columns.
EXAMPLE:
Supplier 1 2 3 4
Software Inc. 20000 90
Science Technology Co. Ltd 2000 800 500 80
Book Electronic Co. Ltd 30000 30000 24000 25
1. using the data reader how can i know if how many suppliers are there in the Qsupplier?
Thanks in advance guys.
die_nadel;)
|
|
|
|
|
Look up the COUNT statement, it's SQL to find out how many objects exist based on a query.
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 )
|
|
|
|
|
In a DataReader, there is no way to tell how many records it's going to read. It's a forward-only reader that returns rows, one at a time. It doesn't know how many are going to be returned.
Like Christian said, you can execute the same query with a COUNT expression in the SQL statement returning the exact same rows with the same WHERE clause, then execute your DataReader.
Or, you can count the number of rows returned AS they are returned by the DataReader.
Or, scrap the DataReader entirely and use a DataAdapter to fill a DataTable object that will tell you the number of rows it's holding.
|
|
|
|
|
Thanks dave it is clear now that I need to use a dataadapter for this one.
Thanks guys......
|
|
|
|
|
Hello,
I have a class that manages forms (held in a list->collection.generic) running within multiple applications. I provide a different form to allow the user to see all the forms running called "what's running" - clever I know. This form needs to be "topmost" (behaving like a dialogbox). Setting this property does keep this form above any of the running forms but you can still work the forms behind it even though they don't come into focus. So I disabled the running forms which corrected the situation. When my "what's running" form is closed the dispose event reenables all the running forms. The problem is when the last one in the list enables it comes into focus(dotnet disign?) instead of leaving the zorder of all the forms running alone. So -> When "what's running" is visible, form A is directly under "what running". But when I close "what's running" I run through the list reenabling all forms and because form B is last in the list form B is becomes active instead of form A.
Assuming you understand what I'm asking, is there a correction to this behavior or do you have an alternative to the disabling/enabling?
Note: I can't show the form by doing 'showdialog'.
Thanks,
Nathan
|
|
|
|
|
Hi Nathan,
At the risk of sounding like a smart-ass, if your app collects and shows the forms in a certain order, and assuming that form A is the first and form Z the last, could you not simply reverse the order in which you reactivate the forms?
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi Johan,
No worries about being a smart-ass. I thought of that as well. However, normal windows handling says, I might startup a, b ,c but look a, open word, look at c, open excel, look at b open outlook, etc. So your assumption is I never changed the order in which I opened them. Because I'm a multi-tasker, enabling c, b, a doesn't necessarily work because I could of been looking at b when I opened 'what's running' and if I enabled a last then it would be the one I'm looking at. So it's not accurate.
Nathan
|
|
|
|
|
Hi Nathan,
I think I understand the problem, and I am sorry to say that I don't know a direct answer to your original question.
All I dare suggest is, if it really matters which window is activated last, you could consider keeping score. In other words, assuming that you have some sort of list in memory somehow, assign a priority number to each form in the list, and active each form by this number. If you would like the last form that you have looked at to be activated (or by some other rule), you could try to change the number dynamically.
For what it's worth...
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I do samll project in VB.NET and asking the report from sql server. But I dont know how can create the quiry as per my requirment as mentioned below
1 Medical appointment schedulling for one person asking more than one time.
2. report should show the date time as last transaction from transaction table.
3. print the report from current form in one click command
|
|
|
|
|
|
thank you very much for introducing the web site it is more help full for me
|
|
|
|
|
Hello all, I have an attach button that open up so that a user may attach a file on a vb.net form using visual studio 2005. My question is how do I get the window to open up to the desktop to open a file. As of right now it is opening in my debug file. I just need it to open at the desktop first. Thanks a million.
-- modified at 16:06 Thursday 4th October, 2007
|
|
|
|
|
Hi,
if you are using open file dialog you could code this was as shown below:
<br />
OpenFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)<br />
If (OpenFileDialog1.ShowDialog()) Then<br />
Dim strFilename As String<br />
strFilename = OpenFileDialog1.FileName<br />
End If<br />
happy coding...;)
Balaji
|
|
|
|
|
I've been looking all over for the answer to this, and I'm apparently too dense today to implement the various solutions I've found. It seems this should be simple...
I have a config file that looks like this:
KZZZ (City2)|KZZZ-FM|...other values
KQQQ (City1)|KQQQ-AM|...other values
Right now there are only 2 values for each line, but I want the flexibility to add fields in the future. I want to read this file into an Array(ish Collection) and then sort it based on the second column.
Here's the code so far...
' set up needed variables
Dim ConfigFileReader As IO.StreamReader = New IO.StreamReader(My.Settings.DataRoot & My.Settings.StationConfigFileName)
Dim Configline, ConfigFields() As String
Dim ConfigDelimiter() As Char = {Convert.ToChar("|")}
Dim LineCount, FieldCount As Integer
Dim InsertLine As String = Nothing
' read in 1st line
Configline = ConfigFileReader.ReadLine
' parse line, placing each field into StationList array
Do Until Configline = Nothing
ConfigFields = Configline.Split(ConfigDelimiter)
For FieldCount = 0 To UBound(ConfigFields)
StationList(LineCount, FieldCount) = ConfigFields(FieldCount)
Next
' resize array to the right width
ReDim Preserve StationList(999, FieldCount)
' increment counters, read next line
LineCount += 1
FieldCount = 0
Configline = ConfigFileReader.ReadLine
Loop
End Sub
The issues:
I don't like declaring the oversize array (initialized as 999,1). Seems like an ArrayList would be the solution, but I'm not getting how to make a multi-dimensional ArrayList.
I'm apparently too dense today to implement a "sort on the second field" routine.
Thanks for your help!
Scott
|
|
|
|
|
+don't use an arraylist use generic list (of)
+Create a class that implements 'IComparer' this will allow you to specify how you want the list sorted.
'declare the list
Dim oaFuncInfo as new list(of FuncInfo)
'populate the list
Dim oFunc as New FuncInfo
oFunc.sFunc = sFunc
oFunc.sStatus = sStatus
oFunc.sComment = sComment
oaFuncInfos.Add(oFunc)
'sort the list: the reason for the (new funcinfo) is because I am using the same class for the sorting instead of using a different class that implements the icomparer
oaFuncInfos.Sort(New FuncInfo)
'The Class:
Friend Class FuncInfo
Implements IComparer(Of FuncInfo)
Public sFunc As String
Public sStatus As String
Public sComment As String
'define how how want to sort
Public Function Compare(ByVal x As FuncInfo, ByVal y As FuncInfo) As Integer Implements System.Collections.Generic.IComparer(Of FuncInfo).Compare
If x.sFunc < y.sFunc Then
Return -1
ElseIf x.sFunc = y.sFunc Then
Return 0
Else
Return 1
End If
End Function
End Class
|
|
|
|
|
I'm trying to pass multiple DataKeynames after a selection is made in the Gridview, and to view them in a DataList where the selection matches them. Right now it will only display the first selected parameter (jacket).
Here is my code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" Visible="false"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="jacket, closure, shielding" ForeColor="Black" GridLines="Vertical" Width="750px" OnPageIndexChanging="gridViewPublishers_PageIndexChanging" OnSorting="gridViewPublishers_Sorting"
AllowPaging="True" PageSize="20" AllowSorting="True" PagerSettings-Mode="NumericFirstLast">
<FooterStyle BackColor="#CCCCCC" />
<Columns>
<asp:CommandField ItemStyle-Width="70" ShowSelectButton="True" />
<asp:BoundField ItemStyle-Width="130" DataField="partnumber" HeaderText="Partnumber" ReadOnly="True" SortExpression="partnumber" />
<asp:BoundField ItemStyle-Width="100" DataField="jacket" HeaderText="Jacket" SortExpression="jacket" />
<asp:BoundField ItemStyle-Width="220" DataField="closure" HeaderText="Closure" SortExpression="Closure" />
<asp:BoundField ItemStyle-Width="110" DataField="shape" HeaderText="Shape" SortExpression="shape" />
<asp:BoundField ItemStyle-Width="130" DataField="shielding" HeaderText="Shielding" SortExpression="Shielding" />
</Columns>
<SelectedRowStyle BackColor="#7c7979" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
<PagerSettings Mode="NumericFirstLast" />
</asp:GridView><br /><br />
<asp:DataList ID="DataList1" runat="server" BackColor="#1679d5" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="1px" CellPadding="3"
ForeColor="White" GridLines="Vertical" DataSourceID="SqlDataSource1" Visible="false">
<FooterStyle BackColor="#CCCCCC" />
<SelectedItemStyle BackColor="Blue" Font-Bold="False" ForeColor="White" />
<ItemTemplate>
<table>
<tr>
<td style="width:120px; font-weight:bold;">
<asp:Label ID="materialLabel" runat="server" Text='<%# Eval("material") %>' />
</td>
<td style="width:450px;">
<asp:Label ID="Label" runat="server" TabIndex="1" Text='<%# Eval("marketing_tagline") %>' />
</td>
<td style="width:150px; text-align:center;">
<div class="SearchDataLink">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("material", "dataSheet.aspx?id={0}") %>' TabIndex="2" Target="_blank" Text="View datasheet" />
</div>
</td>
</tr>
</table>
</ItemTemplate>
<AlternatingItemStyle BorderWidth="1" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ZippertubingConnectionString %>" SelectCommand="SELECT * FROM [ProductVerbage] WHERE ([material] = @jacket) OR ([material] = @closure) OR ([material] = @shielding) " >
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="jacket" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="closure" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="GridView1" Name="shielding" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
|
|
|
|
|
This question belongs in the ASP.NET forum. It's got nothing to do with VB.NET.
|
|
|
|
|
I Need A Complete Article About SMO .
Plz Help me.
|
|
|
|
|
Google for "SMO" and see what you get.
|
|
|
|
|
Hi everyone,
In the ASP page, I store the output (in the form of html strings) from the rich-text editor in a database; when time comes, I retrieve the required HTML string (I use VB as a server-side language) (htmlCode variable.) The I wish to pass this htmlCode to some JavaScript function:
<body onload="populateWithHTML('<%=htmlCode%>')">
BUT! Here is the problem. This html string can contain " (quote) and ' (apostrophe) symbols, that break the resulting HTML.
How should I fix this? Thank you much in advance!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
|
server.htmlencode is a .NET method; is there a way to make it in a ordinary (non-.NET) VB and ASP?
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
check again. server.HTMLEncode exists in ASP.
|
|
|
|