|
Are you saying that he wants the menu and toolbars down the right hand side and the status bar down the left? Or does he just want the form wider than it is high?
|
|
|
|
|
I think I have tought of a better option..
for each form I will create a user control.. and then call that user control on their main forms... suppose for Menu i will create frmMenu and this form will have one user control as uMenu.. each and every control will be placed in this uMenu.. and this uMenu will be draged on frmMenu...
sorry.. can we rotate a single control by 90 degrees counter clock wise and adjusts its height and width as per its main form, I mean to say can we Anchor it?
Thanks and Regards,
|
|
|
|
|
Looking at this I don't think it is possible. I would question what is the purpose of rotating everything through 90 degrees; the only answer I can think of is that the user will be lying down to use this application!
Or have I missed something?
|
|
|
|
|
My computer is connected to a remote server using a socket.The server sends a movie.....and i want to play that movie client computer.
i want to play it as it comes through the socket.
I managed to resolve socket connection,but i don't know how to play those incoming bytes live.
(suppose i am reading .mpeg file as binary mode on server and sending 2048 bytes(buffer). These received 2048 buffer play on client computer at runtime. and next time plays another 2048 buffer not previously received.)
Plssss help
|
|
|
|
|
Hi,I'm working with vb.net how to store date to MSAccess database through vb.net coding
|
|
|
|
|
Create a database named Emp in Microsoft Access in the C: drive of your machine. In the Emp database create a table, Table1 with EmpNo, EName and Department as columns, insert some values in the table and close it. Open Visual Studio .NET, on a new form drag three TextBoxes and a Button. The following code will assume that TextBox1 is for EmpNo, TextBox2 is for EName and TextBox3 is for Department. Our intention is to retrieve data from Table1 in the Emp Database and display the values in these TextBoxes without binding when the Button is clicked.
Code for retrieving records
Imports System.Data.OleDb
Public Class Form1 Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e as _
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Button1.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;_
Data Source=C:\emp.mdb;")
'provider to be used when working with access database
cn.Open()
cmd = New OleDbCommand("select * from table1", cn)
dr = cmd.ExecuteReader
While dr.Read()
TextBox1.Text = dr(0)
TextBox2.Text = dr(1)
TextBox3.Text = dr(2)
' loading data into TextBoxes by column index
End While
Catch
End Try
dr.Close()
cn.Close()
End Sub
End Class
Code for Inserting a Record
Imports System.Data.OleDb
Public Class Form2 Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Button2.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;")
cn.Open()
str = "insert into table1 values(" & CInt(TextBox1.Text) & ",'" & TextBox2.Text & "','" &_
TextBox3.Text & "')"
'string stores the command and CInt is used to convert number to string
cmd = New OleDbCommand(str, cn)
icount = cmd.ExecuteNonQuery
MessageBox.Show(icount)
'displays number of records inserted
Catch
End Try
cn.Close()
End Sub
End Class
You can refer the complete article from
http://www.startvbdotnet.com/ado/msaccess.aspx[^]
For detailed study, study OleDb data Provider
|
|
|
|
|
I have wrote an app in vb to run at 30 min intervals on a HTC 6500 with WM6.
I have used the CeRunAppAtTime function to close the app and reopen in 30 mins time, this works fine up until the device goes into suspend mode. However once you press the power button it runs the app (even though the time has passed).
I have tried SetSystemPowerState to turn back on if in suspend mode, e.g.
SetSystemPowerState(Nothing, POWER_STATE_ON, POWER_FORCE)
However I'm struggling to understand where i need to call the SetSystemPowerState in my code (as shown below). Any help with this would be much appreciated as its driving me bonkers!!!
Source Code:
Dim FullAppName As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
Dim AppPathOnly As String = System.IO.Path.GetDirectoryName(FullAppName)
Dim NewDate As Date
Dim wakeuptime As SYSTEMTIME
Public Structure SYSTEMTIME
Dim wYear As Short
Dim wMonth As Short
Dim wDayOfWeek As Short
Dim wDay As Short
Dim wHour As Short
Dim wMinute As Short
Dim wSecond As Short
Dim wMilliseconds As Short
End Structure
Private Sub scheduleapp()
NewDate = Now
'take the current time and date and add some hours, minutes, and seconds
NewDate = DateAdd(DateInterval.Hour, 0, NewDate)
NewDate = DateAdd(DateInterval.Minute, 30, NewDate)
NewDate = DateAdd(DateInterval.Second, 0, NewDate)
'populate systemtime structure with our new date
With wakeuptime
.wDay = NewDate.Day
.wDayOfWeek = NewDate.DayOfWeek
.wHour = NewDate.Hour
.wMilliseconds = NewDate.Millisecond
.wMinute = NewDate.Minute
.wMonth = NewDate.Month
.wSecond = NewDate.Second
.wYear = NewDate.Year
End With
If CeRunAppAtTime(FullAppName, wakeuptime) Then
MessageBox.Show("Set to wakeup in 30 mins")
Me.Timer1.Interval = txtSetTimedWakeUp.Text
Me.Timer1.Enabled = True
Application.Exit()
Else
MessageBox.Show("Call to CeRunAppAtTime failed")
End If
End Sub
Private Sub cancelschedule()
'Make a call to cancel the scheduled app
Dim cancelapp As Boolean = CeRunAppAtTime(FullAppName, Nothing)
End Sub
|
|
|
|
|
Hi!
I'm relativ new to RegExp and writing patterns. I wan't to write the pattern for (danish) dates between 01-01-1970 and 31-12-2099. How do I do that? I'm a little confused with the | op. I think. My best try is:
string strPattern = @"^([0-2][1-9]|[3][0-1]){1}-{1}([0-1][1-2]){1}-{1}([1][9][7-9][0-9]|[2][0][0-9][0-9]){1}$";
Where (...){1} should be exactly 1 of the exclusive choices in (...)
It seems to work validating it here: http://www.sweeting.org/mark/html/revalid.php#calc[^]
But in c# it do not work! Whay is that?
Regex rx = new Regex(strPattern);
rx.IsMatch(test) - seems to be false most of the time!
I can't figure it out - help!
Michael Mogensen
|
|
|
|
|
Should the - be enclosed in \\ like: \-\ ?
Michael Mogensen
|
|
|
|
|
the regex works fine in Expresso, and since Expresso uses .net regex engine, it should work fine, Maybe the problem is in an another part of you code?
01-01-1970 <- Validates
31-12-2099 <- Validates
31-12-2100 <- Doesn't validate
01-01-1969 <- Doesn't validate
|
|
|
|
|
Thanx' I'll check it out...
Michael Mogensen
|
|
|
|
|
{1} is entirely redundant. Anything without a specifier is required exactly once. Also, a character class with one element is just extra typing, so [1][9] should just be 19. The only obvious problem I see is the month section only gets 01, 02, 11, and 12. I would try this:
^([0-2][1-9]|3[0-1])-(0[1-9]|1[0-2])-(19[7-9][0-9]|20[0-9][0-9])$
|
|
|
|
|
Also this works:
private readonly string STR_DDMMYYYY_PATTERN = @"^([0][1-9]|[1-2][0-9]|[3][0-1])-([0][1-9]|[1][0-2])-([1][9][7-9][0-9]|[2][0][0-9][0-9])$";
I figured the {1} problem out also. Seems that the validator-site is OK with dealing with apparently redundant chars - but class Regex are not?
So now this is OK:
Regex regexpDDMMYYYY = new Regex(STR_DDMMYYYY_PATTERN);
bool bIsValid = regexpDDMMYYYY.IsMatch(tbGeneral.Text);
if (bIsValid)
{
...
etc.
I'll test the [1][9] replacement also.
Thanx' again.
Michael Mogensen
|
|
|
|
|
A while back, I wrote a blog entry[^] on a general purpose regular expression date validator that you might want to take a look at. The code should give you some ideas, especially as it can show you why regular expressions for dates aren't enough on their own.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi I am using backend sql server and fronend is c#.Net
i am passing connetionstring e.g. (conn="computer name/Sqlexpress")
i am getting error on slash(/) error is "unrecognized escape" please give me solution
|
|
|
|
|
Add the "@"-sign before the connectionstring, e.g.;
conn=@"computer name/Sqlexpress"
--edit--
and turn that backslash around;
conn=@"computer name\Sqlexpress;
Initial Catalog=myDataBase;
User Id=myUsername;
Password=myPassword;"
I are Troll
|
|
|
|
|
Hi guys,
I am writing a C# app with Visual studio 2008 professional and .NET 3.5 on an XP SP2 box
I build an MSI installer and install it on a target machine (XP or Vista, same problem)
The install specifies 'All users'
I can start the app from other accounts than the one who installed it, but if the password changes, I cannot start it anymore
(get a message saying 'XYZ encountered a problem and must close... Send a report to Microsoft)
Does someone have an idea of what I am doing wrong?
Thenks
Andre
|
|
|
|
|
Dear All Gurus!
I have created a windows service that runs perfect when i use installUtil.exe but produce following error when i try to make it like self install like thing.
Error 1053: The service did not respond to the start or control request in a timely fashion.
i read self install technique from this Windows Services Can Install Themselves article, the author of the article is bit busy and not responding to my messages please help me.
Khayyam Sikander
|
|
|
|
|
|
Dear Aman Bhullar,
this link is not working...
Khayyam
|
|
|
|
|
|
Thanks for help
I got the solution please follow this link
<a href="http://cavemansblog.wordpress.com/2008/06/19/installing-dotnet-windows-services-the-easiest-way/">http://cavemansblog.wordpress.com/2008/06/19/installing-dotnet-windows-services-the-easiest-way/</a>
Thanks
|
|
|
|
|
sir
pls help me
i want to change label or textbox text at runtime form on vb.net
thx
|
|
|
|
|
what is the problem in changing the text.
Just use the "Text" Property of control to get/set the Text
|
|
|
|
|
labelName.Text = "WHATEVER YOU WANT"
Humble Programmer
|
|
|
|