|
Perfect! Thanks for the pointer.
-P
|
|
|
|
|
Does anyone know how to create a given object given nothing but the object type? I'm trying to make a quick way to iterate through my MDI children and if the given form type is not found then i create it and return it...here is what i have so far, but it doesnt seem to work...keeps returning nothing when creating a new form:
Public Shared Function FindFormOfType(ByVal inArray() As Form, ByVal theType As Type) As Form
For Each f As Form In inArray
If f.GetType.Equals(theType) Then
Return f
End If
Next f
Return CType(theType.TypeInitializer.Invoke(Reflection.BindingFlags.CreateInstance, Nothing, Nothing, Application.CurrentCulture), Form)
End Function
-- modified at 20:41 Tuesday 1st May, 2007
Never mind guys, thanks anyways, I found a solution:
Public Shared Function FindFormOfType(ByVal inArray() As Form, ByVal theType As Type) As Form
For Each f As Form In inArray
If f.GetType.Equals(theType) Then
Return f
End If
Next f
Return CType(System.Activator.CreateInstance(theType), Form)
End Function
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Hello all,
I know it seems stupid, but i just cannot update a table of my access database.
I get an error: In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.
The parameter (and then the value of my Agentnummer textbox) has no default value
This is the code:
daAgent.UpdateCommand.CommandText = ("UPDATE Agent " & _
"SET Agentnummer = " & txtAgentnummer.Text & ", " & "Agentnaam = " & txtAgentnaam.Text & _
" WHERE Agentnummer = " & agentNummerOud)
daAgent.UpdateCommand.Connection.Open()
daAgent.UpdateCommand.ExecuteNonQuery()
daAgent.UpdateCommand.Connection.Close()
Maybee this is not the right code at all for updating a table.
Is there anyone who can help?
Thanks!!!
|
|
|
|
|
You're not putting quotes around the string.
Your code is also open to SQL injection attacks. PErsonally, I don't get why anyone uses these update command things, I thnk they suck.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
What kind of command do you suppose?
|
|
|
|
|
I would write a proper data layer, all my SQL in stored procs, and then call the methods as I needed them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Ok, i see.
There is a lot to learn for me.
Thanks for the reply.
|
|
|
|
|
Hello,
I have a form developed in VB .net2003 with SQL Server2000.
I want to work that form both in English and Arabic.Means,a form showing detais in English and it has buttons to save,Modify and Delete.when I click a button 'switch to arabic' the entire form should change to arabic and can do the same operations.
For that ,is there any change in database designing.
Can you please help me.....
Joby Mathew
|
|
|
|
|
HI
I write code to change paper size of printr to custom size and then i define my page heght and width .
Public Sub Print_It()<br />
Try<br />
Try<br />
'PrintFont = New Font("Arial", 10)<br />
Dim pd As PrintDocument = New PrintDocument<br />
'Assign my overloaded version of the standard print controller<br />
Dim dt As DataTable = MyDB.GetTableDaftar()<br />
Dim dv As New DataView(dt)<br />
dv.RowFilter = "id=" + CType(iddaftar, String)<br />
<br />
'Install event handlers<br />
AddHandler pd.BeginPrint, _<br />
New PrintEventHandler(AddressOf Me.pd_StartPrint)<br />
AddHandler pd.PrintPage, _<br />
New PrintPageEventHandler(AddressOf Me.pd_PrintPage)<br />
AddHandler pd.EndPrint, _<br />
New PrintEventHandler(AddressOf Me.pd_EndPrint)<br />
'pd.PrinterSettings.DefaultPageSettings.PaperSize.Width = pd.PrinterSettings.PaperSizes.Item(38).Width<br />
Dim pkCustomSize1 As New PaperSize("Custom", dv(0)(7), dv(0)(8))<br />
<br />
pd.DefaultPageSettings.PaperSize = pkCustomSize1 'Print the document.<br />
If pd.PrinterSettings.IsValid Then<br />
pd.Print()<br />
End If<br />
Finally<br />
'PrintStream.Close()<br />
End Try<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try
but this code does not change the printer paper size
Please help me
if possible with sample
Thanks
-- modified at 4:39 Wednesday 2nd May, 2007
|
|
|
|
|
hi everyone
i need a help ....
how can i use tab control to show datagrid because i have many tab pages that have tabABC, tabDEF, tabGHI,....etc
i want to show in each tab the letter that is related to it
i mean display the datagrid in the tabABC only the names that begins will those letters
can someone helps me please
|
|
|
|
|
I'm not sure what you're asking - you can put a datagrid on a tab page quite easily, and then yuo need to create filtered views of your data that show only the data you're hoping to view. What is your data source ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
i have data in access and i know how to show it in datagrid in one tab , but i'm looking for showing the data that begins with a, b , c in one tab and this tab has a data grid
coz as i said i has many tabs and each tab has 3 letters and all of these tabs has data grid .... but the problem i didn't know how to show only the names that begins with specific letter i know how to show it all
|
|
|
|
|
detective_girl wrote: i have data in access and i know how to show it in datagrid in one tab , but i'm looking for showing the data that begins with a, b , c in one tab and this tab has a data grid
coz as i said i has many tabs and each tab has 3 letters and all of these tabs has data grid .... but the problem i didn't know how to show only the names that begins with specific letter i know how to show it all
i want to do like this pic below.. click the link to see the pic
http://www.photolinko.com/show.php/14649_tabs.bmp.html[^]
|
|
|
|
|
So, you need to write queries that only return the records you want to show on each tab. That's just some basic SQL filtering you need to do.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
ya i know that i need queries to write, i already wrote one query in the tabABC but nothing shown in the datagrid.... i don't know why
since this morning nothing happened
actually now i don't know what kind of queries to write and where to write them in tabcontrol or in tab of each page
|
|
|
|
|
detective_girl wrote: i already wrote one query in the tabABC but nothing shown in the datagrid.... i don't know why
OK, well, it's pretty straightforward. Did your query return anything ? Did you bind the data to the grid.
detective_girl wrote: actually now i don't know what kind of queries to write
Well, I don't know what to say - your comments are all so vague. Do you mean you don't know any SQL ?
detective_girl wrote: where to write them in tabcontrol or in tab of each page
Your data layer should be seperate to your presentation layer. Then, as each tab is selected, it would have a datagrid which calls the appropriate method in the data layer.
The first step is to write and test the SQL. The second is to put methods in your data layer to call the different data base methods. The third is simply to bind the grid to the right method, according to the selected tab.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
can anyone tell me what is the best skin building software that I can Use?
Thanx in Advance
|
|
|
|
|
You haven't provided enough information for anyone to answer your question.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi could anyone please tell me how to get the size of an image on the internet, without downloading it first.
Basically I want to check if it's a certain size before I download it. At the moment I am getting the image links of a web page via the Webbrowser control and then loading each image into a picturebox control, set to autosize. If the image is a certain size , I will then save the picturebox contents to file. This is very slow though as I am downloading lots of images that aren't big enough just to check their size.
I Have seen a program called 'Get File Size' http://www.unhsolutions.net/GFS/downloads.shtml that can do this very quickly.
Thanks in advance,
Darren.
|
|
|
|
|
You can't. There's nothing in the HTTP specification for retrieving file size. You'll have to start the file download, look at the headers of the response from the server to get the size, then cancel the download.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks for that. Is that how the program 'Get File Size' would do it. They get the size back in about a quarter to half a second? Would the response come back that fast?
|
|
|
|
|
That depends on the response time of the HTTP Server, but yes, it can.
That's the only way I know of to do it.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Sorry to be a pain, but I'm just confused myself. How do I look at the headers when then response coming back is just for a jpg file in the webbrowser. I've just been trying it and I cant seen to get the file size without still loading the image?
Thanks again.
|
|
|
|
|
You can't use the WebBrowser control for this. You have to create your own using the HttpWebRequest class to make the request. You'll get back a WebResponse object that has a Headers collection property that you can examine, or you can look at its ContentLength property.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave,
Thanks for all your help. I really appreciate it.
Regards,
Darren Lee
|
|
|
|