|
Pass the textbox & cm_intCompare as parameters into the function.
Example:
Public Sub Process(Byval txt as TextBox)
txt.Text = "Test"
End Sub
Mike Lasseter
|
|
|
|
|
Please help me
I 'm developping a vb.net application .I create with wizard connection to a Ms access database and i have created all the forms with datagrid , listboxes ... all bounded with tables in this dataset.
the problem is : Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month.
How to change the connection string at runtime from one database to another.
i repeat that databases are identical.
Thank you in advance !
|
|
|
|
|
mysybet123 wrote: Every month is created a new empty ms access database identical with the first one .This new month i want to connect the program with new databse and work with it .This procedure repeat every new month.
Doesn't sound like a very efficient thing to be doing.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
As Paul wrote, it does seem a little odd to be doing what you want to do. I'm sure you have your reasons.
A couple of options for you:
1. Your database name remains static, and when you launch the application in a new month, it renames your current database to something else, and creates/copies your blank database in its place. This way, you always connect to a database with the same name.
2. You declare a string variable (strMonth), and then have some code that decides which month you are in, and assigns a value to strMonth - so if you're in July, strMonth = "July". You then connect to strMonth, and not a specifically named file. An array of months might be an efficient method of doing this.
|
|
|
|
|
Thank you for your responses.
But there is a problem : there are 2 ore 3 users in network running this program and this users may work with different month database at the same time (these databases are located in one computer) .And i want to make possible that users can connect to the database they want.
( i have make this thing very easy in Ms Access but for some reasons i want to make a front-end in vb.net)
Someone tell me to change the My.Settings.Connection String but i don't know how to do it.
Thank you
|
|
|
|
|
Is the database structurally the same from month to month? I am still very bothered by the scheme of having a new database every month. If the structure is remaining the same, you can mark the records/rows based on what month it belongs to. This would get rid of having multiple databases and multiple connection strings...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Thank you !
The database structure is the same but the number and the size of records in a month is very large and if i take only one database after 2 ore 3 months the database size can reach the size limit of Ms Access database ( 2 Gb or i'm wrong !!!).
Now i'm thinking to connect in runtime and i think it's easy to change the database.
|
|
|
|
|
What kind of data are you going to be putting in the database to make it grow that large so fast?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I'm writing a program that copys a file, but if the targfetfile already exists i want a replace form, preferebly just like windows own. I've googled my a-s of to find such a thing, but no luck so far. I've made one by my own, but it's not as good as the original. Help would be appreciated.
|
|
|
|
|
No, there isn't. The best way to do it is to do what you've already done, create your own.
|
|
|
|
|
I have just installed Visual Studio 2005 on my machine and when I try to create a Web Project I get the following error message -
"Unable to create the Web...Could not find a Web Server."
My machine is running XP Pro and has Visual Studio 2003 previously installed, ASP.Net 2 is also installed.
2003 is working correctly and I can create a Web site with this.
I have set the ASP.Net version to 2 in the IIS properties.
Thanks
David
|
|
|
|
|
Have you had sure IIS is running?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
hi everyone
i want to have on my form my ip when i load it , i want it to be writen on a label
can someone help me to do that
thank you all
|
|
|
|
|
this should do the trick
Imports System<br />
Imports System.Net
Dim ipEntry As IPHostEntry = Dns.GetHostByName(My.Computer.Name)<br />
Dim IpAddr As IPAddress() = ipEntry.AddressList<br />
Dim i As Integer<br />
For i = 0 To IpAddr.Length - 1<br />
MessageBox.Show(IpAddr(i).ToString)<br />
Next i
hope it helps
|
|
|
|
|
|
hi... i am using vb.net 2003. i made a code to upload a file with the help of "file field control". everything is working fine but i just want to restrict the type of file type be uploaded i.e.i want the user to browse only for xls file. how this can be done??? thnx in ad
|
|
|
|
|
if you're usen an openfiledialog enter the folowing in the filter property:
excel files|*.xls
if you're not using the openfiledialog I'm afraid you'll have to code it and check every filename if it ends with ".xls"
hope this helps
|
|
|
|
|
Hi try the folllowing code.........
string sFilePath;//path of the file
string[] sSeperate;//get the exact name of file without extension
int iarrLength;//get the exact name of file without extension;resets the count
string sExtension;//get the extension of the file.
sFilePath = FileName;
sSeperate = sFilePath.Split('.');
iarrLength = sSeperate.Length - 1;
sExtension = sSeperate[iarrLength].ToString().ToUpper();
if (sExtension.ToUpper().Equals("XLS"))
{
//put your code here
}
else
{
MessageBox.Show("Invalid file selected!");
}
Warm Regards.........
NB:Please score if it is worth.........
Sebastian
|
|
|
|
|
IMO that would be insufficient: it sets a filter on what is initially shown, but not on
what is selectable.
Example: start with some filer, type *.* in the textbox for filename, click the open button,
it will now show all files in that folder, select a file, click open again; not that file
is selected, whether it fits the original filter or not.
So you should check afterwards as Sebastian indicated.
|
|
|
|
|
Hi there,
Is there a way to determinate the cursor type of a recordset using the .Execute command of a ADODB.Command object? If you use a ADODB.Recordset object, you define the cursor type like this:
myRecordset.Open mySQLCommand, myDatabase, adOpenKeyset
I now use stored procedures in my DB and I still want to set the cursor type to OpenKeyset, if that is possible...
Thanks, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
The cursor type won't change. Your SQL is still returning that same recrodset no matter if it's done by stored proc or by a SQL statement you pass in.
|
|
|
|
|
i have some errors while implementing stored procedure for sql server 2005 in my web form which i have design using vb dot net 2005. my code is like this:
i have made stored procedure like this:
ALTER PROCEDURE UpdateMemberInfo
@FName varchar(50),
@LName varchar(50),
@Password varchar(50),
@MemberName varchar(50)
AS
update T_Members set FirstName = @FName,LastName = @LName ,Password = @Password where MemberName = @MemberName
RETURN
Now i have to call this stored procedure in the click event of the button. So, i put the code like this in the button:
co.startconn()
cmd = New SqlCommand("UpdateMemberInfo", co.oConn)
cmd.CommandType = Data.CommandType.StoredProcedure
Try
para = New SqlParameter("@FName", fname)
cmd.Parameters.Add(para)
para = New SqlParameter("@LName", lname)
cmd.Parameters.Add(para)
para = New SqlParameter("@Password", pass)
cmd.Parameters.Add(para)
Catch
Response.Write(Err.Description)
End Try
Try
cmd.ExecuteNonQuery()
Catch
Response.Write(Err.Description)
End Try
But still there is error like this:
Procedure or function 'UpdateMemberInfo' expects parameter '@FName', which was not supplied.
suchitamanandhar@hotmail.com
|
|
|
|
|
It looks like you forgot to add the @membername parameter before calling your stored procedure.
Ben
|
|
|
|
|
You didn't supply any datatypes for these parameters, essentially letting the Parameters objects "guess" at what they are supposed to be. Be specific in your parameter declarations:
cmd.Parameters.Add(New SqlParameter("@FName", SqlDbType.VarChar, 50)).Value = fname
On top of that, you also didn't supply the @MemberName parameter.
|
|
|
|
|
Hi,
I have been struggeling to find a good way to merge my two collections.
The collections that is to be merged contains "From Time and To Time".
FIRST COLLECTION:
0700-1200
1200-1700
SECOND COLLECTION:
1100-1200
1300-1500
RESULT COLLECTION:
0700-1100
1100-1200
1200-1300
1300-1500
1500-1700
The second time the procedure is visited the first collection is like the result, and I only want to verify that the second collection is still correct merged with the first.
The procedure i made is complex and almost impossible to debug, and not reliable.
So please, please, can someone help me out here?
Regards
Svein Thomas
|
|
|
|