Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
QuestionHow to set Expiry Date to .ppt/.pptx files [modified] Pin
sachinkalse9-Dec-07 14:34
sachinkalse9-Dec-07 14:34 
GeneralRe: How to set Expiry Date to .ppt/.pptx files Pin
Paul Conrad15-Dec-07 9:06
professionalPaul Conrad15-Dec-07 9:06 
QuestionWhere does the webbrowser keep images? Pin
aj.esler9-Dec-07 12:53
aj.esler9-Dec-07 12:53 
GeneralRe: Where does the webbrowser keep images? Pin
Christian Graus9-Dec-07 13:19
protectorChristian Graus9-Dec-07 13:19 
GeneralRe: Where does the webbrowser keep images? Pin
aj.esler9-Dec-07 13:47
aj.esler9-Dec-07 13:47 
GeneralRe: Where does the webbrowser keep images? Pin
Christian Graus9-Dec-07 13:49
protectorChristian Graus9-Dec-07 13:49 
AnswerRe: Where does the webbrowser keep images? Pin
aj.esler10-Dec-07 0:30
aj.esler10-Dec-07 0:30 
QuestionDatabase learning basics Pin
kingletas9-Dec-07 12:15
kingletas9-Dec-07 12:15 
Hello everyone,


I am trying to learn the basics of databases but i found myself deep in an hole now:

System.InvalidCastException was unhandled
Message="Specified cast is not valid."
Source="System.Data"
StackTrace:
at System.Data.SqlClient.SqlBuffer.get_Int32()
at System.Data.SqlClient.SqlDataReader.GetInt32(Int32 i)
at Winner.Database.votos() in I:\Documents\Server\Winner\Winner\Database.cs:line 48
at Winner.Form1.Form1_Load(Object sender, EventArgs e) in I:\Documents\Server\Winner\Winner\Form1.cs:line 21
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Winner.Program.Main() in I:\Documents\Server\Winner\Winner\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

That is the exception i am getting trying to show all the data from a table in sql.

This is how i am doing it:


SqlCon = new SqlConnection(ConnString);
SqlCmd = new SqlCommand();
SqlCmd.CommandText = "Select * From party";
SqlCmd.Connection = SqlCon;
SqlCon.Open();
dataReader = SqlCmd.ExecuteReader();

int i = 0;
int temp = 0;
while ((dataReader != null) && dataReader.Read())
{

temp = dataReader.GetInt32(1);
Votos[i] = temp;
i++;
}
What am i doing wrong???

Thanks all in advance!

Luis E Tineo S

GeneralRe: Database learning basics Pin
Christian Graus9-Dec-07 13:14
protectorChristian Graus9-Dec-07 13:14 
GeneralLocating objects that throw the NullReferenceException in Deployed Applications [modified] Pin
Brett Blatchley9-Dec-07 11:36
Brett Blatchley9-Dec-07 11:36 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
Christian Graus9-Dec-07 13:25
protectorChristian Graus9-Dec-07 13:25 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
Brett Blatchley9-Dec-07 17:58
Brett Blatchley9-Dec-07 17:58 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
mav.northwind10-Dec-07 2:22
mav.northwind10-Dec-07 2:22 
QuestionReusing a method that takes class as argument Pin
karthikde19809-Dec-07 11:27
karthikde19809-Dec-07 11:27 
GeneralRe: Reusing a method that takes class as argument Pin
Christian Graus9-Dec-07 13:16
protectorChristian Graus9-Dec-07 13:16 
GeneralRe: Reusing a method that takes class as argument Pin
Anthony Mushrow9-Dec-07 15:46
professionalAnthony Mushrow9-Dec-07 15:46 
GeneralRe: Reusing a method that takes class as argument Pin
Christian Graus9-Dec-07 16:23
protectorChristian Graus9-Dec-07 16:23 
Generalsize of a structure Pin
daavena9-Dec-07 8:22
daavena9-Dec-07 8:22 
GeneralRe: size of a structure Pin
Paul Conrad9-Dec-07 12:41
professionalPaul Conrad9-Dec-07 12:41 
GeneralRe: size of a structure Pin
Colin Angus Mackay9-Dec-07 14:36
Colin Angus Mackay9-Dec-07 14:36 
QuestionWPF hardware acceleration Pin
Bartosz Bien9-Dec-07 7:26
Bartosz Bien9-Dec-07 7:26 
GeneralRe: WPF hardware acceleration Pin
Christian Graus9-Dec-07 9:32
protectorChristian Graus9-Dec-07 9:32 
GeneralRe: WPF hardware acceleration Pin
CKnig9-Dec-07 18:37
CKnig9-Dec-07 18:37 
GeneralRe: WPF hardware acceleration Pin
Paul Conrad9-Dec-07 12:43
professionalPaul Conrad9-Dec-07 12:43 
QuestionPortable .Net?! Pin
Rojan Gh.9-Dec-07 3:26
professionalRojan Gh.9-Dec-07 3:26 

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.