|
Please edit your post and do the following:
1. Change title to something more descriptive than "C#". You're in the C# forum, people tend to assume the question is related to C#.
2. Remove the bold text and use the code button in the toolbar (enters the pre tags in the text, your code needs to be between pre tags)
3: Remove User Id and especially password from your connection string and replace with dummy text. Never ever give user id's and password in clear text. Even if it is just a test database.
4: Improve your language a little, even if you're not native English, a space here, a spell check there can work miracles.
5: Maybe related to #4, but I haven't understood the core problem
6: "please guide me tosolve this problem as soon as possible" -> Don't count on it. At best it will work just the opposite way. We're not here to serve you, we're here at our own free will and will help if we can, or want to and we will assign as much time to it as we wish.
On the positive side. You did do some research, you did post some code.
Best of luck.
|
|
|
|
|
thank you,,,
i did what you suggest...
" i'm just a beginner in programming field and i will learn from my faults"
|
|
|
|
|
With that attitude everything will be just fine
|
|
|
|
|
You should post your question in the forum at the end of the article. In that way the author will get notified, and he or she is better placed to help you.
|
|
|
|
|
|
Member 9641406 wrote: The SMSC provider is not registered in your local machine
And presumably you did the following which is from the article that you are referring to.
"The system architecture used for SMS messaging consists of a GSM Modem, that is attached to the PC with a phone-to-PC datacable, an SQL-SMS Gateway software installed onto your PC"
|
|
|
|
|
C# source of send & get SMS: Download[^]
/* LIFE RUNS ON CODE */
|
|
|
|
|
Hy guys...
I am facing a serious problem, with c# sqlTransaction,
The thing is, i have about 7 different tables that i execute a single transactions against(with a their autoIncrement IDs), which works fine for a single user when trying to insert new record... now the problem started when 10 users were capturing the information together and sometimes do concurent transections where the first user submits the form and the transaction starts(e.g at ID 1001), and user number 2 (few seconds after the 1st user) submits as well and get the second(1002) for the 1st and 2nd table, but for some reason(network signal maybe) 1st user insert is slow and and 2nd user's signal(speed) is faster and then the 2nd user ends up getting the 1st ID of the 3rd and the rest of the tables and the 1st user will get the second ID that was assigned to the 2nd user in the 1st 2 tables........
i think the problem here is the isolation mode which i didn't(or couldn't) set for the insert query to prevent the concurent insertion...
If i'm wrong please kindly correct me.
Now what i'm asking is you guys to help me control this...
The languages i'm using is/are..
1.c# in Visual studio 2010
2.Ms sql server 2008 r2
3. and asp.net...
I'd really appreciate ur help...
I'm sorry about the grama, English is not my home languege. thank you in advanve
|
|
|
|
|
|
thanx there man, the solution was to add and IsolationMode(Serializable)........
THANX once again, but u kinda ranked me too low with ur "if u thinking hiring a prof programmer wait till u hire an amatuer...".... i'm way better than an amatuer that this quiz may have reflected of me.... but i'll never stop learning
|
|
|
|
|
Hbr_Tha_real wrote: THANX once again, but u kinda ranked me too low with ur "if u thinking hiring a
prof programmer wait till u hire an amatuer...".... i'm way better than an
amatuer that this quiz may have reflected of me.... but i'll never stop learning
Er, that's just part of my sig. It was said by Red Adair[^] and is spot on but wasn't directed at you!
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
It's okay man and thanx for understanding and not lashing out at me
|
|
|
|
|
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hello,
Existing set up is in classic ASP the HTTP request is made as
CreateObject( "WinHttp.WinHttpRequest.5.1" )
Now, I am using C#. would you say this is a good translation of above?
WebClient wc = new WebClient();
NetworkCredential myCred = new NetworkCredential("myuser", "mypwd");
wc.Credentials = myCred;
wc.DownloadFile("http://my.location.com", @"C:\mylocation.csv");
|
|
|
|
|
A bit more on this:
CreateObject( "WinHttp.WinHttpRequest.5.1" )
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
sURL="http://my.location.com"
sUsername="myuser"
sPassword="mypassword"
objHTTP.Open "GET", sURL, False
objHTTP.SetCredentials sUsername, sPassword ,HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
objHTTP.Send
|
|
|
|
|
I saw the previous post on this same type of question however it wasn't much help
Here is what I need to do
Start at
A0001... A9999 to B0000...Z9999 to AA000...ZZZZZ
I found this code but it didn't explain what to put in the the variables your passing to it.
string base36Characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string toBase36(int x, int digits)
{
char[] result = new char[digits];
for (int i = digits - 1; i >= 0; --i)
{
result[i] = base36Characters[x % 36];
x /= 36;
}
return new string(result);
}
IEnumerable<string> base36Counter()
{
for (int n = 0; n < 36 * 36 * 36 * 36; ++n)
{
yield return toBase36(n, 4);
}
}
void Run()
{
foreach (string s in base36Counter())
Console.WriteLine(s);
}
|
|
|
|
|
Just split the counter as shown below
string base36Characters = "0123456789";
string base36Alaphs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string toBase36(int x, int digits)
{
char[] result = new char[digits];
for (int i = digits - 1; i >= 0; --i)
{
result[i] = base36Characters[x % 10];
x /= 10;
}
return new string(result);
}
IEnumerable<string> base36Counter()
{
for (int i = 0; i < base36Alaphs.Length; i++)
{
for (int n = 0; n <; 10 * 10 * 10 * 10; ++n)
{
yield return base36Alaphs[i] + toBase36(n, 4);
}
}
}
void Run()
{
foreach (string s in base36Counter())
Console.WriteLine(s);
}
|
|
|
|
|
This works only for the single alpha character case (A0000...Z9999), it doesn't handle the next numbers in the sequence OP described.
|
|
|
|
|
Oh... Yes... I didnt notice his second set of sequence..
hmmmm.. need to workout!! Thanks for the hint. will update my answer soon.
|
|
|
|
|
This code you're showing does base 36 which is not what you're showing as what you need.
I.e., the code will produce:
0001, 0002, ... 0009, 000A, 000B, ..., 000Z, 0010, 0011, 0012, ..., 0ZZZ, A000, A001, ... ZZZZ I'm not exactly sure how to get the sequence you are describing...
|
|
|
|
|
Do you just need code to generate the strings in that sequence or do you need conversion to/from int?
The implementations likely will be quite different depending on the answer.
(Code based on the code you've posted assumes all you need is the strings in sequence. And never needing to start mid-sequence!)
|
|
|
|
|
I'm not sure I completely understand...
I think it will always be in sequence... It will never jump around..
Im trying to edit some current code in a stored procedure to see if I can make it work.. But no luck yet
|
|
|
|
|
"...in a stored procedure..."
Do you need the answer as C# or as SQL?
|
|
|
|
|
I can do either really... Right before I left work yesterday I think I got something to resemeble working in the stored procedure.
|
|
|
|
|
This looks like a standard Excel column number followed by a four-digit decimal part. Assuming you need the code in C#, something like this should work:
static string ConvertNumber(int number)
{
if (number < 0) throw new ArgumentOutOfRangeException();
int decimalPart;
int columnNumber = Math.DivRem(number, 10000, out decimalPart) + 1;
int length = 5 + (int)Math.Floor(Math.Log(columnNumber, 26));
int resultIndex = length - 1;
char[] result = new char[length];
for (int i = 0; i < 4; i++)
{
int remainder;
decimalPart = Math.DivRem(decimalPart, 10, out remainder);
result[resultIndex] = (char)('0' + remainder);
resultIndex--;
}
while (columnNumber != 0)
{
int remainder = (columnNumber - 1) % 26;
columnNumber = (columnNumber - remainder - 1) / 26;
result[resultIndex] = (char)('A' + remainder);
resultIndex--;
}
resultIndex++;
return new string(result, resultIndex, length - resultIndex);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|