|
Dim com As New OleDbCommand(ComStr + tabname, con1)
Dim OleDap As New OleDbDataAdapter()
OleDap.SelectCommand = com
Dim ds1 As New DataSet()
dim DT as datatble
DT = con1.GetOleDbSchemaTable(OleDbSchemaGuid.Primary_Keys, New Object() {Nothing, Nothing, tabname, "table"})
Label1.Text = DT.Rows(0).Item(0).ToString
con1.Close()
There is an error in this code.
Error: "Invalid Parameters"
Please help.
Thanks in advnce.
|
|
|
|
|
|
Here is the code
dim con1 as new oledbconnection(..connection string..)
Dim DT As DataTable
con1.open
DT = con1.GetOleDbSchemaTable(OleDbSchemaGuid.Primary_Keys, New Object() {Nothing, Nothing, tabname, "table"})
Label1.Text = DT.Rows(0).Item(0).ToString
datagrid1.datasource = DT
con1.Close()
It gives runtime error "Invalid Parameters"
Please help.
|
|
|
|
|
|
Sir, can you please let me know the code to do the needful.
I will be highly obliged.
Thanks.
|
|
|
|
|
I have upgraded a big program from VB6 to VB.NET. The program draws
and writes on some picturebox.
1) I have not well understood how to upgrade the AutoRedraw feature.
Documentation speaks sometimes about the OnPaint method of the form,
to be overridden with some refreshing instructions, sometimes about
the Paint event. For the time being I am obliged to utilise a
CommandButton triggering a refreshing routine in order to restore the
graphics when, for some unknwown reason, it disappears leaving a blank
page.
2) The ToolTip textbox has a strange behaviour on my picturebox: first
time it is displayed and then moved, the underlying graphics is not
restored. Subsequent appearance of the textbox runs correctly
Any help available?
Thank you
Leonardo Presciuttini
|
|
|
|
|
how do i send SMS from landline to cell phone in VB6
|
|
|
|
|
Google for "VB6 SMS"[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know anything about AppConfig files and how to integrate them into a SQL application because it is the only way i can think of to install my app on other computers and somewhat painlessly setup the connection string for the app. I know nothing about XML. HELP ME
|
|
|
|
|
Right click on your project, select "Add -> New Item" and select "Application Configuration File". Make sure it is called "App.Config".
On your application drag from the toolbar to your form a "SqlConnection" object. View properties of SqlConnection object and select "Dynamic Properties" then Check the default "Connection String".
Next, create a connection string and save all.
By now you should see in "App.Config" a key value pair that is added for your SqlConnection object and its connection string.
To read from your code:
using System.Configuration
myConnectionString = ConfigurationSettings.AppSettings("your key name")
|
|
|
|
|
I you want to do this in code (versus the IDE) let me know, or, if you need XML that you can read AND write from code (like by screens from user input) let me know.
I have some real-work examples.
If the IDE workds for you - great.
Good luck - Len
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
This is how u have to place ur connectionstring in your app.config file.
<configuration>
<appSettings>
<add key="DBConnString" value="Data Source=ervername;Initial Catalog=Databasename;User ID=userid;Password=password;"/>
</appSettings>
</configuration>
For accessing this value from DB you can use this line of code in vb.net (in case of C# hope u can manage it, or ask me)
Public Shared CONNECTSTRING As String = System.Configuration.ConfigurationSettings.AppSettings("DBConnString")
Hope its fine and ur prob is solved.
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|
|
|
|
|
|
i m trying to stream media files on VB.NET interface using Windows Media Player component.. but its not being played..
well, i hav tried embedding the windows media player component on the WebApplication.....it is appearing on the client side but it is not able to play any files...... and we are not able to even select any controls provided in the player...
we are using Windows 2000 Advanced Server as OS.
actually we dont ve much idea about how streaming takes place on the internet and do we need to add any other codec or component to achieve Media Streaming ???
waiting for replies.
thanks..
|
|
|
|
|
I wrote a vbscript that closes Internet explorer windows. The main reason i'm doing it this way it to get the LocationURL property of the objIE object before I call Quit on it.
The problem is that not all windows close this way.
Any suggestions?
<br />
Set objShell = CreateObject("Shell.Application")<br />
Set objShellWindows = objShell.Windows<br />
dim i, nCount<br />
nCount = objShellWindows.Count<br />
nCount = nCount - 1<br />
<br />
for i = 0 to nCount<br />
dim objIE<br />
<br />
set objIE = objShellWindows.Item(i)<br />
if (not objIE is nothing) then<br />
objIE.Quit<br />
end if<br />
next<br />
|
|
|
|
|
What do you mean by "not all windows close this way"? Are you talking about close JUST the IE windows or all applications? Also, before you close the IE window, you might want to try checking the .Busy property and wait until the borwser window is finished. I'm not syaing that this will solve the problem, but it might...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was wondering if there is a way in VS.net to setup site templates similar to how you accomplish this in Dreamweaver, for example, so that you could make changes to one page that would propegate to the other pages of the site as well...
Anyone know how to do this???
I actually tried setting templates up in Dreamweaver and then doing my dynamic code in VS.net, but when I made changes in VS.net and tried to go back to Dreamweaver and make changes to the template, i get errors....
Thanks
cavall
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
Your question belongs in the ASP.NET Forum. It is possible to do this in ASP.NET 2003, but it gets much easier to do in 2005.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello, I write my vb.net class and I want that when another developer will be use my class the VS 2003 show a small help that say the meaning of the methods, something like the functions that VS incorporate. For example, when I write me.text VS show us a small tips that say the meaning of text in this object. Then my question is Can I do something like that?
Thanks, and excuseme but my english is very very very bad.
|
|
|
|
|
Basically you want the feature that is already available in csharp.net. Unfortunately that feature is not available in VB.net; however, I verified that this feature works with VS2005 Beta.
Anyway, to show tooltips of your methods for next VS2005 version, just add the following xml text before you declare any method:
your class description
I suggest you look for information about VBCommenter which automatically adds the tags you need and then learn to use NDoc to automatically create help files like the ones from Visual Studio.
|
|
|
|
|
I have a program that when i double click on him the form will automatically loads from the textfile and if its empty a registration form appears. now i want that if the user didn't enter any details in the textbox of the registration and he closes the reg form, the program will not crash unless he input a data in the textbox. how can i make this??
PsYcHo_A
|
|
|
|
|
Let me make sure I understand. You wrote a program and have it running on a computer. When you double click on the program's icon to start it, a form loads and gets information from a text file. If the text file is empty, a registration form loads. If the user does not enter any information on the registration form and closes it, the program crashes. You want to know how to prevent it from crashing, is that correct?
|
|
|
|
|
yes please!! thats correct!! how please?
|
|
|
|
|
How are you opening that registration form? How are you closing it?
You SHOULD be opening the registration form using .ShowDialog() , not .Show() . .ShowDialog() can return a DialogResult that can tell your main form how the registration form was handled, whether the registration was successfull or not. Without seeing your code, we can't tell you what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
THIS IS THE PROGRAM FORM:
Private Sub frmBudget_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strLoadText As System.IO.StreamReader
Dim strtext As String
strLoadText = New System.IO.StreamReader("C:\Documents and Settings\PsYcHo_A\My Documents\Visual Studio Projects\Budget Program\Registration.txt")
Dim obj As New Register
strtext = strLoadText.ReadLine
strLoadText.Close()
If strtext = "" Then
obj.ShowDialog()
strLoadText.Close()
End If
If strtext = "" = False Then
strLoadText.Close()
Dim sr As New System.IO.StreamReader("C:\Documents and Settings\PsYcHo_A\My Documents\Visual Studio Projects\Budget Program\Transactions.txt")
Do While sr.Peek <> -1
lbLM.Items.Add(sr.ReadLine())
Loop
sr.Close()
End If
strLoadText.Close()
strLoadText.Close()
End Sub
Private Sub frmBudget_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Dim strLoadText As System.IO.StreamReader
Dim strtext As String
strLoadText = New System.IO.StreamReader("C:\Documents and Settings\PsYcHo_A\My Documents\Visual Studio Projects\Budget Program\Registration.txt")
Dim obj As New Register
strtext = strLoadText.ReadLine
strLoadText.Close()
If strtext = "" Then
obj.ShowDialog()
strLoadText.Close()
End If
If strtext = "" = False Then
strLoadText.Close()
Dim sr As New System.IO.StreamReader("C:\Documents and Settings\PsYcHo_A\My Documents\Visual Studio Projects\Budget Program\Transactions.txt")
Do While sr.Peek <> -1
lbLM.Items.Add(sr.ReadLine())
Loop
sr.Close()
End If
strLoadText.Close()
strLoadText.Close()
End Sub
|
|
|
|
|
I am very new to using VB.NET. I need to be able to open a .doc or .dot file in my VB.NET program, write to that document and save as a different document. I am using .NET 2000 and MS OFFICE 2003 WORD. What I have created is a program to allow you check boxes for the items you want to add to the Word document, edit a template/document you have loaded and save as new document. I need specific code that will allow you to open, edit and save a .doc or .dot file. Any help given is greatly appreciated. Also, if I need to have MS Office 2000 I have it so I can load it as well.
J. scott Gleaton
J. Scott Gleaton
|
|
|
|