|
|
You might want to consider creating two fields in your database, one to handle the text part and the other to handle the auto incrementing numeric field.
Gives you a bit of flexibility for the point when you suddenly have your 10000th EQ...
|
|
|
|
|
OledbConnection con=new oleDbconnection("Connection String");
OleDbdataadapter da=new OleDbdataadapter("select MyID from MyTable",con);
Dataset ds=new Dataset();
da.fill(ds,"d");
DataTable dt=ds.Tables["d"];
for(int i=0;i<dt.rows.count;i++)>
{
DataRow dr=dt.Rows[i];
con.open();
Oledbcommand cmd=new OleDbcommand("insert into MyTable (MyId) values ((dr[i].ToString()).SubString(2)) where MyId='"+dr[i].ToString()+"'",con);
cmd.ExecuteNonQuery();
con.close();
}
over...At One step U can Replace all The Data In Your Table..
Hope This Will Help You..
|
|
|
|
|
Hello Folks
I need to develope a asp.net webpage which in it there are two seperate Datalists, one showing stored products in Database and the other showing the products 'added to shopping card'.
Actually when the user clicks on "Add To Shopping Card" link button of one product being shown in first DataList, the other DataList is going to get that and show it (In the same page). As user will click on products' "Add to Shoping Card" they will one by one add to Sh.C so it can hold more that one product. by the way the Sh.C needs to have a final price, calculating all prices of added products.
I've designed and bounded the first datalist correctly and what I have is list of products having the image and other information, and i've put a small plus sign (+) indicating the "Add to shopping card" proccess.
What I want to know is that how should I make the other DataList and get the list of that. (Include SQL Commands).
I'd appriciate your responses.
Thanks
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
HI,
I want to generate menu from database and give the order of menu as
per sequence or as per i wish?
for eg. one menu have Home, AboutUs ,contact and i want to change the
order such as AboutUs,Home, Contact. what should i have to do?
reply soon.
thanks.
keyur satyadev
|
|
|
|
|
what is the problem...
use ASP:Menu
and draw menu from the database.
Abhishek Sur
|
|
|
|
|
hai friends..
Im now only start to learing asp.net.. so i don't know how to send mail and sms using asp.net.. and how to create new user creation and login form with source code..p
modified on Friday, February 6, 2009 6:42 AM
|
|
|
|
|
nakathir wrote: so i know how to send mail and sms using asp.net.. and how to create new user creation and login form with source code..p
What is the problem thn?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
sorry i dont no.. i create user creation form and that data's stored to database.. now i want to know how to check the username and password from usercreation table.. and go another page..
|
|
|
|
|
Hello Everyone,
I have a problem ... I created a tooltip which is trigger by a onmouseover event, i put a scrollbar in the <.div> for the table the header only moves once i scroll down and then move over the tooltip area. how can i stop this from happening ?
Thank you for the support.
|
|
|
|
|
No suggestions at all ? Not even a shot in the dark ?
|
|
|
|
|
Hi i am using cryptography.While encrypting the code executes fine.but while decrypting I am getting an error "Padding is invalid and can not be removed."
My Codes are given below:
public static string Encrypt(string plainText,
string passPhrase,
string saltValue,
string hashAlgorithm,
int passwordIterations,
string initVector,
int keySize)
{
byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);
byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase,
saltValueBytes,
hashAlgorithm,
passwordIterations);
byte[] keyBytes = password.GetBytes(keySize / 8);
RijndaelManaged symmetricKey = new RijndaelManaged();
symmetricKey.Mode = CipherMode.CBC;
symmetricKey.Padding = PaddingMode.ANSIX923;
ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes);
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write);
cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
cryptoStream.FlushFinalBlock();
byte[] cipherTextBytes = memoryStream.ToArray();
memoryStream.Close();
cryptoStream.Close();
string cipherText = Convert.ToBase64String(cipherTextBytes);
return cipherText;
}
public static string Decrypt(string cipherText,
string passPhrase,
string saltValue,
string hashAlgorithm,
int passwordIterations,
string initVector,
int keySize)
{
byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);
byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] cipherTextBytes = Convert.FromBase64String(cipherText);
PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase,
saltValueBytes,
hashAlgorithm,
passwordIterations);
byte[] keyBytes = password.GetBytes(keySize / 8);
RijndaelManaged symmetricKey = new RijndaelManaged();
symmetricKey.Mode = CipherMode.CBC;
symmetricKey.Padding = PaddingMode.ANSIX923;
ICryptoTransform decryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes);
MemoryStream memoryStream = new MemoryStream(cipherTextBytes);
CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read);
byte[] plainTextBytes = new byte[cipherTextBytes.Length];
int decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
memoryStream.Close();
cryptoStream.Close();
string plainText = Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount);
return plainText;
}
ARINDAM
|
|
|
|
|
Have a look here[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Good Morning All
I have a WebSetup Project and a Installer Class. I want to accept User
Database Server
Username
Password
E-mail
This is what i did so far. I have created a Websetup Class installer that looks like this
namespace ClassLib
{
[RunInstaller(true)]
public class ClassLib : Installer
{
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
string targetSite = Context.Parameters["TargetSite"];
string targetVDir = Context.Parameters["TargetVdir"];
string targetDir = Context.Parameters["TargetDir"];
if (targetSite.StartsWith("/LM/"))
targetSite = targetSite.Substring(4);
writeEventLogs();
createConnectionString(targetSite, targetVDir, targetDir);
RegisterScriptMaps(targetSite, targetVDir);
}
void RegisterScriptMaps(string targetSite, string targetVDir)
{
string sysRoot = System.Environment.GetEnvironmentVariable("SystemRoot");
DirectoryInfo di = new DirectoryInfo(sysRoot + "/Microsoft.NET/Framework");
DirectoryInfo[] frameworkDir = di.GetDirectories("v2.0.*", SearchOption.TopDirectoryOnly);
int big = 0;
for (int i = 0; i < frameworkDir.Length; i++)
{
int current = Convert.ToInt32(frameworkDir[i].Name.Substring(5));
if (current > big)
{
big = current;
}
}
string latestFramework = di.FullName + "\\v2.0." + big.ToString();
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = latestFramework + "\\aspnet_regiis.exe";
info.Arguments = string.Format("-s {0}/ROOT/{1}", targetSite, targetVDir);
info.CreateNoWindow = true;
info.UseShellExecute = false;
Process.Start(info);
}
void writeEventLogs()
{
}
void createConnectionString(string targetSite, string targetVDir, string targetDir)
{
DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSite);
string friendlySiteName = entry.Properties["ServerComment"].Value.ToString();
entry.Properties["ConnectionTimeout"][0] = 1800;
entry.CommitChanges();
entry = new DirectoryEntry("IIS://LocalHost/" + targetSite + "/ROOT/" + targetVDir);
entry.Properties["AspScriptTimeout"][0] = 1800;
entry.Properties["AspSessionTimeout"][0] = 60;
entry.CommitChanges();
FileSecurity fSecurity = File.GetAccessControl(targetDir + "App_Data");
string LocalUserName = Environment.MachineName + "\\IUSR_" + Environment.MachineName;
string LocalGroupName = Environment.MachineName + "\\IIS_WPG";
try
{
fSecurity.AddAccessRule(new FileSystemAccessRule(LocalGroupName, FileSystemRights.FullControl, AccessControlType.Allow));
fSecurity.AddAccessRule(new FileSystemAccessRule(LocalUserName, FileSystemRights.FullControl, AccessControlType.Allow));
File.SetAccessControl(targetDir + "App_Data", fSecurity);
}
catch
{
}
Configuration config = WebConfigurationManager.OpenWebConfiguration("/" + targetVDir, friendlySiteName);
config.AppSettings.Settings["installpath"].Value = targetDir.Substring(0, targetDir.Length - 1);
config.AppSettings.Settings["DBuser"].Value = login();
config.AppSettings.Settings["adminEmail"].Value = Context.Parameters["adminEmail"];
config.ConnectionStrings.ConnectionStrings["DBConnectionString"].ConnectionString = connectionString("oDirectv3");
config.ConnectionStrings.ConnectionStrings["oDirectConnectionString"].ConnectionString = connectionString("oDirectv3");
((CompilationSection)config.GetSection("system.web/compilation")).Debug = false;
config.Save();
}
string connectionString(string db)
{
string server = string.Empty;
if (Context.Parameters["Server"] != string.Empty)
{
server += "Data Source=" + Context.Parameters["Server"] + ";Initial Catalog=" + db + ";Persist Security Info=True;" + login();
}
return server;
}
string login()
{
string login = string.Empty;
if ((Context.Parameters["Username"] != string.Empty) && (Context.Parameters["Password"] != string.Empty))
{
login += "User ID=" + Context.Parameters["Username"] + ";Password=" + Context.Parameters["Password"];
}
return login;
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
}
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
}
}
After that i went to the user interface and added a "Textboxes(A)" and the Properties are like this
EDITA1 = Database Server:
EDITA2 = Username:
EDITA3 = Password:
EDITA4 = System Administrator Email Address:
After here i have created the output(Primary) for the Class Project and for my Website its contents and moved them to the bin Directory.
After that i have created a Cumstom action and i went to the install and Add the Project that is in the bin Derectory and went to the Properties of the Custom Action for install and Added the Following in the "Custom Action Data" Property.
/installpath ="[ EDITA1]\" / DBuser ="[ EDITA2]" /password="[ EDITA3]" / adminEmail ="[ EDITA4]"
Well am not sure about what i have wrote here , your help will be apreciated. After i have done that i have build my setup Project and it came back with no Errors or warning and i tried to install the setup and i filled in the server,username,password and e-mail and after that it continues to install and at the end it gives an Error
"Object reference not set to an instance of an object"
What is it that am Doing wrong ?
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Hi friends,
I am using Asp.net application and sql server 2005. I assigned job for users using job scheduling. ie activate and deactivate while we assign the job at particular time it change at that time(activate/deactivate). While the changes will come at that time i need to send mail for that particular user.
Normally we can send mail using asp.net i know.But in this scenario how can we send mail automatically in db.
IF you have any idea, reply me.
Hope yours reply.
Every Successful Person Have A Painful Story
|
|
|
|
|
hello
i want connectivity in javascript
use asp.net forms
and with use timercontrol at featch record nevigatio from database
|
|
|
|
|
Could be complicate since javascript is client-side and (I assume) the database is at the server.
And why do you want to use a timercontrol for fetching records?
|
|
|
|
|
sounds like you want to make AJAX calls to get data from your database.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi
I have a senario like this i am getting a login page on webbrowser control.
i type user-id and password.on sucessfull login server sends the response which has the cookie Id and Cookie value.How can i get those information.
And on which event i will get those details, Because the submit button is a part of the html content that has loaded to webbroswer control.
(Like i pass a url webbrowser1.url(http://mail.yahoo.com);
i got yahoo mail page in webbrowser control. i typed my userid and password and click submit.In the response i should get the cookie value send by yahoo on a message box.
Please Reply
|
|
|
|
|
|
Hi,
well you have to create a table (whether with 60 columns for each checkbox or a single column where you encrypt the values as a 60-bit long value) and then you have to write a method to store (and another to read) them in the database.
So where is your exact problem? (connection string not working etc.?)
And what do you mean with "pair in 3 at..."?
Regards
Sebastian
|
|
|
|
|
You probably want to lay them out with a repeater so you can make three columns.
Also sounds like you could use a book on ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I admire your ability to comprehend what they want by reading their posts...
|
|
|
|
|
Years of practice....
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am new to SQL data source. I got this coding from net.
<asp:sqldatasource id="Sqlds1" runat="server" datasourcemode="DataReader" connectionstring="<%$ ConnectionStrings:Project%>" xmlns:asp="#unknown">
SelectCommand="SELECT image_path,comments FROM photos where user_id=? and image_id=? and heading=?">
<selectparameters>
<asp:querystringparameter name="path" querystringfield="Label1">
<asp:querystringparameter name="imgid" querystringfield="Label2">
<asp:querystringparameter name="heading" querystringfield="Label3">
<asp:gridview xmlns:asp="#unknown">
id="GridView2"
runat="server"
DataSourceID="Sqlds1">
While executing this coding i got a error in this line of code.
asp:SqlDataSource id="Sqlds1" runat="server" DataSourceMode="DataReader
as InvalidOperationException was unhandled by usercode. Can anyone correct it>
|
|
|
|