|
Hi,
I Have a window 2003 server machine. I Installed visual studio.NET 2003 on my machine.
In Microsoft visual studio .NET 2003 a error is occured ,
when I want to create a new project in ASP.NET Web
Application visual studio .net has dected that the web
server is runing ASP.NET version 1.0.
The web application you are creating or opening can be
configured to be complaint with ASP.NET 1.0 .
however , the application will not able to use new
features from ASP.NET 1.1 .
So I can't work on my machine for Dot Net .
Plz sugess me for this .
Thanks all off u .
nilesh
|
|
|
|
|
Nilesh
Have you installed 1.1. of the framework on the Server? Or am I miss reading and the server and deveopment machine are the same box?
Cheers
tom
|
|
|
|
|
Can somebody help me to get the code for how to import excel sheets to MS SQLServer through VB Programming and how does it identify the row and columns of the excel sheets in the database.
need help urgently
Neha
|
|
|
|
|
I have a question that I was hoping someone could help me with. I am using VB.net 2005 express edition with SQL Server 2005 Express edition.
I have a database that has a table in it called Folder. It consists of two fields. One is called folderId and folderName.
I want to add a new row to this folder by calling a second form from my main form. For example, say I open up a second form from my main form. This second form consists of a text box and an button called OK. The user will enter the new folder name into the text box. How do I make it so the name the user enters into the text box is added to the folder table.
|
|
|
|
|
Hi,
I think u need to use sql command to done it..
Example:
public sub OK_Click (byval sender as object, ByVal e As System.EventArgs)handles OK.click
Dim cmd As New Data.OleDb.OleDbCommand
cmd.Connection = mssql
'Sql command Save....
example:
<br />
cmd.CommandText = "INSERT INTO [Folder] (FolderID, FolderName) "<br />
cmd.CommandText &= "VALUES ('" & me.txtFolderID.text.trim & "','" & me.txtFolderName.text.trim & "', "<br />
Execute SQL
<br />
Try<br />
cmd.Connection.Open()<br />
cmd.ExecuteNonQuery()<br />
Catch ex As OleDb.OleDbException<br />
msgbox(ex)<br />
finally <br />
connection.close()<br />
end try<br />
i hope it can be help
|
|
|
|
|
Best way to do it IMHO is through making use of datasets and table adapters.
First you need to create a dataset. To do this
1. Right click over your solution name and select "Add new item..."
2. Click on "Dataset" & give the dataset a meaningful name (in this example I'm using the name dsFolder).
3. The dataset will be created and a wizard will open to help you configure your table adapter.
4. Configure your table adapter to use the same connection string (saved in the My.Settings file), click "Next" & use the query builder to add your table to the table adapter.
5. Add the fields from your table by checking their checkboxes. Remember to include the primary key from your table so that the table adapter can automatically generate update statements for you.
6. Click "Next" & "Finish".
In your main form add this code to whatever event it is that opens your form:
Dim frm2 as New Form2
frm2.Show()
'use ShowDialog() if you don't want users to close
'the form before completing process.
Then in your second form add
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
to the very top of the code editor. Add the code below to the OK button's click event (the naming in your code will probably be different but you get the idea),
Private Sub btnOK_Click(...)Handles btnOK.Click
'create new datasets and table adapters
Dim dsFolder1 As New dsFolder
Dim daFolder As New dsFolder.FolderTableAdapter
'create a new row to add to the table
Dim dr As DataRow = dsFolder1.Folder.NewRow()
'try updating the database
Try
dr("folderName") = txtFolder.Text
'add the datarow to the dataset
dsFolder1.Folder.Rows.Add(dr)
'update the database
daFolder.Update(dsFolder1)
Catch ex As Exception
Messagebox.Show(ex.Message)
End Try
End Sub
Using this kinda practice is better because the datasets and table adapters add type safety to your code, make it more readable as well as gives you objects that you can reuse later on in your code. This comes in really useful when you work on large databases.
Also. make use of Try...Catch...End Try blocks. The structured error handling ability of .NET is tool worth using. You could go even further by implementing TraceListeners to write out performance data & errors from your code to a log file, which can only help you write better code.
Sorry, for the long-winded explanation, I've had WAAAAY too much coffee this morning...
|
|
|
|
|
kulazfuk,
Thanks you so very much for your help. I was playing with something like this last night, but you clued me in on some other ideas. Thank you very much.
It still is not working for me though. I could not create a table adapter with the line
Dim daFolder As New dsFolder.FolderTableAdapter
I used Dim daFolder As New FolderTableAdapters.FolderTableAdapter
Everything else is the same, but it does not work.
|
|
|
|
|
Well, like I said before your naming conventions will probably be different so what you gotta look at is creating a table adapter for the dataset that you previously created. it'll follow a Dim VariableName As New DatasetTableAdapter.TableName type pattern.
That should sort you out.
|
|
|
|
|
Hi,
May i know how to uncheck the show clock in taskbar properties when my system on loading.
|
|
|
|
|
You have to use the Win32 API for that.
|
|
|
|
|
That doesn't look like a complete connection string, but the method might add things to it before it uses it. Look up the documentation for the method to see what it expects.
---
b { font-weight: normal; }
|
|
|
|
|
No, a DSN is a Data Source Name. A DSN can be a User DSN or a Machine DNS, and contains settings for a database connection. You access the data sources from Administrative Tools in the start menu.
---
b { font-weight: normal; }
|
|
|
|
|
Hi I am using vb.net2003,
Does anyone know any code I can use to delete files in a folder as well as the folder the files are located in?
Thanks for any help
|
|
|
|
|
You need to manually delete the files first. Directory.GetFiles will give you a list of files to delete.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
To delete files, use: My.Computer.FileSystem.DeleteFile("C:\File_To_Delete.txt")
You can also select whether you want the file you are deleting to goto the recycle bin or just to be permanantly deleted. Just use:
My.Computer.FileSystem.DeleteFile("C:\File_To_Delete.txt", FileIO.RecycleOption.DeletePermanently)
|
|
|
|
|
try this
imports system.io
Dim objDir As New DirectoryInfo("C:\testdel")
objDir.Delete(True)
|
|
|
|
|
I am using VB.net 2005 express and I have created a dataset with SQL server 2005 express. I want to use that dataset to load the nodes in a treeview control. The dataset consists of two tables one is called the State table and the other is called the City. I want the State table to be parent nodes and the corresponding city table rows to be child nodes beneath it. Does some know how to do this?
Thanks.
|
|
|
|
|
hi, are you guys know how to insert an image into textbox / richtextbox
just like chat application (like this), with vb.net coding?
thanx guys!!!
|
|
|
|
|
Not sure about richtextbox, but a plain textbox, you can't, not without owner drawing, and as a textbox paints itself outside of WM_PAINT, that's a major headache.
So, I'd have to assume the RTB does support it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
okay, thanx ! i already find out (using clipboard and dataformats)
|
|
|
|
|
I'm trying to control navigation in one application from another application.
I can control almost anything but navigation.
Forexampel the following is completely ignored by the receiving application:
SendMessage hwnd, WM_KEYDOWN, VK_TAB, &HF0001
SendMessage hwnd, WM_CHAR, VK_TAB, &HF0001
SendMessage hwnd, WM_KEYUP, VK_TAB, &HC00F0001
(values obtained with Spy++)
but
SendMessage hwnd, WM_CHAR, Asc("b"), 0
is accepted.
What am I missing ?
Kenneth
-- modified at 11:56 Sunday 8th October, 2006
|
|
|
|
|
Hello,
I found a good solution using clickonce, for detecting if the application is first run. Using the following code:
<br />
If (System.Deployment.Application.ApplicationDeployment.CurrentDeployment.IsFirstRun)) Then Dim setConnection As New ServerSettings() setConnection.Show() Else Dim logMeIn As New Login() logMeIn.Show() End If<br />
However, the customer has just changed their mind. And they they want to specify the location of where they want to install the application. Clickonce only has a default that cannot be changed.
So I using the ms installer. However the above code does not work for it. It seems
I would like the serverSettings to run only on first startup. However, I am not sure about the code for this, as the above does not work.
Does amyone know the synstax for 'first run' when using ms installer?
I think I am destined not to get this finished, with the customer changing their mind.
Many thanks for your help,
Steve
|
|
|
|
|
You could store a key in the registry after you've run the serverSettings, and check it prior, so it only runs when they registry key is not set.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
Thanks for your help.
Do you know of any examples that allow you to enter a key into the registery.
Thanks for your help,
Steve
|
|
|
|
|
I'm using Vb.net.
How to make a timer to read mouse cursor position on the form? I know how to use MouseMove event but it won't fire if mouse cursor is still. I would like to have a timer that would constantly report what are the current cordinates of the cursor.
|
|
|
|