|
Kakuji wrote: U can pass userid and password as the querystring
This is a very unwise idea.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
See these articles on MSDN for Forms Authentication with SQL Server: .NET 1.1[^] or .NET 2.0[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I know how to put in Usernames and passwords into sql table using the MD5,
What I'm askin' is, Ive got 3 folders with files in them
Admin folder - only admin has access (Whose user name an PWD are in SQL table)
client folder-only client and admin can access
Supervisor - only Supervisor and Admin can access
How do I do this stuff using web.config ?????
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
I have created new skin but when i am seeing it in my site portal skin it is not displying any name through which I can add that skin to my site. I need this as soon as possible.
aashutosh(aashutosh.tiwari@sakasolutions.com)
|
|
|
|
|
Better as this on the DNN forums, I doubt anyone in a C# Windows Forms forum will be able to help.
|
|
|
|
|
Hi
Can any one please tell me how to add the new rows to the existing table with the values using SqlAdapter and Data Row with out using insert statement.
DataSet dset = new DataSet("DBTable");
DataTable dbtable = new DataTable("DBTable"); dset.Tables.Add(dbtable);
SqlCommand dbcommand = new SqlCommand();
dbcommand.CommandText ="select * from DBTable";
dbcommand.Connection = myConnection;
SqlDataAdapter dbDA = new SqlDataAdapter(dbcommand);
dbDA.TableMappings.Add("Table", "DBTable");
dbDA.Fill(dset, "DBTable");
DataRow row;
row = dbtable.NewRow();
row["FileName"] = DBfile;
row["Meters"] = IMeter;
dbtable.Rows.Add(row);
dbDA.Update(dset);
This above code throws exception called "Update requires a valid InsertCommand when passed DataRow collection with new rows." any Idea?
|
|
|
|
|
You need to add a SqlCommand for INSERT to the SqlDataAdapter (you have already done so for SELECT, but passing it to the constructor).
|
|
|
|
|
if u want to update db with dataadapters update method
then u have to define adapters insert command with proper
parameters.
rahul
|
|
|
|
|
You should be replying to the original person asking the question
|
|
|
|
|
Has anyone worked on the concept of printing labels in microsoft word by taking c# as front end and access or excel as the back end...
Regards..
Amrit
|
|
|
|
|
Hi!
Can i send multiple files using the same tcp connection when using TCPClient and TCPListener classes!? I have made client and server part of app, and seems to me that everything is working fine on the server side, but when i try to send the second file through the same connection, i get the error:
"An unhandled exception of type System.InvalidOperationException' occurred in system.dll"
Additional information: Operation not allowed on non-connected sockets!
The code from client send button is:
...
private void buttonSend_Click(object sender, System.EventArgs e)
{
Stream fileStream = File.OpenRead(textBoxFile.Text);
byte[] fileBuffer = new byte[fileStream.Length];
fileStream.Read(fileBuffer,0,(int)fileStream.Length);
networkStream = soket.GetStream(); <- here rises the exception
networkStream.Write(fileBuffer,0,fileBuffer.GetLength(0));
networkStream.Close();
this.label2.Text = System.DateTime.Now;
}
...
When i erase the networkStream.Close(); line, i can send multiple files, but the network stream is never closed, so the file on the server side is always in use and i can`t do anything with it!
Thanx for help!
|
|
|
|
|
eyej wrote: Operation not allowed on non-connected sockets!
When you close the stream the underlying socket is closed. You could connect a second time to send the second file, or, you could introduce a protocol into the application that provides for sending two files.
Do you have any previous experience with TCP application protocols? If not you should read up on them. Some simple ones are SMTP and POP3.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
eyej wrote: networkStream.Close();
You should do that at some other stage, or reopen and close the TCP connection every time, it depends really on your requirements of the application what option you choose.
|
|
|
|
|
Well, i am trying to add a voice clip sending in my messenger app! Same as voice clip sending in MSN Messenger 7.5 and 8! So, it would not be a very good idea to make a new connection everytime a user would like to send a voice clip, because the TCP handshaking period is about couple of seconds and above! It would be much annoying for user to wait that time period!So.. i thought i could open one TCP connection when the application is starting, or when the user click "connect" button and send all voice clips through the same connection! Of course, in both directions! Any help please! How do you think this would be the best to do?
Thanks!
|
|
|
|
|
hi i want to embedd or bind any file to my app in runtime and extract it at run time again( for example i want that user can embedd or bind access db into my exe file or extract it again at run time) how to do that ??
codeproject is best ..
thanks
|
|
|
|
|
Would you explain it more. If you want the schema of an Access DB file then you can use OleDbSchemaGuid.
Saqib
|
|
|
|
|
no i don't want embedd only access db into my app, i want to embedd any file to my app or bind it to my app.(for example i want to bind an exe file to my app).
|
|
|
|
|
With binding what do you exactly mean, like what would you take or give to that bound file.
Saqib
|
|
|
|
|
with binding any file to my app at runtime i wnat that end user bind any file such az exe or bmp or ... bind or embedd to my app that other can not access it .
|
|
|
|
|
I've created a customized control that is basically a textbox with some labels. Among other things, I'm trying to expose a couple attributes of the textbox (called myText).
Within the class of the user control, I've put
<br />
public bool Multiline<br />
{<br />
get { return myText.Multiline; }<br />
set { myText.Multiline = value; }<br />
}<br />
This is all fine, and I can modify this within code, but how do I get this property to show up in the properties window in the .NET designer? Is there some special tag I need to put before it?
|
|
|
|
|
That's all you need, if you want to set the description (displayed at the bottom of the property grid) then use the [Description("Your description")] tag, likewise there's a category attribute (when the property grid is in the category view) and a few others such as designer (not applicable to this property).
But basically any property is by default displayed in the property grid. To hide it use the [Browsable(false|true)] attribute.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Turns out all I needed to do was re-open the designer where I was trying to use the custom form. That got it showing up. Anyways, thanks for the help, and the advice on [Description()]
|
|
|
|
|
hi Drew McGhie!
basically, your code is already fine...
maybe the "myText" textbox is not initialized? if the initialization of this textbox was done on the InitializeComponent method... there would be no problem. perhaps you do the initialization by demand?
hope this helps!
microsoc
|
|
|
|
|
I am trying to parse a email message retrieved using POP3 to extract the subject, the sender, the date and the subject. Do you know a certain open source library or code to help me do that in c#.
|
|
|
|
|
I also have the same proble but this code will help you some what....
Pop3Message msg2 = obj.Retrieve(msg);
Response.Write("Message {0}: {1}");
Response.Write(msg2.number);
Response.Write("aashu1");
//int i = msg2.message.IndexOf("Content-Disposition: inline");
//int j = msg2.message.Substring(i).IndexOf("------=");
//int k = msg2.message.Substring(i).Length;
//int p = k - j-1;
string str1 = Regex.Match(msg2.message, "\nTo <to>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str2 = Regex.Match(msg2.message, "\nFrom <from>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str3 = Regex.Match(msg2.message, "\nCC <cc>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str4 = Regex.Match(msg2.message, "\nSubject <subject>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
int h = msg2.message.IndexOf("\n\n");
string str5 = msg2.message.Substring(h+4);
Response.Write(str1);
Response.Write(" ");
Response.Write(str2);
Response.Write(" ");
Response.Write(str3);
Response.Write(" ");
Response.Write(str4);
Response.Write(" ");
Response.Write(str5);
Response.Write(" ");
Response.Write(" ");
Response.Write(" ");
Response.Write(" ");
aashutosh tiwari
|
|
|
|