|
Just use the data type Type . This is a class that contains information about a data type.
You get an instance of the Type class for the MyTableDataTable class by calling the MyTableDataTable.GetType() method.
---
Year happy = new Year(2007);
|
|
|
|
|
i created a project to save the details of employee id and their detials in a database with an extra column in table of the database to save the photos of the employees. I have also assigned the column as photo on the table definition.
Now when i run the program and when i load the image in the picture box it give me error as " External Exception was unhandled" . generic error occurred in GDI+
please help me to locate this problem and get the solution
J.D.
|
|
|
|
|
Why don't you post a related code snippet?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I think, you should use ReadStream or WriteStream to read and write picture such as with the image field you use ReadStream to read image on the database after that you set the picturebox=ReadStream, OK!
good luck
|
|
|
|
|
Hi JD
please add the following in ur code for displaying
PictureBoxName.Image=image.Fromfile(myreader("Path"))
PictureBoxName.ClientSize= New Size(x,y)
Run it see The Changes
ok
job
|
|
|
|
|
Hi all,
I am developing application in which I have 1 mdi parent and 2 child forms.
Dim chatWindow As New ChatWindow
chatWindow.MdiParent = Me
chatWindow.Show()
chatWindow.Focus()
chatWindow.BringToFront()
but chatwindow form is not come on screen it just give one flash effect when I click on chat window menu.
Why this so ...please help me.
Regards,
NAgraj
|
|
|
|
|
Hi
I am using TableAdapters in my middle layer. Now I want to hide them from my UI code. The IDE offers only 2 possible access specifiers - Public and Friend. When I set the access specifier to Friend, the compiler complains that the methods in the table adapter generated code that return a strongly typed data table cannot be exposed. The error is as follows:
********** Error start ************
Error 21 'GetConfigDetails' cannot expose type 'Vigi.DTSysConfigDataTable' outside the project through class 'DTSysConfigTableAdapter'.
********** Error end ************
where GetConfigDetails is the method in the generated code and DTSysConfigTableAdapter is the tableadapter class generated by the IDE.
The strongly typed dataset and the class that is calling it both reside in the same project (hence assembly, I assume) I am returning only the class object from the middle tier.
Any idea how I can hide the dataset(with tableadapters) from the outside world and not get these types of errors?
Shreekar
|
|
|
|
|
hi everybody,
please help me ............ I want to develope an application on my pc (database stored on server) using mysql & vb.net(Winforms).....im new in .net so anybody tell me wht should i do or give me some sample code pls its urgent.
priya
|
|
|
|
|
http://dev.mysql.com/tech-resources/articles/dotnet/
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Hi
I've tried to search for code or tutorial that shows how to make a file menu in vb express 2005.
Does anybody know where or how I can find it? I basically just need a file option at the top of the page with an open file (letting the user choose a file from the computer) and close (closing the system).
(just like the ones you see of MS word, excel etc.)
Also I would like to make my file executable so that it can run on any other computer even though they do not have vb express 2005 installed.
Thanks in advance.
Jaidev
|
|
|
|
|
jady84 wrote: Does anybody know where or how I can find it?
It is the same as any other menu. There is no difference. You just add the items and fill in the names and wire up the methods.
jady84 wrote: Also I would like to make my file executable so that it can run on any other computer even though they do not have vb express 2005 installed.
They just need to download the .NET Framework 2.0 and your exe will work.
|
|
|
|
|
Hi,
Im a little new to this, how do i actually create the menu bar (what do i have to click and drag) and how would i add items so that when file is clicked upon, the options 'open' and 'close' appears for the user to click on.
Also I have installed the .Net framework 2.0 currently my file is saved as a vb file, do i need to save it as an .exe file or something? if so how do i do this?
thanks in advance
Jaidev
|
|
|
|
|
jady84 wrote: Im a little new to this,
Maybe the best thing to do first is to pick up a book (or look up a resource on the Net) on VB.Net and you are set.
|
|
|
|
|
jady84 wrote: Im a little new to this, how do i actually create the menu bar (what do i have to click and drag)
A MenuStrip perhaps? (Why don't you create a new project, drag it on to a form and experiment with it?)
You might also want to get a book such as Step-by-step.... or ...by Example or something similar.
jady84 wrote: Also I have installed the .Net framework 2.0 currently my file is saved as a vb file, do i need to save it as an .exe file or something? if so how do i do this?
Yes, it need to be an executable file. This is created automatically when you compile the application. You'll find it in a sub folder of the project. Either Release or Debug depending on how you built it.
|
|
|
|
|
Hi All,
Plz help, Here anybody tell me how can i get query execution time through vb or SQL Server.
Regards:
SMK
|
|
|
|
|
what about
Dim timeStampBegin As DateTime
Dim timeStampEnd As DateTime
Dim timeDiff as TimeSpan
timeStampBegin = DateTime.Now()
... query ...
timeStampEnd = DateTime.Now()
timeDiff = timeStampEnd.Substract( timeStampBegin )
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Sir/Madam,
I am facing problem in selecting the data in the listview.There are two columns in the listview.I have to select both the columns and rown under it.For that I am using the following code.
For count as integer=0 to listview1.itens.count
Listview1.items.item(count).selected=true
next
But It select only one column , the data under it.
I am using the another way to get the desired output .By that is not working too.
For count as integer=0 to listview1.itens.count
Listview1.items(count).selected=true
next
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
try:
me.listview1.multiselect=treu
|
|
|
|
|
I use visual basic 2005
I have a listview on my form whit a datasourse from the dataset
so i wil see the data frorm the dataset in the listview.
When i do that the first column of the listview is empty how is that possible
I create a class called listview.vb with following code
Imports System.Data.SqlClient
Public Class ListViewData
Public Sub FillListView(ByRef MyListView As ListView, ByRef myData As SqlDataReader)
Dim lvwColumn As DataColumn
Dim itmListItem As ListViewItem
Dim shtCntr As Short
For shtCntr = 0 To myData.FieldCount()
lvwColumn = New DataColumn()
MyListView.Show()
Next
Do While myData.Read
itmListItem = New ListViewItem()
For shtCntr = 0 To myData.FieldCount() - 1
If myData.IsDBNull(shtCntr) Then
itmListItem.SubItems.Add("")
Else
itmListItem.SubItems.Add(myData.GetValue(shtCntr))
End If
Next shtCntr
MyListView.Items.Add(itmListItem)
Loop
End Sub
End Class
and the code for the form is:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myCon As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM contacten")
Dim myData As SqlClient.SqlDataReader
Dim itmListviewItem As New ListViewItem
Dim lvhHelper As ListViewData = New ListViewData()
myCon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\contacten.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
Try
myCon.Open()
sqlCmd.Connection = myCon
myData = sqlCmd.ExecuteReader
lvhHelper.FillListView(ListView1, myData)
myCon.Close()
Catch eSql As System.Data.SqlClient.SqlException
MessageBox.Show(eSql.ToString)
End Try
End Sub
Can someone tell wth is wrong ??????
|
|
|
|
|
i found the problem by myself:
Do While myData.Read
itmListItem = New ListViewItem()
itmListItem.Text = "First culums output" (this is what i write between and it works)
For shtCntr = 0 To myData.FieldCount() - 1
|
|
|
|
|
the folowing works perfect. I you want only columns you want to select from your datbase, write ("SELECT [fistname],[backname] from contacten") inplace of ("SELECT * FROM contacten")
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myCon As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM contacten")
Dim myData As SqlClient.SqlDataReader
Dim lvhHelper As ListViewData = New ListViewData()
myCon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\contactpersonendata.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
Try
myCon.Open()
sqlCmd.Connection = myCon
myData = sqlCmd.ExecuteReader
lvhHelper.FillListView(ListView1, myData)
myCon.Close()
Catch eSql As System.Data.SqlClient.SqlException
MessageBox.Show(eSql.ToString)
End Try
End Sub
---------------------------------------------------------------
End the class:
Imports System.Data.SqlClient
Public Class ListViewData
Public Sub FillListView(ByRef MyListView As ListView, _
ByRef myData As SqlDataReader)
Dim lvwColumn As ColumnHeader
Dim itmListItem As ListViewItem
Dim strtest As String
Dim shtCntr As Short
MyListView.Clear()
For shtCntr = 0 To myData.FieldCount() - 1
lvwColumn = New ColumnHeader()
lvwColumn.Text = myData.GetName(shtCntr)
MyListView.Columns.Add(lvwColumn)
Next
Do While myData.Read
itmListItem = New ListViewItem()
strTest = IIf(myData.IsDBNull(0), "", myData.GetValue(0))
itmListItem.Text = strTest
For shtCntr = 1 To myData.FieldCount() - 1
If myData.IsDBNull(shtCntr) Then
itmListItem.SubItems.Add("")
Else
itmListItem.SubItems.Add(myData.GetString(shtCntr))
End If
Next shtCntr
MyListView.Items.Add(itmListItem)
Loop
End Sub
End Class
|
|
|
|
|
hello evryone,
i have an existing application and now i need to update it in order to handle different regional setting.
can someone help me on this, or give a sample codes, or much better a dll.
thanks...
sherwin
|
|
|
|
|
hello sherwin,
with .net it is easier as you think. the gui (your forms) is representes through resx-Files and the code is in a vb-file. you can see this by activating "show all files" on top of the project explorer.
for example you have your forms in english language and you want to support german, then you only have to select each form an set the property "localizeable" to "true". after that you select the langauge and the vs-editor automaticly creates an additional resx-file to your form. you can change the ui as you like > the code file remains the same ...
but look at these links for detailed information:
www.codeproject.com/dotnet/Localization.asp
http://www.microsoft.com/globaldev/getwr/dotneti18n.mspx
http://www.google.de/search?hl=de&ie=ISO-8859-1&q=.net+localization&meta=
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Sir/Madam,
Problem is ,I am not getting to know the advantage of using the Property(Get and Set).
First i Declare the variable like
Dim str as string=""
Then , I am declaring the property as follows.
Public property funt() as string
Get
func = str
End Get
Set(byval value as string)
str = value
End set
end Property
I mean , First I am declaring the variable named str , then i am using the property(get,set).I question is y should i use the property.Isn't this just the increase in line of code.Isn't the declaration
dim str as string = ""
enough.
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
One advantage - it means you can set a breakpoint to know when your variable is accessed
another - you should try to provide only get accessors whereever possible, thus protecting your class from external tampering
another - you don't have to set a value here, you can do all sorts of other stuff, or get a value from a control.
It just gives you more control over what you expose, how it works, and how you can follow it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|