Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can we use pointers or similar in C# ? Pin
Otex5-Jun-09 0:15
Otex5-Jun-09 0:15 
GeneralRe: Can we use pointers or similar in C# ? Pin
0x3c05-Jun-09 0:21
0x3c05-Jun-09 0:21 
AnswerRe: Can we use pointers or similar in C# ? Pin
Christian Graus5-Jun-09 0:12
protectorChristian Graus5-Jun-09 0:12 
QuestionOutlook 2003 VSTO Addin deployment on Windows Vista - Registry and other issues - How to Pin
Chaitanya Joshi4-Jun-09 23:28
Chaitanya Joshi4-Jun-09 23:28 
AnswerRe: Outlook 2003 VSTO Addin deployment on Windows Vista - Registry and other issues - How to Pin
led mike5-Jun-09 4:37
led mike5-Jun-09 4:37 
GeneralRe: Outlook 2003 VSTO Addin deployment on Windows Vista - Registry and other issues - How to Pin
Chaitanya Joshi7-Jun-09 23:26
Chaitanya Joshi7-Jun-09 23:26 
GeneralRe: Outlook 2003 VSTO Addin deployment on Windows Vista - Registry and other issues - How to Pin
led mike8-Jun-09 5:37
led mike8-Jun-09 5:37 
QuestionBatch Insert Problem with SqlBulkCopy. Pin
hdv2124-Jun-09 22:33
hdv2124-Jun-09 22:33 
Hi i have access db as client db and sql server db as web db. all structures of two database is same except PKs, in sql server PK is uniqueidentifier and in access, PK is Text (with 255 max Length).

in client app i want to send some data from client to web(access to sql) via SqlBulkCopy class, to do this, i use this code to transfer data :

this.personsTableAdapter1.Fill(this.testDataSet1.Persons);

            DataTable dtImported = this.testDataSet1.Persons.Clone();

            // because PK dataType in sql server is uniqueidentifier, hence i convert PK column to guid
            dtImported.Columns["PersonID"].DataType = typeof(Guid);
            foreach (TestDataSet.PersonsRow row in this.testDataSet1.Persons.Rows)
            {                
                Guid g = new Guid(row.PersonID);                
                dtImported.Rows.Add(new object[] { g, row.PersonName }); // Error occur
            }

            System.Data.SqlClient.SqlBulkCopy bc = new System.Data.SqlClient.SqlBulkCopy(Properties.Settings.Default.TestSqlConnectionString);
            bc.DestinationTableName = "Persons";
            bc.WriteToServer(dtImported);


but at runTime the following error show me in above line of code:

Cannot set column 'PersonID'. The value violates the MaxLength limit of this column.


where does my problem and how to solve it ?
Thanks
AnswerRe: Batch Insert Problem with SqlBulkCopy. Pin
Manas Bhardwaj4-Jun-09 22:41
professionalManas Bhardwaj4-Jun-09 22:41 
GeneralRe: Batch Insert Problem with SqlBulkCopy. Pin
hdv2124-Jun-09 23:45
hdv2124-Jun-09 23:45 
GeneralRe: Batch Insert Problem with SqlBulkCopy. Pin
Manas Bhardwaj4-Jun-09 23:49
professionalManas Bhardwaj4-Jun-09 23:49 
GeneralRe: Batch Insert Problem with SqlBulkCopy. Pin
hdv2125-Jun-09 0:41
hdv2125-Jun-09 0:41 
AnswerRe: Batch Insert Problem with SqlBulkCopy. Pin
I Believe In GOD5-Jun-09 2:04
I Believe In GOD5-Jun-09 2:04 
QuestionHow to install Microsoft.mshtml.dll in GAC Pin
svt gdwl4-Jun-09 22:28
svt gdwl4-Jun-09 22:28 
AnswerRe: How to install Microsoft.mshtml.dll in GAC Pin
Christian Graus4-Jun-09 23:05
protectorChristian Graus4-Jun-09 23:05 
QuestionWMI Pin
arkiboys4-Jun-09 22:21
arkiboys4-Jun-09 22:21 
AnswerRe: WMI Pin
Pete O'Hanlon4-Jun-09 23:05
mvePete O'Hanlon4-Jun-09 23:05 
GeneralRe: WMI Pin
arkiboys4-Jun-09 23:49
arkiboys4-Jun-09 23:49 
GeneralRe: WMI Pin
arkiboys5-Jun-09 0:31
arkiboys5-Jun-09 0:31 
QuestionUser Control Pin
User 62554644-Jun-09 21:14
User 62554644-Jun-09 21:14 
AnswerRe: User Control Pin
Christian Graus4-Jun-09 21:37
protectorChristian Graus4-Jun-09 21:37 
GeneralRe: User Control Pin
User 62554645-Jun-09 19:35
User 62554645-Jun-09 19:35 
Questionnon selectable cells/columns in datagridview Pin
Otex4-Jun-09 21:01
Otex4-Jun-09 21:01 
AnswerRe: non selectable cells/columns in datagridview Pin
dan!sh 4-Jun-09 23:12
professional dan!sh 4-Jun-09 23:12 
QuestiondataGrid SelectedIndexChanged Method not available in Compact Framework Pin
Paulo Mitchell4-Jun-09 20:27
Paulo Mitchell4-Jun-09 20:27 

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.