|
There is no significant difference other than personal preference.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
plesse help
Date wont be seeen in db(access)properly
sujit
|
|
|
|
|
Hi
I have a problem with Date-Time Picker Control
I wnat to use the datetime control in my application
and save that date in Ms Access db
but the date won't be displayed in db properly
It simply display as e.g. 12/9/1899
i wnat the current date
if u have the solution Please send it as early as possible
to
sujit.jadhav@rediffmail.com
patilsushant001@yahoo.com
the current code(Not working)is as follows
dbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\sushant\Irrigation\Irrigation\dbIrrigation.mdb;")
dbConnection.Open()
strCmd = "insert into Pani_Vapar values(" & intRec & "," & CInt(txtSocNond.Text) & ",'" & dtSocNond.Value.Date & "','" & txtSansthaNav.Text & "'," & CDate(dtYojHasthDin.Text) & ")"
dbCommand = New OleDbCommand( strCmd, dbConnection)
dbCommand.ExecuteNonQuery()
dbCommand.Connection.Close()
sujit
|
|
|
|
|
Access doesn't use the same Date/Time format as the .NET Framework. When you use the DateTime picker control, it returns a .NET Framework DateTime object. To get an OLE Automation compatible DateTime, just use the .ToOADate method of the DateTime object you get from the picker control.
Dim myOADate As Double = DateTimePicker1.Value.ToOADate()
You can then use the myOADate version in your Access database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i am trying to write program to get all users in the local server.how can it possible.in that i got server name and my system user.
imports system.net
imports system.operatingsystem
Environment.getenvronmentvariable("logonserver")
Environment.getenvronmentvariable("username")
greetings
|
|
|
|
|
Are you asking if you can get the list of Local User Accounts on the machine?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am trying to write a program which allows a user to enter a filename in a text box and when they click an Open button the only file to appear in the FileDialogBox is the one they have entered even if there are more than one type of the file extension in the folder. For example:
File types are .txt
Numerous .txt files in directory
"test" is entered in the text box.
Click Open
the only file to show up is "test"
Does anyone have any ideas on how this could be done in VB.net
|
|
|
|
|
You specifications are a little strange, but if you really wanted to put up the FileOpen dialog box with only a single file in it, then you could put the filename from the textbox into the .FileName property of the OpenFile Dialog before you dispaly it.
Dim myOFD As New OpenFileDialog()
myOFD.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
myOFD.FilterIndex = 1
myOFD.CheckFileExists = True
myOFD.FileName = TextBox1.Text
If myOFD.ShowDialog() = DialogResult.OK Then
' Your code to handle a successful filename pick goes here.
Else
' Your code to handle a Cancel goes here.
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I hv found a few probelms recently.
1.About the text file
Having done a series of experiments, i found out that the program can read a text file with the file name provided only. However, the program can read the textfile without the path proveided only when the files and the program are in the same directory.(quite similar to pascal) Therefore, i would like to ask whether there is a method that can "package" the program and the files together so that the player do not need proveide the path of the file for the program to read.
( P.s If this problem can be solved by "packaging", it will be very convenient!!)
2. About the form
If there are two forms called A and B. When A is run , and i click a button in A, then B will be shown.
How can i prevent players inputting things in A when B is shown ? (Just for interest)
3. About refresh the whole program
If the player has won the game and he wants to start a new game, can i just refresh the program and show the new game instead of asking the player to quit and start the program again?
I hv thought about calling those "Private Sub" (<== are they procedures?) , However it failed to do.
I tried to call those "Private Sub" using this code:
Call Form1_Load ()
But the VB said that there should be some parameters or sth else to add. (Actaully , i dun know wut is it talking about?)
Can you tell me another method to call a procedure(or those "Private Sub")?
Please give some solution for my problems as soon as possible!!! Thx !!!
|
|
|
|
|
Answer 1:
You can embed the text file as a resource in the assembly and can access the file using ResourceManager.
Answer 2:
Show the Form B as Model Dialog and set Form A the parent for Form B so that user cant input to Form A till he close the Form B
|
|
|
|
|
hey! good day to all.. i have an mfc dll function that returns a LONG type... but what it really returns is an HRESULT.. im calling this function in a vb app.. i was just wondering if there is a way i can get the exact value of the HRESULT type...like for an example.. S_OK.. instead of digits of numbers in LONG type.... there is no declaration of type HRESULT in vb.net... tnx in advance....
|
|
|
|
|
HRESULT returned by any Microsoft API call is an Integer in VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Actually, it might be an IntPtr DataType...
|
|
|
|
|
You can use either. Most of the time, I use IntPtr myself, but if your going to do any kind of calculation with the return code, for whatever reason - it depends on the call, you can't use IntPtr.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I do agree that you need to code the API Call as neccessary and I only use IntPtr when it's neccessary. However, I would disagree, you can easily get the Interger Value from an IntPtr.
Dim h As IntPtr = IntPtr.Zero
Debug.WriteLine(h.ToInt32)
Dim h2 As New IntPtr(h.ToInt32)
|
|
|
|
|
That's true. I just avoid the conversion code for simplicity. I can be a bit lazy at times...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you guys.. now i know what to do with the return... hehehe... thanks again!!!
|
|
|
|
|
I would like to use visual stiduo and ado.net to display the results on the asp.net web form, but i just don't know how to start the program.I have the theorical information but is difficult to do the practical.
s.l Mosoane
|
|
|
|
|
You've asked the most generic question I've seen in months. What do you want to do? SO far, all you've said is "Help!". With what? You've given no specifications of what your app is supposed to do, code your stuck with, no design attempts, ..., nothing that would help us help you.
I guess you can start with Beginning ASP.NET using vb.net[^] here on CP. Then maybe buy the book for the rest.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try to read the information from www.asp.net[^].
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I’m trying to download and upload data to a Microsoft access database. But cant even get my head round starting to figure it out.
Any help or nudge in the right direction would be excellent and would make me very grateful.
RandyD
|
|
|
|
|
I guess you can start with How to link to an Access Database in a C# Application[^] here on CP. The code is, obviously, in C#, but is easily convertable to VB.NET either by-hand, or using various translators on the 'Net.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to do I navigate to another list in a DataList. I only want one record perpage. I have been searching
for an answer and I have come up with nothing. If anyone has any ideas please share them with me. I would
so apprecitate it.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Data.Odbc;
using System.Text;
namespace MSPOS
{
///
/// Summary description for Objects.
///
public class Objects : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataList myDataGrid;
protected System.Web.UI.HtmlControls.HtmlForm Form1;
private DataSet ddlDataSet1 = new DataSet();
private DataSet ddlDataSet = new DataSet();
protected Int32 _currentPageNumber = 1;
protected int PageSize = 1;
public void Page_Load ( Object sender, EventArgs e )
{
if ( !Page.IsPostBack )
{
BindData();
}
}
public void BindData()
{
OdbcConnection myConnection = new
OdbcConnection("DSN=POS;UID=system;PWD=system");
myConnection.Open();
// get records from the table
string commandString = @"SELECT CM_REF, CM_DESCRIPTION,
CM_OBJECTNAME, CM_TIMEOUT, CM_TYPE, CM_CONTENT, CM_PREPARED, CM_CONNECTION FROM
TBCOMMANDS";
// Set the datagrid's datasource to the datareader and databind
// Create a OdbcCommand object and assign the connection connect to
the database
// Create a OdbcCommand object and assign the connection connect to
the database
OdbcCommand command = myConnection.CreateCommand( );
command.CommandText = commandString;
command.Connection = myConnection;
// Create the Reader and bind it to the datagrid
OdbcDataReader reader =
command.ExecuteReader(CommandBehavior.CloseConnection);
ddlDataSet.DataSource=reader;
ddlDataSet.DataBind();
reader.Close();
reader=null;
myConnection.Dispose();
}
private void InitializeComponent()
{
this.myDataGrid.SelectedIndexChanged += new
System.EventHandler(this.myDataGrid_SelectedIndexChanged);
}
private void MyDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)
{
}
private void myDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)
{
}
}
}
Thank You for Your Time,
Matt
|
|
|
|
|
You might want to post your question the ASP.NET Forum. You'll get a better result there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Each time I try to create an ASP.NET Web Application I get the "Web Access Failed" dialog box...IIS is installed and running correctly, however I keep getting the following error message:
The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/WebApplication1' cannot be opened with the path 'c:\Inetpub\wwwroot\WebApplication1'.
Can anybody explain why i keep getting this? IIS is running correctly and so are the rest of my Visual Studio .NET applications...I only get this when I try to create Web Applications...
Thanks
|
|
|
|