Click here to Skip to main content
15,899,474 members
Home / Discussions / C#
   

C#

 
Generallink database Pin
pupuboy18-Sep-04 1:14
pupuboy18-Sep-04 1:14 
GeneralRe: link database Pin
VanesaAFESRG18-Sep-04 5:53
VanesaAFESRG18-Sep-04 5:53 
Generalfill web form using a windows form written in c# Pin
cemlouis17-Sep-04 23:37
cemlouis17-Sep-04 23:37 
GeneralRe: fill web form using a windows form written in c# Pin
sreejith ss nair17-Sep-04 23:41
sreejith ss nair17-Sep-04 23:41 
GeneralRe: fill web form using a windows form written in c# Pin
cemlouis17-Sep-04 23:53
cemlouis17-Sep-04 23:53 
GeneralRe: fill web form using a windows form written in c# Pin
sreejith ss nair17-Sep-04 23:58
sreejith ss nair17-Sep-04 23:58 
GeneralRe: fill web form using a windows form written in c# Pin
cemlouis18-Sep-04 5:29
cemlouis18-Sep-04 5:29 
GeneralCreating Access database in runtime Pin
janigorse17-Sep-04 22:36
janigorse17-Sep-04 22:36 
Look at the following code:

<br />
// build catalog object<br />
Catalog cat = new CatalogClass();<br />
cat.Create(connStrAccess);<br />
<br />
// naslov<br />
Table dtNaslov = new TableClass();<br />
dtNaslov.Name = "Naslov";<br />
dtNaslov.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4);<br />
dtNaslov.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyPrimary,"ID_Naslov","Naslov","ID_Naslov");<br />
dtNaslov.Columns.Append("Ulica",DataTypeEnum.adVarWChar,50);<br />
dtNaslov.Columns.Append("PostnaSt",DataTypeEnum.adSmallInt,4);<br />
dtNaslov.Columns.Append("Kraj",DataTypeEnum.adVarWChar,50);<br />
cat.Tables.Append((object)dtNaslov);<br />
<br />
// potnik<br />
Table dtPotnik = new TableClass();<br />
dtPotnik.Name = "Potnik";<br />
dtPotnik.Columns.Append("ID_Potnik",DataTypeEnum.adInteger,4);<br />
dtPotnik.Keys.Append("ID_Potnik",KeyTypeEnum.adKeyPrimary,"ID_Potnik","Potnik","ID_Potnik");<br />
dtPotnik.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4);<br />
dtPotnik.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyForeign,"ID_Naslov","Naslov","ID_Naslov");<br />
dtPotnik.Columns.Append("Ime",DataTypeEnum.adVarWChar,50);<br />
dtPotnik.Columns.Append("Priimek",DataTypeEnum.adVarWChar,50);<br />
cat.Tables.Append((object)dtPotnik);<br />
<br />
// partner<br />
Table dtPartner = new TableClass();<br />
dtPartner.Name = "Partner";<br />
dtPartner.Columns.Append("ID_Partner",DataTypeEnum.adInteger,4);<br />
dtPartner.Keys.Append("ID_Partner",KeyTypeEnum.adKeyPrimary,"ID_Partner","Partner","ID_Partner");<br />
dtPartner.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4);				<br />
dtPartner.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyForeign,"ID_Naslov","Naslov","ID_Naslov");<br />
dtPartner.Columns.Append("Naziv",DataTypeEnum.adVarWChar,100);<br />
cat.Tables.Append((object)dtPartner);<br />



A problem is, when debug mode is trying to do cat.Tables.Append((object)dtPartner). It
throws an exception: "ID_Naslov object already exist". Why is that? I only want to
create a relationship between Naslov & Potnik tables and Naslov & Partner tables.
How can I create a Foreign key in table Partner? It generates Foreign key in table
Potnik perfectly, but in Partner table it throws an exception.
Can someone please help?
GeneralRe: Creating Access database in runtime Pin
Vasudevan Deepak Kumar18-Sep-04 1:53
Vasudevan Deepak Kumar18-Sep-04 1:53 
GeneralUsing Web Services from Java Pin
sacoskun17-Sep-04 22:22
sacoskun17-Sep-04 22:22 
QuestionHow to make line limit to input string in Textbox control. Pin
Anonymous17-Sep-04 13:48
Anonymous17-Sep-04 13:48 
AnswerRe: How to make line limit to input string in Textbox control. Pin
Jay Shankar17-Sep-04 17:06
Jay Shankar17-Sep-04 17:06 
GeneralRe: How to make line limit to input string in Textbox control. Pin
sacoskun17-Sep-04 22:25
sacoskun17-Sep-04 22:25 
GeneralRe: How to make line limit to input string in Textbox control. Pin
Jay Shankar18-Sep-04 0:00
Jay Shankar18-Sep-04 0:00 
GeneralRe: How to make line limit to input string in Textbox control. Pin
Anonymous18-Sep-04 8:00
Anonymous18-Sep-04 8:00 
Questionhow to read utf8 string from mysql and save to a xml file? Pin
niqing17-Sep-04 12:42
niqing17-Sep-04 12:42 
GeneralDataGrid Pin
ImanMahmoud17-Sep-04 10:01
ImanMahmoud17-Sep-04 10:01 
GeneralRe: DataGrid Pin
Heath Stewart17-Sep-04 10:46
protectorHeath Stewart17-Sep-04 10:46 
GeneralRe: DataGrid Pin
ImanMahmoud17-Sep-04 11:45
ImanMahmoud17-Sep-04 11:45 
GeneralRe: DataGrid Pin
sreejith ss nair17-Sep-04 23:39
sreejith ss nair17-Sep-04 23:39 
QuestionHow to specify the default Toolbox Tab for a custom control Pin
shark9265117-Sep-04 9:51
shark9265117-Sep-04 9:51 
AnswerRe: How to specify the default Toolbox Tab for a custom control Pin
Heath Stewart17-Sep-04 10:42
protectorHeath Stewart17-Sep-04 10:42 
GeneralEasiest way to load this Pin
Joel Holdsworth17-Sep-04 9:44
Joel Holdsworth17-Sep-04 9:44 
GeneralRe: Easiest way to load this Pin
Heath Stewart17-Sep-04 10:28
protectorHeath Stewart17-Sep-04 10:28 
GeneralAdding control to a form delets the custom control from the form Pin
SandeepN17-Sep-04 6:47
SandeepN17-Sep-04 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.