Hi, I know how to get table columns with getoledbschematable and how to get the columns and type for...
By dhernando
is there a way to upload files with the webclient component ?mywebclient.uploadfile ... simple uploa...
By ron
I have a webform with an ASP.Net Dropdownlist that posts back to update another ASP.Net Dropdownlist...
By billkamm
Hi i got this error after i run my web application... anyone know wat is wrong..?? An attempt to att...
By sagittarius08
Hi, I know how to get table columns with getoledbschematable and how to get the columns and type for...
By dhernando, 4 Comments
Ok,I have 1 form that has a TabControl with 2 tabs. Each tab has a Gridview control on it. When I ...
By jcb1269, 2 Comments
Hi, I've managed to save files in my local computer using the upload control. But instead of the pat...
By kieboy, 3 Comments
Please help this is driving me nuts. I have 2 forms, 1 user class and I am trying to implement a sin...
By anonymous, 4 Comments
Hi all I copied my project files from testing server to staging , but it is showing following erro...
By sreejith_bk, 1 Comments
Hi,
This is tricky, as it depends on provider:
for sqlserver it seems that column_flags = 16 and data_type=3 indicates
autonumbering
while for oledb/jet4 it seems that column_flags=90 and data_type=3 indicates
autonumbering
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
"dhernando" <dhernando...-NOSPAM-itecperu.com> wrote in message
news:eBS7gpSxDHA.3220...tk2msftngp13.phx.gbl...
> Hi, I know how to get table columns with getoledbschematable and how to
get the columns and type for a specific table but i need to know if a column
have a identity type (incremental) please how can i get this information
> --
> Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest
Community Website: http://www.dotnetjunkies.com/newsgroups/
miha | Wed, 21 May 2008 05:04:00 GMT |
There is another way but it is slower than what Miha has suggested.
DataAdatper has a method called FillSchema. Call this method and then
examine the DataColumn elements of the Table. DataColumn has Properties
1. AutoIncrement 2) AutoIncrementSeed 3) AutoIncrementStep
nice | Wed, 21 May 2008 05:05:00 GMT |
Thank you for help me, look i have this procedure, look in the last case "isautoincrement" looks ok but is not working everything else work fine please maybe you can see where is the error thanks a lot
cmd.CommandText = "SELECT * FROM " + tblName
cmd.Connection = cnn
myReader = cmd.ExecuteReader()
schemaTable = myReader.GetSchemaTable()
i=0
foreach (DataRow myField in schemaTable.Rows
foreach (DataColumn myProperty in schemaTable.Columns)
switch (myProperty.ColumnName.ToLower())
case "columnname"
listView1.Items.Add (myField[myProperty].ToString())
break
case "columnsize"
listView1.Items[i].SubItems.Add(myField[myProperty].ToString())
break
case "datatype"
listView1.Items[i].SubItems.Add(myField[myProperty].ToString())
break
case "isautoincrement"
listView1.Items[i].SubItems.Add(myField[myProperty].ToString())
break
i++
}
--
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
dhernando | Wed, 21 May 2008 05:06:00 GMT |