|
Where are you definning columns of DataTable?
|
|
|
|
|
"Page_Load" and "Response.Write" -> are ASP.NET.
First : Create your column first, you cannot write to a column, that doesn't exists.
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Full Names"));
dt.Columns.Add(new DataColumn("Identifying Number"));
dt.Columns.Add(new DataColumn("Passport Number"));
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
|
|
|
|
|
This is what i am asking for, have you done this?
|
|
|
|
|
I've created the header columns in my design like this:
<asp:gridview id="dgInfoProfile" runat="server">
<columns>
<asp:boundfield headertext="Full Names">
<asp:boundfield headertext="Identifying Number">
<asp:boundfield headertext="Passort Number">
Didn't know that I have to define the columns in the code behind again.
|
|
|
|
|
That's why, ask in ASP.NET forum, because what you've done is working in WinForm.
|
|
|
|
|
Thanks so much, really appreciate your help.
I'll ask in ASP.Net forum and also search on the net since I don't have some books at present.
|
|
|
|
|
Nopo wrote: Didn't know that I have to define the columns in the code behind again.
Ofcourse you have to, these are columns of GridView, you has to define colums of DataTable then only you can create a DataRow.
I have a better suggestion.
Stop what you are doing, read a book first which will explain you about databindings with GridView or search and read some article(you'll find many on this site itself). I am sure, you don't have much knowledge about this.
|
|
|
|
|
Nopo wrote: I need it displayed on Page Load with only the column names.
For this you have to use TemplateFields in GridView columns collection.
|
|
|
|
|
Thanks a lot. For more info I'll acquire in ASP.Net forum.
|
|
|
|
|
Hi all,
Hope this is in the correct forum. I have an issue with some work I am involved in. We have a flat file we are loading into an MSSQL database which is failing on the insert because the original flat file contains suspect data. Invalid dates or values etc. We are using SSIS to load this data. Can someone tell me if it is possible to exception these records easily.
requirements are
- to identify the number of records with the problem
- to identify these records
- to manage the issues which error
I am a project manager and do not want the wool pulled over my eyes. I am familar with C# and SQL server but have only seen SSIS over a shoulder of a developer.
I believe this would be a simple change and would be a matter of minutes to resolve. I am currently being led to believe it is hard.
Thanks all
|
|
|
|
|
Its not really the right forum, this is for question to do with C# coding.
Happy to answer your question though.
Iain Wiseman wrote: I believe this would be a simple change and would be a matter of minutes to resolve
NOTHING takes minutes to resolve - you should know that as a PM. Development, testing, deployment, bugfixing - a time estimate should take all of this (and more) into account.
Anything to do with SSIS is a royal PITA, nothing is quick and easy.
My best suggestion for this problem is to bulk load your text file into an empty table, and do the data clensing thereafter. All this can be achived easily with SSIS, but certainly not in a matter of minutes.
|
|
|
|
|
Hi,
Thanks for replying. So you are saying that you cannot ignore errors easily in SSIS and count them. I C++ or java or C# this would be a try, carch cout which is a matter of minutes. I had hoped that microsoft would have made this easier.
Iain
|
|
|
|
|
Iain Wiseman wrote: Thanks for replying. So you are saying that you cannot ignore errors easily in SSIS and count them
Not knowing how your SSIS package is constructed makes answering this harder.
For a Data Flow task (which is the most likely thing you're using), you can often pipe errored rows to a separate file.
Its still not "minutes" work though
|
|
|
|
|
Jamie is correct, this will be a PITA to accomplish in SSIS. Anything that does the transform is bloody difficult, trapping the error rows would be a nightmare. SSIS and Biztalk are an attempt to dumb down the ETL layer so power users can do it - they FAILED.
I load my data into a table of varchar columns, the bulk copy does not care what the data is like then. I then use a stored proc to do the transorms. It is MUCH easier to manipulate the data in TSQL or C# than in SSIS.
|
|
|
|
|
Thanks all,
I come from an open source background and want to treat my colleagues who use microsoft fairly. All I want is the number of records in error and possible which they are. I assume that once you have a package to load them theat error reporting was easy. Reading this SSIS does not provide this easily. With oracle PLSQL this would simply be looking at a return code and doing something. I will ask the developer how to proceed.
|
|
|
|
|
This works on the development machine but after installing on another workstation the application errors.
Please help/
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at PeerAssistLoader.StandardProcedures.NET_AuthenticatedMailSend(String mailFrom, String[] mailTo, String[] mailCC, String Subject, String MessageBody, String smtpHost, Int32 smtpPort, String smtpNETAuthUser, String smtpNETAuthPassword)
at PeerAssistLoader.frmConfigurationMgr.SendEmail(String AlertType, String Subject, String MessageBody)
at PeerAssistLoader.frmConfigurationMgr.btnUpdateAssistUsers_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
PeerAssistLoader
Assembly Version: 1.16.31.434
Win32 Version: 1.9.23.417
CodeBase: file:
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
Microsoft.ReportViewer.WinForms
Assembly Version: 9.0.0.0
Win32 Version: 9.0.30729.1
CodeBase: file:
----------------------------------------
Microsoft.ReportViewer.Common
Assembly Version: 9.0.0.0
Win32 Version: 9.0.30729.1
CodeBase: file:
----------------------------------------
System.Data.DataSetExtensions
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.4926 built by: NetFXw7
CodeBase: file:----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.4926 built by: NetFXw7
CodeBase: file:----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.DirectoryServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
Microsoft.ReportViewer.ProcessingObjectModel
Assembly Version: 9.0.0.0
Win32 Version: 9.0.21022.8
CodeBase: file:
----------------------------------------
expression_host_b75c906bcd1143d69b962f2790f3bfac
Assembly Version: 10.8.30729.1
Win32 Version: 9.0.30729.1
CodeBase: file:
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
Figured it out I was being dumb. I forgot to account for an array not being populated yet.
|
|
|
|
|
Hi, i am making an application in which the label keeps scrolling up. The problem i have is i want to do right alignment so that i get "." in a sequence like
Basket...........
ball................
keyboard.......
can anyone help me with this please!!
i have tried this, but it isn't working for me,
for (int u = textBox1.Length; u = 40 ; u++)
{
strDotsBuilder.Append(".");
}
|
|
|
|
|
You should check your for loop again.
int u = textBox1.Length; u = 40
should probably be
int u = textBox1.Length; u < 40
[EDIT]
Actually, your code shouldn't even compile. Did you do a typo here on CP?
[/EDIT]
modified on Tuesday, October 20, 2009 2:57 AM
|
|
|
|
|
The only way I know to do that successfully is by selecting a monospaced font such as "Courier New", then append filler characters (for which string.PadRight is useful).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Hi,
I am currrently workin on something where in i would like to hide some content in an email which i would retrieve later after the mail has been sent . I would need to get this hidden content at the recieving end.
Could anyone help me out with this.. I am using c# with framework 3.5 to create the email message.
Thanks in advance
|
|
|
|
|
Pretty much impossible. Unless you hide it in an image or something, some sort of attached file that needs a third party program to extract the info.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I think you can use a hidden img and set its src to some page that you have.
When the email is opened, the action can transfer the data to your web page.
In that page you can deal with the data and save it anywhere you want.
modified 27-May-14 5:27am.
|
|
|
|
|
Hi..
i would like to add a calendar in my windows application form.
i have added some dates as special in a table.
i would like to display that dates as bold or in different color when that particular month is selected.
can any one help me to customize the calendar??
should i need to create a user control???
If yes, which property i have to set to display the dates as bold??
thanks in advance
|
|
|
|
|
Ishqalways wrote: should i need to create a user control???
I expect so.
Ishqalways wrote: If yes, which property i have to set to display the dates as bold??
The Bold property on the label class would be a good guess.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|