OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & spath & ";Persist Security Info=True")
Your connection string might be incorrect, it looks like it is missing some things.
Here is a good reference for connection strings:
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & spath & ";Persist Security Info=True")
Your connection string might be incorrect, it looks like it is missing some things.
Here is a good reference for connection strings:
You can also try:
e.Graphics.DrawString("COUNTER 17" & Environment.NewLine & "Your number is " & Environment.NewLine & iTicket, TextBox1.Font, Brushes.Blue, 50, 50)
Are the names and and family names stored in arrays, files, or a database?
Here is a good reference for grid views. The project also contains printing if needed.
That is fine.
If your deployment resolution is higher than the development resolution you will need to increase the size of form by:
Dragging the size increase handle of the form to the desired fit
or
Viewing the forms size properties and setting the size to the desired amount. This will require panning to the desired area using the scroll bars in form design.
An alternate way is to develop the application within the development resolution and dynamically scale up with the deployment's resolution. You can do this with margins and anchors.
You can do this on runtime by placing the code in the form's form_load event.
If that doesn't work. You can try by pulling from the current resolution by:
Me.Width = Screen.PrimaryScreen.Bounds.Width
Me.Height = Screen.PrimaryScreen.Bounds.Height
You can change the code to smaller by subtracted a value from the width/height code.
You can use
Me.WindowState = FormWindowState.Maximized
Wow, thank you. That was the error. It was returning a boolean, but wasn't converting it correctly. Thank you so much for your time!
I am having a problem with a datareader.
Do While myData.Read
itmListItem = New ListViewItem()
strValue = IIf(myData.IsDBNull(0), "", myData.GetValue(0))
itmListItem.Text = strValue
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
view_data.DatabaseListView.Items.Add(itmListItem)
Loop
I have used message boxes for proofing. The code will make it through 6 loops and then throw the specified cast is not valid. It will pass the else, but I think the problem is in the if.
Does anyone have any clue?
Found the error.
Thank you all for your help.
You can use something like the following:
if condition1 or condition2 or condition3 or condition4 Then
Else
End If
I need windows authentication, but I think there is something wrong in my syntax.
Dim connStrg As String = "Data Source=" & ServerAdressTextBox.Text & _
";Initial Catalog=" & _
DatabaseNameTextBox.Text & _
"Trusted Connection=True;"
When using the Windows Authentication connection string, I get the error, "Login failed for user '" , but when I use the other string it returns "Login failed for user "username"".
I have posted the wrong string. I am sorry, that is the CE string. This is the string I am using.
Dim connStrg As String = "Data Source=" & ServerAdressTextBox.Text & _
"\MSSQL;Initial Catalog=" & DatabaseNameTextBox.Text _
& ";User Id=" & UserNameTextBox.Text & ";Password=" & _
PasswordTextBox.Text & ";"
I am sorry.
If using Visual Studio:
Open visual Studio
Create a new Project -> Windows Forms Application
Give the project a name and create it.
This will show you a blank form labeled form1 with nothing on it.
To add another form go to Project - > Add Windows Form to add the other form
Now, from form1 add a button. You can name it what you want it to be named.
Once you are finished double click the button.
This will bring up the code editor.
From the button click procedure type:
form2.show()
form2 should be replaced with the name that you had given the second form you had added.
This should be an easy way to add and launch another form.
Hello,
I have one more question. I am connectinag to SQL Server 2008, not express, and I keep getting the "login failed for user "...""
The connection string I am using is:
Dim connStrg As String = "Data Source=" _
& ServerAdressTextBox.Text & _
";Initial Catalog=" & _
DatabaseNameTextBox.Text & _
"Integrated Security=SSPI" & ";"
Does anyone know where I am going wrong? If anyone knew anything that could help point me in the right direction, it would be GREATLY appreciated.
Thank you all for your time.
Thank everyone for there help, and I am sorry for the slow reply.
Unfortunately, it will not convert from the previous version to Visual Studio 2010. I can't get into the file to view the code either. :'( Thank you for the help though.
Wow, that gives me a good reference point. Thank you so much.
Hello Daniweb, and thank you for taking the time to read this post.
I have a question of efficiency.
I am wondering, what is the most efficient way to print from a listview. The listview's values are loaded from a database, and I would like to print from that listview. So far I have tried moving them to a text file and printing the text file, but Windows said that "The file is to large for notpad" even though I was not using notepad.
Is it advised to create an array of structures and then load everything into the array?
If so, do I create the array dynamicly?
Please, if anyone has any suggestions, let me know.
Thank you,
begginnerdev
A co-worker and I are trying to compile a VB.Net / ASP.Net application on another machine. We are getting two different sets of errors. One set of errors lists 103 undefined statements with no library missing. The other error is, " It is an error to use a section registered as allowDefinition='MachineToApplication' beyond the application level."
We have tried numerous work arounds. We have Configured the website to run as an application through IIS, even though he hasn't configured it on his workstation. We have tried logging into his user on this machine, with the same errors. We have also tried compiling from a network share with all required files, but to no avail.
We started on a Windows XP machine running the same setup as he has, and now we are running a Windows 7 machine.
We are starting to think it may be a special setup on the workstation that he uses, but we are not certain. Does anyone have any ideas?
Thanks,
BegginnerDev
I think that you have to make a header file containing that function.
I would not quote me on this.
You might want to find one of the more advanced C users.
Hope this helps!
Thank you for your help, I am sorry for being such a nuisance.
P.S.
Sorry for not using "Code Tags."
I am also sorry for the title "Need help please."
I have just recently read over the rules.
I blame my procrastination for it.
Thank you for my first post.
Thank you for your help, Dragon.
Thank you for your help, WaltP.
The error checking seems to work, I can enter a random string that is longer than 15 characters. It goes into the while and prompts me to enter one smaller than 15. It keeps me in the loop until I one the correct size.
Thanks again!
How would I go about doing that?
Use scanf("%c",&word); instead?
Thanks again!
Hello, I am still green to the C programming language. I am writing a multi-dimensional array program to store strings into an array. The program requires error checking to avoid overflow.
I am using Visual Studio 2008.
I am using a Windows O/S.
The program runs fine on the first past through, but skips over the prompt on the next run.
Here is the output:
Please enter a word: word
Are you finished: Please enter a word:
Here is my code:
#include "stdafx.h"
#include <string.h>
#define MAX 25
#define LENGTH 16
int _tmain(int argc, _TCHAR* argv[])
{
char store[MAX][LENGTH];
char word[LENGTH];
int i=0;
char exit='n';
while(exit!='y'||i==MAX)
{
printf("Please enter a word: ");
scanf("%s",&word);
printf("\n");
while(strlen(word)>15)
{
memset(word, NULL, LENGTH);
printf("You have entered a word that is to large.\n");
printf("Please enter a word: ");
scanf("%s",&word);
}
strcpy(store[i], word);
printf("Are you finished: ");
scanf("%c",&exit);
i++;
}
return 0;
}
Thank you for your help.