|
Do you have the ability to cut down on the number of columns in your table? 100 columns in a single table isn't a good idea.
|
|
|
|
|
I could spit the table into smaller related tables but i will still need to update 118 columns at the same time. It appears that 100 is the limit for a data adapter.
|
|
|
|
|
Split the table into smaller tables and use a DataSet with multiple tables. You won't have any issues with that approach.
|
|
|
|
|
I would like to change text on buttons on MessageBox, for example, OK changed to Accept...
I want some unicode text in my application, so I need change these text, help me
|
|
|
|
|
The possible text on a messagebox is set via an enum. If that doesn't suit, you need to write your own.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
HI,
Pl coreect the error its real urgebt for me . plzz
near this syntax iam getting error
password = (string)objcom.ExecuteScalar();
ERROR MSG
d:\inetpub\wwwroot\Naveen\WebForm1.aspx.cs(93): The type or namespace name 'objcom' could not be found (are you missing a using directive or an assembly reference?)
Lakshmi Narayanan <laks_win@yahoo.co.in> wrote:
Hi,
Code not tested, so pls chk the spell as well as case sensitive.
[code]
using System.Data.SqlClient;
........
........
private string GetPasswordFromDB(string userName)
{
string password = string.Empty;
//Consider <urtable> is having the fields namely, userId and PWD for
username and password
SqlConnection objCon = new SqlConnection
("server=localhost;database=test;Integrated Security=true");
objCon.Open();
SqlCommand objCom = new SqlCommand("select PWD from <urtable> where
userId = '" + userName + "'",objCon);
password = (string)objcom.ExecuteScalar();
return password;
}
[/code]
Regards
Laks.R
--- In dotnetoffers@yahoogroups.com, mukkasa sai <mukkasasai@y...>
wrote:
> Hai all,
>
> This is the code for login btn c#.net.
>
> my server name is SHAR , WINDOWS AUth in sql server . Pl give me
the code (marked in red i have to implement ado.net code). pl give
me the code
>
> just i have to chk pswd,username & (ck submit)go to main page .
give code to chk & login
>
>
>
> Code Behind
>
> using System;
> using System.Collections;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Web;
> using System.Web.SessionState;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.HtmlControls;
>
> namespace LoginPage
> {
> ///
> /// Summary description for WebForm1.
> ///
> public class WebForm1 : System.Web.UI.Page
> {
> protected System.Web.UI.WebControls.TextBox txtUserName;
> protected System.Web.UI.WebControls.Button btnLogin;
> protected System.Web.UI.WebControls.Button btnReset;
> protected System.Web.UI.WebControls.Label lblError;
> protected System.Web.UI.WebControls.TextBox txtPassword;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
>
> if(!Page.IsPostBack)
> {
> lblError.Visible=false;
> }
>
> // Put user code to initialize the page here
> }
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> //
> // CODEGEN: This call is required by the ASP.NET Web Form Designer.
> //
> InitializeComponent();
> base.OnInit(e);
> }
>
> ///
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> ///
> private void InitializeComponent()
> {
> this.btnLogin.Click += new System.EventHandler
(this.btnLogin_Click);
> this.btnReset.Click += new System.EventHandler
(this.btnReset_Click);
> this.Load += new System.EventHandler(this.Page_Load);
>
> }
> #endregion
>
> private void btnLogin_Click(object sender, System.EventArgs e)
> {
>
> string originalPassword = GetPasswordFromDB
(this.txtUserName.Text.Trim());
> if ((txtUserName.Text != string.Empty) && (txtPassword.Text ==
originalPassword))
> {
> lblError.ForeColor = System.Drawing.Color.Green;
> lblError.Text = "Login Successful";
> lblError.Visible=true;
> }
> else
> {
> lblError.Text = "Invalid User or Password";
> lblError.ForeColor = System.Drawing.Color.Red;
> lblError.Visible=true;
> }
>
> }
>
> private void btnReset_Click(object sender, System.EventArgs e)
> {
> if (lblError.Visible == true)
> lblError.Visible=false;
> this.txtUserName.Text = string.Empty;
> this.txtPassword.Text=string.Empty;
>
> }
> private string GetPasswordFromDB(string userName)
> {
> string password = string.Empty;
> //
> //TODO: Write the logic here to get the password from database
> // using ADO.Net
> //
> return password;
> }
> }
> }
>
>
> HTML
>
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="LoginPage.WebForm1" %>
>
>
>
> <title>WebForm1
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> <asp:label runat="server" id="lblError" forecolor="#ff3333"
="">Invalid UserId or Password
> | UserName
> |
> <asp:textbox id="txtUserName" runat="server"> | Password
> |
> <asp:textbox id="txtPassword" runat="server"
textmode="Password"> |
> <asp:button id="btnLogin" runat="server" text="Login">
> <asp:button id="btnReset" runat="server"
text="Reset"> |
>
>
>
>
|
|
|
|
|
|
also in
http://localhost/w3schools/WebForm1.aspx page after
running . iam geeting (inweb page) like this .username with no text box &
password with no txt box.INVALID USERID&
PASSWORD R DISPLAYED OPENLY(i.e validation).
if no txtxbox & no password txtbox , no button then its not possible . iam using webserver controls.
pl kindly tell soln.
why this is coming the page w/o fields
pl reply
chand
|
|
|
|
|
|
Thanks for reply colin angus mackay,
can you please give me the complete flow step by step . i.e where i have to change in code.
please kindly write code(i.e the code i have to change)
Actually i pasted Html code (using paste html option).
kindly give the code where i have to change.
ALso i will write in full words . ok then
kindly give me reply ( i will wait for u r reply)
chand
|
|
|
|
|
Thanks for reply colin angus mackay,
can you please give me the complete flow step by step . i.e where i have to change in code.
please kindly write code(i.e the code i have to change)
Actually i pasted Html code (using paste html option).
kindly give the code where i have to change.
ALso i will write in full words . ok then
kindly give me reply ( i will wait for u r reply)
chand
|
|
|
|
|
kindly give me solution for my problem.
chand
|
|
|
|
|
Noone know what you want because we can't understand you. We have absolutely no idea what your asking.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I placed one webcontrol on form(web based application - c#.net).
i placed BUTTON . After execution iam unable to see my button on browser.
i also chked visible property . its set to true.
i am unable to find the prob .not only button any webctrl iam not able to display.
kindly solve my prob
chand
|
|
|
|
|
Given an object, how do I determine of the object is a collection of objects or a single object ?
- Thanks
|
|
|
|
|
|
To do that programmatically, just check for the IEnumerable interface.
<br />
bool IsCollection(object b)<br />
{<br />
return b is IEnumerable;<br />
}<br />
Regards
Senthil
My Blog
|
|
|
|
|
I have a situation where I need to load 8 key value pairs into a DataSet manually.
The data looks like this:
Mon -- 123.4
Tues -- 232.1
Wed -- 187.4
...
EOW -- 923.6
I have to get these values into a DataSet. Is there a better (less lines of code) way to load it into a DataSet than to create a DataTable manually?
This is what I have so far:
<br />
DataSet ds = new DataSet(); <br />
DataTable dt = new DataTable("MCDVals");<br />
dt.Columns.Add("Legend", typeof(string) );<br />
dt.Columns.Add("Value", typeof(double) );<br />
<br />
DataRow dr = dt.NewRow();<br />
dr("Legend") = "Monday";<br />
dr("Value") = 123.4;<br />
dt.Rows.Add(dr);<br />
<br />
<br />
ds.Tables.Add(dt);<br />
Thanks,
Adam
"...practice safe hex when IM'ing"
--Shawn L. Morrissey, Managing Editor, MSDN Online ( MSDN Flash; Volume 8, Number 20, 10/4/2004)
|
|
|
|
|
|
Just load it into the XML , it is very simple. and you have lots of methods to write , save ...xml using datasets
|
|
|
|
|
Like the other's suggested I would use XML also. In your case you are interested in the DataSet.ReadXml() and DataSet.WriteXml() methods. I would:
1) Input all the data by hand into my DataTable and then add that DataTable into a DataSet.
2) Call the DataSet's WriteXml() methods and pass a FileStream into it so you will end up with a file.
3) Now you can use that file as a template to manually change the Value tags in there.
4) When you are done with changing your Value tags you can call the DataSet's ReadXml() method, with another FileStream, to take all your data in the XML file and put it inside a DataTable and a DataSet.
-Peter
|
|
|
|
|
Hi,
Can anyone tell me a way to put my Application on to a web, This is right now a stand alone application with forms ,button ,tab controls ..etc , how do i make this web enabled.
I have tried to put the code under wwwroot on IIS and created a simple html file with a button to invoke my .exe file directly , but it throws an expection for security breach, then i have removed all the security issues and tried, then i get different error.
is there a simple way to move (convert) your stand alone Application to web based
thanks
Samar
|
|
|
|
|
This[^] is a good way to go.
"...practice safe hex when IM'ing"
--Shawn L. Morrissey, Managing Editor, MSDN Online ( MSDN Flash; Volume 8, Number 20, 10/4/2004)
|
|
|
|
|