Click here to Skip to main content
16,007,809 members
Home / Discussions / C#
   

C#

 
GeneralSuppress an Event Pin
zaboboa5-Aug-05 2:57
zaboboa5-Aug-05 2:57 
GeneralRe: Suppress an Event Pin
Pradyumna Gogte5-Aug-05 3:24
Pradyumna Gogte5-Aug-05 3:24 
GeneralRe: Suppress an Event Pin
Alomgir Miah5-Aug-05 3:54
Alomgir Miah5-Aug-05 3:54 
GeneralRe: Suppress an Event Pin
zaboboa5-Aug-05 4:50
zaboboa5-Aug-05 4:50 
GeneralWinForms: How to add any control to a DataGrid column Pin
SebbaP5-Aug-05 2:41
SebbaP5-Aug-05 2:41 
GeneralTab control Pin
deep75-Aug-05 2:26
deep75-Aug-05 2:26 
GeneralRe: Tab control Pin
Alomgir Miah5-Aug-05 3:58
Alomgir Miah5-Aug-05 3:58 
GeneralNeed help with a data set problem.. Pin
corkey195-Aug-05 1:38
corkey195-Aug-05 1:38 
I am trying to get the maximum value in a colum of a data table the table layout is as follows:

dt = new DataTable("Contact");<br />
			///******Primary Key<br />
			dc = new DataColumn("Contact_Number",System.Type.GetType("System.Int32"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("JobTitle",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("CompanyName",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("WebPage",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("Department",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("Office",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("Profession",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("ManagersName",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("PAName",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("Catagory",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("AddressStreet",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("AddressCity",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("AddressState",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("AddressZip",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
			dc = new DataColumn("AddressRegion",System.Type.GetType("System.String"));<br />
			dt.Columns.Add(dc);<br />
<br />
			//Setup primary keys and addtable to dataset<br />
			dt.PrimaryKey = new DataColumn[]{dt.Columns["Contact_Number"]};<br />
			this.contactsDataSet.Tables.Add(dt);


I am using the compute function but I get an error saying type cast invalid

int nextNumber<br />
=(int)contactsDataSet.Tables["Contact"].Compute("MAX(Contact_Number)","");


I need to find the max value in order to use it as a primary key,

Any suggestions would be great...
QuestionHow do we List Down All User Names and Passwords in SQL Server? Pin
pubududilena5-Aug-05 1:24
pubududilena5-Aug-05 1:24 
AnswerRe: How do we List Down All User Names and Passwords in SQL Server? Pin
Dave Kreskowiak5-Aug-05 4:50
mveDave Kreskowiak5-Aug-05 4:50 
GeneralLoop through combobox items Pin
fady_sayegh5-Aug-05 0:06
fady_sayegh5-Aug-05 0:06 
GeneralRe: Loop through combobox items Pin
Pradyumna Gogte5-Aug-05 0:20
Pradyumna Gogte5-Aug-05 0:20 
GeneralRe: Loop through combobox items Pin
Guffa5-Aug-05 0:21
Guffa5-Aug-05 0:21 
GeneralRe: Loop through combobox items Pin
fady_sayegh5-Aug-05 0:29
fady_sayegh5-Aug-05 0:29 
GeneralRe: Loop through combobox items Pin
Guffa5-Aug-05 4:43
Guffa5-Aug-05 4:43 
Generalcapturing the right click and paste mouse events Pin
pjoseph9994-Aug-05 23:33
pjoseph9994-Aug-05 23:33 
General.net equivalent of ddx + q about anchoring Pin
roel_4-Aug-05 22:58
roel_4-Aug-05 22:58 
GeneralRe: .net equivalent of ddx + q about anchoring Pin
Pradyumna Gogte5-Aug-05 0:17
Pradyumna Gogte5-Aug-05 0:17 
GeneralRe: .net equivalent of ddx + q about anchoring Pin
roel_5-Aug-05 1:17
roel_5-Aug-05 1:17 
GeneralRe: .net equivalent of ddx + q about anchoring Pin
Pradyumna Gogte5-Aug-05 2:01
Pradyumna Gogte5-Aug-05 2:01 
GeneralRe: .net equivalent of ddx + q about anchoring Pin
Dan Neely5-Aug-05 2:04
Dan Neely5-Aug-05 2:04 
Questionhow to define length of double dimension array Pin
Anonymous4-Aug-05 22:48
Anonymous4-Aug-05 22:48 
AnswerRe: how to define length of double dimension array Pin
mav.northwind4-Aug-05 22:58
mav.northwind4-Aug-05 22:58 
GeneralRe: how to define length of double dimension array Pin
Anonymous4-Aug-05 23:08
Anonymous4-Aug-05 23:08 
GeneralRe: how to define length of double dimension array Pin
Guffa4-Aug-05 23:52
Guffa4-Aug-05 23:52 

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.