|
sumit21 wrote:
but can anybody tell me how to make new database, new table in a database and alter table queries
To create a database, use something like this:
CREATE DATABASE Sales
ON
( NAME = Sales_dat,
FILENAME = 'c:\program files\microsoft sql server\mssql\data\saledat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'c:\program files\microsoft sql server\mssql\data\salelog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )
To create a table use something like this:
CREATE TABLE publishers
(
pub_id char(4) NOT NULL
CONSTRAINT UPKCL_pubind PRIMARY KEY CLUSTERED,
pub_name varchar(40) NULL,
city varchar(20) NULL,
state char(2) NULL,
country varchar(30) NULL
DEFAULT('USA')
)
To alter a table use something like this:
ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL
If this is not enough help there are already some great documentation and articles already out there on the internet: CREATE DATABASE[^] CREATE TABLE[^] ALTER TABLE[^]
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
i m using ms-access as database
so, plz tell is there any method
thnks
|
|
|
|
|
|
i want t have a datagrid with checkbox.
can anyone help me
code will be more helpful
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_CustDataGrid.asp
|
|
|
|
|
i want to retrieve of a table whose schema and other constraints i do not know
basically , i had given user opurtunity to browse the database (and select any table) and based on that i will display the priary keys(if it does not had primey keys then a msgbox will be displayed)
is there any method to know wheteher table has primary keys and to bind that column to the combobox
plz help
a code snippet will be more helpfull....
|
|
|
|
|
You can use the following SQL Statement to get the data out of the database that you want:
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS kcu
ON tc.CONSTRAINT_CATALOG = kcu.CONSTRAINT_CATALOG
AND tc.CONSTRAINT_SCHEMA = kcu.CONSTRAINT_SCHEMA
AND tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME
WHERE tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND tc.TABLE_NAME = @TableName If this SQL Statement returns rows then they each represent one of the columns of the primary key (maximum of 16). If it returns no rows then there is no primary key.
Does this help?
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Im writing a paint program using GDI and currently im having some difficulties using the opendialog box. Im using it so the user can selec a bmp to use for a texture fill.
The problem is when you click inside the dialog box it will effect the drawing surface beneath it also. This causes the program to crash as it is trying to use a textute brush with no image loaded into it.
Does anyone know a way so dialog boxes dont effect what beneath them?
|
|
|
|
|
It's not supposed to be affecting what's under the dialog box in the first place! How did you show the Dialog?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how can i user the vb.net to make backups and restore for the SQL server database
|
|
|
|
|
|
hey all, Im really new to this all so please bear with me. I've basically just written a module with a main function that creates an array of data (this is fine) and open a form with a listbox (courslist) that i want to populate with the values stored in the array (course). For some reason (i know im missing somethin silly) the form app crashes with
An unhandled exception of type 'System.ArgumentNullException' occurred in system.windows.forms.dll
Additional information: Value cannot be null.
Here's the call i make to bind the data. Any help would be greatly appreciated
f1.courselist.DataSource() = course
f1.Show()
Cheers,
|
|
|
|
|
datasource is used i database (oledb connections)
use this funda
dim i as integer
for i=0 to course.lenght-1
f1.courselist.items.add(course(i))
next
f1.show()
hope this will works
|
|
|
|
|
unfortunately that didnt seem to do it... but i'll keep pluggin away,
thanks
|
|
|
|
|
tell te exception or error u r getting
|
|
|
|
|
i want to build a menu bar which contains options like
"new" "save" "save as" "open" "print"
i want that text and images (both) should be dispalyed
setting text is not a problem but i dont know how to bring icons in menubar
plz help
code snippet will be very helpful
|
|
|
|
|
|
i have built a dll in .net and i have refered that in my vb6 application but when i try to create an object of that class it says "file or assembly name or one of its dependency was not found". why is that. i have already refered the class in the project. Can any one help me.
|
|
|
|
|
Hi All
I have a project which uses a treeview to the left of the main form. The tag of each treenode contains one of three different objects. Each object contains different fields of data. I am looking for a tidy way to display the appropriate controls on the right hand side of the form depending on what object is stored in the node. I can see that I could show a different form each time but I do not want an MDI like interface. My ideal would be that the controls to the right just change. Apoligies if this is trivial - I am new to vb.NET
thanks in advance
Jon
|
|
|
|
|
What you could do is make a panel for each unqiue ui view. When the tree view node is clicked you remove the old panel and add the new panel via the controls collection on the form.
Forever Developing
|
|
|
|
|
Hi Nicholas - how would I do that please?
thanks
Jon
|
|
|
|
|
Can i call a dll made in .net in vb6. My point is that we cannot call code written in managed environment(.net) in unmanaged code(vb6,c etc). Am i correct or is there a way to call managed code in unmanaged env.
|
|
|
|
|
i've been able to refer the dll in the vb6 project.
|
|
|
|
|
|
I first created a type library of the ,net project and then registered the assembly by using regasm. Then i refered the library to the vb6 project. then when i tried to create an object of the library first it gave me this error
"MSCOREE.DLL have been loaded"
firts copy
unknown
second copy
c:\windows\.....\mscorwks.dll
this is typically caused by having a registered mscoree.dll that is different from the one that is statically linked with the application
and the next error that follows
"cannot create a file when that file already exists"
i ran that project again and then i start recieveing these messages "ActiveX component can't create object" which is understandable. But when i tried to register the dll with regsvr32 cmd it again gave me error
"Dll was loaded but DllregisterServer entry point was not found. The file cannot be registered."
Am i doing something wrong?
|
|
|
|