|
no problem dude.
just create 2 query n store them in 2 seperate variable.
say
Dim q1 As String="SELECT * from table WHERE id=2"
Dim q2 As String="SELECT * from table WHERE id=2"
Dim cmd1 As New SQLCommand(q1,conn) 'conn is ur connection
Dim cmd2 As New SQLCommand(q2,conn)
Dim da1 as New SQLDataAdapter
Dim da2 as New SQLDataAdapter
da1.selectCommand=cmd1
da2.selectCommand=cmd2
Dim ds1 As New DataSet
Dim ds2 As New DataSet
da1.Fill(ds1)
da2.Fill(ds2)
' ur dataset populated
' show them
DataGrid1.DataSource=ds1
DataGrid2.DataSource=ds2
Hope that helps.
this is not the end, this is how its goin to begin !
|
|
|
|
|
Does anybody know if there is a function
like the one in excel for vlookup.
;);P
|
|
|
|
|
Dim lookupTable As New HashTable
lookupTable.Add("KeyName", "Value")
lookupTable.Add("KeyName1", "Value1")
lookupTable.Add("KeyName2", "Value2")
lookupTable.Add("KeyName3", "Value3")
Dim value = lookupTable.Item("KeyName")
My Blog[^] FFRF[^]
|
|
|
|
|
I am creating a simple form that requires additional information before being displayed.
What I want to do:
Override ShowDialog(owner) with ShowDialog(owner, string0, string1) As DialogResult
That part is easy.
What I want to do is prevent the use of ShowDialog() and ShowDialog(owner).
Naturally, there are many ways to accomplish what I am trying to do, but I really want to know If I can do this. Is there a way to override these methods (or some other way) so that thay may not be called on my custom dialog?
Thanks
-mE
|
|
|
|
|
Guess I didn't pound my keyboard long enough. Kept looking and I found it. Use "shadows" instead of "overrides" and it does exactly what I wanted.
-mE
|
|
|
|
|
I use DB2 under AS/400 and the “SLTFORMULARIO_MG” stored procedure really exists.
Ok... because we don’t have that much time to spend, I tried another solution. I did remove the link between the stored procedure and the RPT file and so, I did set up one xml datasouce. So, I putted the stored procedure returns into a dataset and did use as:
<br />
oRpt = New ReportDocument<br />
oRpt.Load(_sFileRPT)<br />
<br />
oRpt.SetDataSource(_dtDados)<br />
Ok, the code ran nice and quickly, but because I can go to heave straightway. I still have a problem when using formulae to perform calculation. I got this damn error:
MENSAGEM DE ERRO:
A number, or currency amount is required here.
Error in File C:\DOCUME~1\BRRIOW~1\ASPNET\LOCALS~1\Temp\PEDIDO_SA {8885AC00-192E-4A1D-9E2A-A38289AEA818}.rpt:
Error in formula <UNITxVALOR>.
' ({SLTFORMULARIO_SA.PRECO_UNIT}) * {SLTFORMULARIO_SA.QTD_PEDIDA} '
A number, or currency amount is required here.
STACK TRACE:
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
Right, Right, I did many tests and when I changed the code from:
({SLTFORMULARIO_SA.PRECO_UNIT}) * {SLTFORMULARIO_SA.QTD_PEDIDA}
To:
({SLTFORMULARIO_SA.PRECO_UNIT}) + {SLTFORMULARIO_SA.QTD_PEDIDA}
It was fine, except from the fact that it was catenated instead of added.
Anyone could, please, help me up?
|
|
|
|
|
I am attempting for the first time to link Crystal reports with VB.Net and having a wee bit of trouble. I have provided some code I have done but for some reason it is not recognising....
Dim cr As New ReportDocument
What reference have I missed out and what is the best way to do such a thing. Any help, ideas would be gratefully appreciated.
Dim DA As OleDb.OleDbDataAdapter
Dim DS As New DataSet
Dim strSQL As String
strSQL = ""
strSQL = "SELECT EmployeeID, LastName, FirstName FROM EMPLOYEES"
DA.Fill(DS, "Employees")
'Verify the path to the Crystal Report's .RPT file
Dim strReportPath As String = "C:\Temp\crystalreport1.rpt"
'Load the Crystal report's .rpt file and pass in the data table
Dim cr As New ReportDocument
cr.Load(strReportPath)
cr.Setdatasources(DS.Tables("Employees")
|
|
|
|
|
Using the MAPI control to send email with outlook is easy enough to set up, but whatever you send as body text gets sent as-is. I am trying to get HTML to work in the messages i send, but it seems outlook will paste the message into the text section, and will not update the source section. As i am attempting to make a program for easy email generation for a email based game, i need some way for it to generate the email with the html in-tact. does anyone know any way of doing this.. there is a MsgType command, i beleve, but VB does not show a list of what can be typed after it to modify it, where it is just a control.
"Love, Life and Option Explicit"
|
|
|
|
|
How do I make a program that search through a site(like http://www.codeproject.com) and if a word is on that site it displays a messagebox(if the word new is in line 6 of http://www.codeproject.com the script msgbox ("There is something new!!!" , , "NEW") comes)
Thanks
|
|
|
|
|
For searching text , you can use Microsoft Index Server .Using it in code will return the pages in site where a particular word exists . But i m not sure if it can return line number . But after getting list of documents in search , perhaps a function can be writeen to find line numbers in those pages
Divya Rathi
|
|
|
|
|
Gentlemen,
I'm using VB6 and SQL Server 2000 I want to know if there is anyway
to use a digital camera in my VB project?.
Maybe let me take the picture via VB or taking it directly to the camera.
Thanks a lot
|
|
|
|
|
I have a memo field (multi line text box) and I want to be able to spell check it? Any Suggestions
|
|
|
|
|
the easiest way to do is download google toolbar. or you can use word object and use spell checker component. well honestly i was in process of using word spell checker but i had lil trouble and thought why not use google tool bar instead of wasting time on figuring out why it didnt work.
robin
|
|
|
|
|
Is there a way to check spelling for a windows application?
|
|
|
|
|
iwant to use the agent control to show error messages.....also the speech ballon ust contain a ok button like it is in the msgbox....please help
|
|
|
|
|
There are some excellent examples on the MSDN website where the MS Agent download resides.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
I'm trying to create a logon script that copies three icons from network drives and then places them on the suers desktop on logon. I can copy the icons fine as administrator, but under anyone elses logon name, i get access denied errors becuase only administrator has write control to the C:\Documents and Settings\All Users\Desktop folder.
What Im trying to do is get the username inserted into the filepath by the script. somethig like this:
'Creating a shell object to launch applications<br />
Set WShell = CreateObject("WScript.Shell")<br />
<br />
'Creating a network object to gather AD Username Data<br />
Set objNet = CreateObject("WScript.NetWork") <br />
<br />
<br />
user = objNet.UserName<br />
ComputerName = objNet.ComputerName<br />
<br />
'Mapping Network Drives<br />
Set objNetwork = CreateObject("WScript.Network")<br />
objNetwork.MapNetworkDrive "P:" , "\\corp-fs1\apps"<br />
objNetwork.MapNetworkDrive "M:" , "\\corp-fs1\data"<br />
<br />
'Copying Prodent, Lsap, IntelMS<br />
strFilePath = "P:\prodent\apps\public\prodent\shortcut to prodent.lnk"<br />
strDestination =("C:\Documents and Settings\" & user & "\Desktop\")<br />
<br />
<br />
<br />
Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
<br />
<br />
<br />
Set objFileCopy = objFSO.GetFile(strFilePath)<br />
' Copy the file to its destination<br />
objFileCopy.Copy (strDestination)
I need strDestination to = C:\Documents and Settings\ *username*\desktop
Any ideas on how to do this?
"A child of five would understand this! Send someone to fetch a child of five!"-Groucho Marx
|
|
|
|
|
Just inserting the user's ID into the path is an unreliable method to generate the CORRECT path. Occasionally, Windows can switch the user's profile folder, creating a new one with a different name.
Get the value of the USERPROFILE environment variable, then append the path you want to that:
Dim WshShell, Path
Set WshShell = WScript.CreateObject("WScript.Shell")
Path = WshShell.ExpandEnvironmentStrings("%USERPROFILE%")
Path = Path & "\Desktop"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have taken two windows application forms. i want the values of Sub1,Sub2,Result textboxes to be inserted automatically into the related textboxes of the other form, as soon as i click the redirect button in form1?
|
|
|
|
|
use
shared s1 as string
and then in form2_load
sub1.Text=objForm1.s1
Note:
objForm1 should be Globally visible inorder to access it in form2's object
or
You can declare
shared objForm1 as New Form1()
|
|
|
|
|
I am trying to drag a metafile (.wmf) from eg. ms word into a vb 2005 app. When it is dropped on a diagramming control, I want to set the image of an object I create to the dropped image.
The dropped object has loads of DataFormats available, this works fine:
Dim bm As Bitmap = e.Data.GetData(DataFormats.Bitmap)
but now the image is a bitmap, no longer a vector graphic.
'Getting' a MetafilePict object somehow always returns a MemoryStream object, so I thought I had it cracked by using:
Dim ms As IO.Stream
ms = e.Data.GetData("MetafilePict", True)
Dim img As Image = Imaging.Metafile.FromStream(ms, True, True)
But this just generates an 'Invalid Parameter' error. Any ideas here would be much appreciated
|
|
|
|
|
I want to download free transparent bitmaps (images for menu, and toolbar for a small word processing application.)
Can you show me a link?
transparent bitmap = a bitmap which has a transparent background
chatura
|
|
|
|
|
Hi all,
I really need to convert the C# code below into VB. If possible can advise me where is the most approriate place to place this portion of code. The code is to wire the parent datagrid for the ItemCreated event and ItemDataBound event.
Please help me.
private void InitializeComponent()<br />
{<br />
this.load += new System.EventHandler(this.Page_Load);<br />
this.dgRegion.ItemCreated += new DataGridItemEventHandler(dgRegion_ItemCreated);<br />
this.dgRegion.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgRegion_ItemDataBound);<br />
}
Thanks in advance,
Chiari
|
|
|
|
|
Private Sub InitializeComponent()
Me.load += New System.EventHandler(Me.Page_Load)
Me.dgRegion.ItemCreated += New DataGridItemEventHandler(dgRegion_ItemCreated)
Me.dgRegion.ItemDataBound += New System.Web.UI.WebControls.DataGridItemEventHandler(Me.dgRegion_ItemDataBound)
End Sub
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
Jereme Watts
|
|
|
|
|
Hi Watt,
Thanks for conversion. However I can't use these codes. It gave me errors. Please advise.
Thanks in advance,
Chiari
|
|
|
|